This document is a scratchpad for helping me learn commonly used actions in Xcode's VIM mode.
Commands are case-sensitive. A command of N means pressing shift + n on the keyboard.
[Formatting is a WIP]
| kernel vec4 coreImageKernel(__color startColor, __color endColor) | |
| { | |
| vec2 point = destCoord(); | |
| float angle = atan(point.y, point.x) + radians(180.0); | |
| //Start from the upper middle, not the left middle | |
| angle += radians(90.0); | |
| angle = mod(angle, radians(360.0)); | |
| float fraction = angle / radians(360.0); |
| Spherical cap cone analytic solution is a 1d problem, since the cone cap sphere slides along the ray. The intersection point to empty space sphere is always on the ray. | |
| S : radius of cone cap sphere at t=1 | |
| r(d) : cone cap sphere radius at distance d | |
| r(d) = d*S | |
| p = distance of current SDF sample | |
| SDF(p) = sdf function result at location p | |
| x = distance after conservative step |
| // https://www.cs.rit.edu/~ncs/color/t_convert.html | |
| struct RGB { | |
| // Percent | |
| let r: Float // [0,1] | |
| let g: Float // [0,1] | |
| let b: Float // [0,1] | |
| static func hsv(r: Float, g: Float, b: Float) -> HSV { | |
| let min = r < g ? (r < b ? r : b) : (g < b ? g : b) | |
| let max = r > g ? (r > b ? r : b) : (g > b ? g : b) |
| import AVFoundation | |
| import Foundation | |
| // The maximum number of audio buffers in flight. Setting to two allows one | |
| // buffer to be played while the next is being written. | |
| private let kInFlightAudioBuffers: Int = 2 | |
| // The number of audio samples per buffer. A lower value reduces latency for | |
| // changes but requires more processing but increases the risk of being unable | |
| // to fill the buffers in time. A setting of 1024 represents about 23ms of |