This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
#include <stdlib.h> | |
#include <math.h> | |
#include <string.h> | |
#include <vector> | |
#include <string> | |
#include <chrono> | |
using namespace std; | |
#ifndef _WIN32 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
#include <stdlib.h> | |
#include <vector> | |
#include <string> | |
#include <chrono> | |
using namespace std; | |
#ifndef _WIN32 | |
#define redir_str " >/dev/null 2>/dev/null" | |
#include <sys/times.h> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--[[ | |
name: Declicker | |
description: > | |
Declicker for saliva sounds etc. Based on a built-in filter for protoplug (but none of the original code remains). | |
--]] | |
require "include/protoplug" | |
local filters = {} | |
stereoFx.init() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// wiring example for ripping a PMW3360 SROM: https://i.imgur.com/EspAlvz.jpeg | |
// set the board to 240mhz or higher for best results (WARNING: higher than 240mhz only works with USB if you overvolt the MCU) | |
// this implements reading SPI mode 3. if you want a different mode, you need to edit these two lines: | |
// uint32_t clockval = (1 << pin_clock); | |
// if (newclock && !clockval && buff_i < buffsize) | |
#include <pico/stdlib.h> | |
#define buffsize 50000 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
fn big_rle_compress(input : &[u8]) -> Vec<u8> | |
{ | |
let mut ret = Vec::new(); | |
let mut i = 0; | |
let mut mode = 0; // 0 - raw, 1 - rle | |
let mut mode_index = 0; | |
while i < input.len() | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// GLSL code for rendering numbers without using any textures or global arrays, using a tiny bitmap font | |
// for debugging! | |
// public domain. use under the creative commons zero license (any version) | |
// warning: the float-to-decimal conversion logic is "incorrect" and can only give around around four or five decimal places of floating point decision | |
const int _print_number_max_float_digits = 5; | |
const int _print_number_scale = 2; | |
const int _print_number_stretch_x = 1; | |
const int _print_number_stretch_y = 1; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
extends Sprite2D | |
func convolve(base : Image, kernel : Image, offset : Vector2i, stride : Vector2i = Vector2i(1, 1), factor : float = 1.0, bias : float = 0.0): | |
#var new = Image.create(base.get_size().x/stride.x, base.get_size().y/stride.y, false, Image.FORMAT_RGBA8) | |
var new = Image.create(base.get_size().x, base.get_size().y, false, Image.FORMAT_RGBAF) | |
for y in range(0, base.get_size().y):#, stride.y): | |
for x in range(0, base.get_size().x):#, stride.x): | |
var sum = Color(0, 0, 0, 0) | |
var coord = Vector2i(x, y) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// NOTE: inefficient, uses a lot of branches. only for demonstration. | |
// use under the creative commons zero license, any version | |
vec3 normal_encode(vec3 normal) | |
{ | |
// map onto octagon | |
normal *= 1.0/(abs(normal.x) + abs(normal.y) + abs(normal.z)); | |
// project | |
float n = normal.x; | |
float m = normal.y; | |
// shift projection for back layer |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// cargo add sha2 and plotters | |
use sha2::Digest; | |
use plotters::prelude::*; | |
const OUT_FILE_NAME: &'static str = "output-test.png"; | |
fn main() { | |
// same for Sha512 | |
let mut bins_a = vec!(0; 256); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
uniform_float uRange { | |
default = 5; | |
min = 1; | |
max = 16.0; | |
step = 1; | |
description = "How many pixels the algorithm follows to try to detect an edge."; | |
display_name = "Range"; | |
} | |
uniform_float uThreshold { | |
default = 20.0; |
NewerOlder