{"i":"EMWW","m":"get_firmware_info","p":{}}
{"m":"trigger_current_state","p":{}}
{"m":"program_modechange","p":{"mode":"play"}} // "mode": "play" or "download"
{"i":"ESGe","m":"set_hub_name","p":{"name":"U1BJS0U="}} // "name": Base64 string
if (new URLSearchParams(window.location.search).get('portal')) { | |
// <create start portal> | |
// Create portal group to contain all portal elements | |
const startPortalGroup = new THREE.Group(); | |
startPortalGroup.position.set(SPAWN_POINT_X, SPAWN_POINT_Y, SPAWN_POINT_Z); | |
startPortalGroup.rotation.x = 0.35; | |
startPortalGroup.rotation.y = 0; | |
// Create portal effect |
private func createTexture(sampleBuffer: CMSampleBuffer, planeIndex: Int, pixelFormat: MTLPixelFormat) throws -> MTLTexture { | |
guard let cvImageBuffer = CMSampleBufferGetImageBuffer(sampleBuffer) else { | |
throw MyError.normal | |
} | |
let isPlanar = CVPixelBufferIsPlanar(cvImageBuffer) | |
let width = isPlanar ? CVPixelBufferGetWidthOfPlane(cvImageBuffer, planeIndex) : CVPixelBufferGetWidth(cvImageBuffer) | |
let height = isPlanar ? CVPixelBufferGetHeightOfPlane(cvImageBuffer, planeIndex) : CVPixelBufferGetHeight(cvImageBuffer) | |
var cvMetalTexture: CVMetalTexture? | |
CVMetalTextureCacheCreateTextureFromImage(nil, _textureCache!, cvImageBuffer, nil, pixelFormat, width, height, planeIndex, &cvMetalTexture) |
// Copyright 2019 Google LLC. | |
// SPDX-License-Identifier: Apache-2.0 | |
// Polynomial approximation in GLSL for the Turbo colormap | |
// Original LUT: https://gist.github.com/mikhailov-work/ee72ba4191942acecc03fe6da94fc73f | |
// Authors: | |
// Colormap Design: Anton Mikhailov ([email protected]) | |
// GLSL Approximation: Ruofei Du ([email protected]) |
// What is an alias method? | |
// If we have a list of elements with different frequencies, | |
// like the letters in the English language… | |
let frequencies = [ | |
("a", 8.167), ("b", 1.492), ("c", 2.782), ("d", 4.253), ("e", 12.702), | |
("f", 2.228), ("g", 2.015), ("h", 6.094), ("i", 6.966), ("j", 0.153), | |
("k", 0.772), ("l", 4.025), ("m", 2.406), ("n", 6.749), ("o", 7.507), | |
("p", 1.929), ("q", 0.095), ("r", 5.987), ("s", 6.327), ("t", 9.056), | |
("u", 2.758), ("v", 0.978), ("w", 2.360), ("x", 0.150), ("y", 1.974), |
Y = a * R + b * G + c * B
Cb = (B - Y) / d
Cr = (R - Y) / e
BT.601 | BT.709 | BT.2020 | |
---|---|---|---|
a | 0.299 | 0.2126 | 0.2627 |
b | 0.587 | 0.7152 | 0.6780 |
The attached lldb command pblock
command lets you peek inside an Objective-C block. It tries to tell you where to find the source code for the block, and the values captured by the block when it was created.
Consider this example program:
#import <Foundation/Foundation.h>
@interface Foo: NSObject
@end
@implementation Foo
legacy = UIGraphicsBeginImageContextWithOptions
+ UIGraphicsEndImageContext
modern = UIGraphicsImageRendererFormat
+ UIGraphicsImageRenderer
prefersExtendedRange = NO
prefersExtendedRange = YES
// | |
// ============================================================================ | |
// | |
// Quick sketch / rough idea of a redux store/state/action/reducer pattern. | |
// | |
// This works differently to ReduxJS, in that the reducer does not implement a | |
// switch statement for the action, but instead uses a double-dispatch | |
// functional call from the action to a factory that produces the redicer. | |
//. The store also has methods for each action type. | |
// |
Author: Chris Lattner