@luma.gl/effects
Version:
Post-processing effects for luma.gl
30 lines • 1.89 kB
TypeScript
/**
* Vibrance - Modifies the saturation of desaturated colors, leaving saturated colors unmodified.
*/
export type VibranceProps = {
/** -1 to 1 (-1 is minimum vibrance, 0 is no change, and 1 is maximum vibrance) */
amount?: number;
};
export type VibranceUniforms = VibranceProps;
/** Vibrance - Modifies the saturation of desaturated colors, leaving saturated colors unmodified. */
export declare const vibrance: {
readonly props: VibranceProps;
readonly uniforms: VibranceUniforms;
readonly name: "vibrance";
readonly uniformTypes: {
readonly amount: "f32";
};
readonly propTypes: {
readonly amount: {
readonly value: 0;
readonly min: -1;
readonly max: 1;
};
};
readonly source: "struct vibranceUniforms {\n amount: f32\n};\n\n@group(0) @binding(1) var<uniform> vibrance: vibranceUniforms;\n\nfn vibrance_filterColor(vec4f color) -> vec4f {\n let average: f32 = (color.r + color.g + color.b) / 3.0;\n let mx: f32 = max(color.r, max(color.g, color.b));\n let amt: f32 = (mx - average) * (-vibrance.amount * 3.0);\n color.rgb = mix(color.rgb, vec3(mx), amt);\n return color;\n}\n\nvec4 vibrance_filterColor_ext(vec4 color, vec2 texSize, vec2 texCoord) {\n return vibrance_filterColor(color);\n}\n";
readonly fs: "uniform vibranceUniforms {\n float amount;\n} vibrance;\n\nvec4 vibrance_filterColor(vec4 color) {\n float average = (color.r + color.g + color.b) / 3.0;\n float mx = max(color.r, max(color.g, color.b));\n float amt = (mx - average) * (-vibrance.amount * 3.0);\n color.rgb = mix(color.rgb, vec3(mx), amt);\n return color;\n}\n\nvec4 vibrance_filterColor_ext(vec4 color, vec2 texSize, vec2 texCoord) {\n return vibrance_filterColor(color);\n}\n";
readonly passes: [{
readonly filter: true;
}];
};
//# sourceMappingURL=vibrance.d.ts.map