Skip to content

Instantly share code, notes, and snippets.

View fenderrex's full-sized avatar

rex fenderrex

View GitHub Profile
@fenderrex
fenderrex / reduction.py
Last active November 16, 2023 03:24
I was just trying to find how I can remove reduce hard drive space while producing a commercial amount of video idea here works but you need to read it and understand that it was done on a phone with long video clips
#Rex Baird <fenderrex@gmail.com>
#Fri, Oct 6, 2:49 PM
#to me
#i made this on py droid so ill make a few branches?
#what: is reduction? ok so the goil is to hilight changes in a video stream currently drops the output to a gif
#why: because this ran on my phone the filter of frames was vittal
#i wantted to record what i was doing in a way that i could review latter
#I want to make the filter customizable got for now
#this is a demo and it shows the root idea, some numbers need be changed to
@fenderrex
fenderrex / gist:3b0db75771a009d496cd622d01d41cd7
Created January 16, 2023 08:09
turns a texture object into a 2DTexture object
/// <summary>
/// turns a texture object into a 2DTexture object
/// </summary>
/// <param name="texture"> inputTexture </param>
/// <returns>a 2DTexture from the texture object</returns>
///<example>
/// This shows why you might need it. https://github.com/fenderrex
/// <code>
/// RawTexture rawTexture = GetComponent<RawImage>();
/// texture2D valueOut= TextureToDepth(rawTexture.texture);
@fenderrex
fenderrex / Resample.hpp
Created October 13, 2021 06:40 — forked from pixelpusher/Resample.hpp
Downsampling example for C++
/**
* Resampling algo from http://en.wikipedia.org/wiki/Lanczos_resampling
* Adapted by / copyright Evan Raskob <evan@flkr.com>, 2009-2019
* Free to use with attribution to all original authors / MIT License
* https://opensource.org/licenses/MIT
*
* Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
* The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
using System;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
// map projections that aim to be traversable these projection an approch to alot for fast compute times would use rtos dma for table lookups
public class DysonSphere : MonoBehaviour
{
float _x = 0;
float _y = 1;
public float timeR=0;
@fenderrex
fenderrex / json.loads() string to file demonstration
Last active July 20, 2016 18:04
best use json.loads(io.StringIO(["some data","this could be a string ect..."]))
#dont like importing like someone who wont read? use
class wrapper(string):#or String or str one of the the will work
def __init__(self,str):
self.str=str
def read(self):
return self.str
#google python __get__ __set__
json.loads(wrapper("what ever data"))#fix first error and only? lol
#or
#json.loads(io.StringIO(["some data","this could be a string ect..."]))
@fenderrex
fenderrex / fluffy python object
Created July 1, 2016 20:29
Fluffy python object (data management object with databace commit like structure) a rip from my ebay sdk inventory project (non open source... yet)
class Item(object):#TODO: should i commit this to git?
_dict = {"vat":{}}#TODO: DB this data for easy searching...
def keys(self):
a=[]
b=[]
for part in self.dict.keys():
a.append(part)
for part in self.number.keys():
b.append(part)
a.append({"number":b})#add a directory to the other format of data "numbers only for auto processing"