This file contains hidden or 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
#!/bin/bash | |
# Many thanks to | |
# https://gist.githubusercontent.com/elliewhatever/adbe3fba37d747fb8b04af8f835d46d2/raw/61e2bd530eb434f7ea2f595262e1922cdd057f7c/PySide6.sh | |
# Assumes brew and python are installed | |
brew install qt@6 llvm cmake ninja git | |
# Setup environment relative to current directory - | |
# this eases building in an existing Python venv. | |
mkdir -p ./.pyside6; cd ./.pyside6 |
This file contains hidden or 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
#ifndef __MATRIX_INCLUDED__ | |
#define __MATRIX_INCLUDED__ | |
#define IDENTITY_MATRIX float4x4(1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1) | |
float4x4 inverse(float4x4 m) { | |
float n11 = m[0][0], n12 = m[1][0], n13 = m[2][0], n14 = m[3][0]; | |
float n21 = m[0][1], n22 = m[1][1], n23 = m[2][1], n24 = m[3][1]; | |
float n31 = m[0][2], n32 = m[1][2], n33 = m[2][2], n34 = m[3][2]; | |
float n41 = m[0][3], n42 = m[1][3], n43 = m[2][3], n44 = m[3][3]; |
This file contains hidden or 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
// | |
// FWKSketchFilter.h | |
// LineEngraver | |
// | |
// Created by Viktor Goltvyanytsya on 8/4/16. | |
// http://www.fwkit.com | |
// | |
// Ported from https://github.com/BradLarson/GPUImage/blob/master/framework/Source/GPUImageSketchFilter.m | |
This file contains hidden or 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
extension UIColor { | |
// based on http://www.zombieprototypes.com/?p=210 who looked at some data and did a bunch of curve fitting | |
static func colorWithKelvin( kelvin: CGFloat) -> UIColor { | |
let k = kelvin < 1000 ? 1000 : ( kelvin > 40000 ? 40000 : kelvin) | |
func interpolate( value: CGFloat, a: CGFloat, b:CGFloat, c:CGFloat) -> CGFloat { | |
return a + b*value + c*log(value) | |
} | |