/** * The chroma key shader works in the YUV color space, * using the U and V components to measure how far a pixel is from the key color. * * If the distance is below a threshold called similarity, the pixel is fully transparent. * Beyond that, the transparency rises. The smoothness parameter controls how quickly the transparency rises * * Similarly, the pixel is desaturated to the extent that its chrominance is close to the key color. * This attempts to account for light reflected from the subject * The spill parameter controls how quickly this desaturation drops off. */ export interface KeyColor { r: number; g: number; b: number; } /** * This Documention is intended to belong in docs/web-sdk/guides/scene-configurations.md * But it is kept here while this feature is not supported. * * The file /dedicated-workers/chroma-key.worker.js must also be hosted at this path for the smwebsdk to load it * upon enabling of this feature. There are no consequences in its absence if this feature is not enabled * * - optional `chromaKeyOptions`: By default, the Soul Machines Web SDK will not apply chromaKey compositing. Optionally, chromaKey compositing can be activated by setting chomaKeyOptions to `{ enabled: true }`. There are more options for chromaKey settings. * ``` * interface ChromaKeyOptions { * enabled: boolean; // enable or disable chromaKey compositing * keyColor?: KeyColor; // the background color to be made transparent. * // default value as { r: 4 / 255, g: 244 / 255, b: 4 / 255} * similarity?: number; // The chroma key shader works in the YUV color space, using * // the U and V components to measure how far a pixel is from * // the key color. * // If the distance is below a threshold called similarity, the * // pixel is fully transparent. Beyond that, the transparency rises. * // default value is 0.4 * smoothness?: number; // the pixel is desaturated to the extent that its chrominance * // is close to the key color. * // This attempts to account for light reflected from the subject * // default value is 0.08 * spill?: number; // this parameter controls how quickly this desaturation drops off * // default value is 0.1 * } * export interface KeyColor { * r: number; // [0, 1] * g: number; // [0, 1] * b: number; // [0, 1] * } * ``` */ export interface ChromaKeyOptions { enabled: boolean; keyColor?: KeyColor; similarity?: number; smoothness?: number; spill?: number; } export declare function updateChromaKeyOptions(options: ChromaKeyOptions): void; export declare let offscreenCanvas: OffscreenCanvas | any; export declare function initWebGL_rgb(width: number, height: number): Promise; export declare function initWebGL_rgb_with_canvas(canvas: any): void; export declare function render_rgb(width: number, height: number, data: any): void; //# sourceMappingURL=chroma-key.worker.d.ts.map