10 return (c < 0.0) ? 0.0 : c * (1.0 / 12.92);
13 return pow((c + 0.055) * (1.0 / 1.055), 2.4);
20 return (c < 0.0) ? 0.0 : c * 12.92;
23 return 1.055 *
pow(c, 1.0 / 2.4) - 0.055;
43 if (alpha != 1.0 && alpha != 0.0) {
63 if (y != 0.0 &&
Y != 0.0) {
64 Z = ((1.0 - x -
y) / y) *
Y;
75 return color(3.240479 * x + -1.537150 * y + -0.498535 *
z,
76 -0.969256 * x + 1.875991 * y + 0.041556 *
z,
77 0.055648 * x + -0.204043 * y + 1.057311 *
z);
82 float cmax, cmin, h, s,
v, cdelta;
85 cmax =
max(rgb[0],
max(rgb[1], rgb[2]));
86 cmin =
min(rgb[0],
min(rgb[1], rgb[2]));
103 c = (
color(cmax, cmax, cmax) - rgb) / cdelta;
105 if (rgb[0] == cmax) {
108 else if (rgb[1] == cmax) {
109 h = 2.0 + c[0] - c[2];
112 h = 4.0 + c[1] - c[0];
127 float i, f, p, q, t, h, s,
v;
145 rgb =
color(f, f, f);
147 q =
v * (1.0 - (s * f));
148 t =
v * (1.0 - (s * (1.0 - f)));
175 float cmax, cmin, h, s,
l;
177 cmax =
max(rgb[0],
max(rgb[1], rgb[2]));
178 cmin =
min(rgb[0],
min(rgb[1], rgb[2]));
179 l =
min(1.0, (cmax + cmin) / 2.0);
185 float cdelta = cmax - cmin;
186 s =
l > 0.5 ? cdelta / (2.0 - cmax - cmin) : cdelta / (cmax + cmin);
187 if (cmax == rgb[0]) {
188 h = (rgb[1] - rgb[2]) / cdelta + (rgb[1] < rgb[2] ? 6.0 : 0.0);
190 else if (cmax == rgb[1]) {
191 h = (rgb[2] - rgb[0]) / cdelta + 2.0;
194 h = (rgb[0] - rgb[1]) / cdelta + 4.0;
204 float nr, ng, nb, chroma, h, s,
l;
210 nr =
abs(h * 6.0 - 3.0) - 1.0;
211 ng = 2.0 -
abs(h * 6.0 - 2.0);
212 nb = 2.0 -
abs(h * 6.0 - 4.0);
214 nr =
clamp(nr, 0.0, 1.0);
215 nb =
clamp(nb, 0.0, 1.0);
216 ng =
clamp(ng, 0.0, 1.0);
218 chroma = (1.0 -
abs(2.0 *
l - 1.0)) * s;
220 return color((nr - 0.5) * chroma +
l, (ng - 0.5) * chroma +
l, (nb - 0.5) * chroma +
l);
Group Output data from inside of a node group A color picker Mix two input colors RGB to Convert a color s luminance to a grayscale value Generate a normal vector and a dot product Brightness Control the brightness and contrast of the input color Vector Map input vector components with curves Camera Retrieve information about the camera and how it relates to the current shading point s position Clamp a value between a minimum and a maximum Vector Perform vector math operation Invert Invert a color
ATTR_WARN_UNUSED_RESULT const BMLoop * l
ATTR_WARN_UNUSED_RESULT const BMVert * v
SIMD_FORCE_INLINE const btScalar & z() const
Return the z value.
pow(value.r - subtrahend, 2.0)") .do_static_compilation(true)
ccl_device_inline float2 floor(const float2 a)
float color_scene_linear_to_srgb(float c)
color hsl_to_rgb(color hsl)
color hsv_to_rgb(color hsv)
float color_srgb_to_scene_linear(float c)
color rgb_to_hsl(color rgb)
color color_unpremultiply(color c, float alpha)
color xyY_to_xyz(float x, float y, float Y)
color xyz_to_rgb(float x, float y, float z)
color rgb_to_hsv(color rgb)
ccl_device_inline int abs(int x)
ccl_device_inline int clamp(int a, int mn, int mx)