LYGIA Shader Library

srgb2xyz (lygia/color/space/srgb2xyz)

Converts a sRGB color to XYZ

Dependencies:

Use:

<vec3|vec4> srgb2xyz(<vec3|vec4> srgb)

Check it on Github



#ifndef FNC_SRGB2XYZ
#define FNC_SRGB2XYZ
vec3 srgb2xyz(const in vec3 srgb) { return rgb2xyz(srgb2rgb(srgb));}
vec4 srgb2xyz(const in vec4 srgb) { return vec4(srgb2xyz(srgb.rgb),srgb.a); }
#endif

Dependencies:

Use:

<float3|float4> srgb2xyz(<float3|float4> rgb)

Check it on Github



#ifndef FNC_RGB2XYZ
#define FNC_RGB2XYZ
float3 srgb2xyz(in float3 srgb) { return rgb2xyz(rgb2srgb(srgb));}
float4 srgb2xyz(in float4 srgb) { return float4(rgb2xyz(srgb.rgb),rgb.a); }
#endif

Dependencies:

Use:

<float3|float4> srgb2xyz(<float3|float4> srgb)

Check it on Github



#ifndef FNC_SRGB2XYZ
#define FNC_SRGB2XYZ
float3 srgb2xyz( float3 srgb) { return rgb2xyz(srgb2rgb(srgb));}
float4 srgb2xyz( float4 srgb) { return float4(srgb2xyz(srgb.rgb),srgb.a); }
#endif

Dependencies:

Check it on Github




fn srgb2xyz(srgb: vec3f) -> vec3f { return rgb2xyz(srgb2rgb(srgb)); }

Licenses

LYGIA is dual-licensed under the Prosperity License and the Patron License for sponsors and contributors.

Sponsors and contributors are automatically added to the Patron License and they can ignore the any non-commercial rule of the Prosperity Licensed software (please take a look to the exception).

It's also possible to get a permanent comercial license hook to a single and specific version of LYGIA.

Get the latest news and releases

Sign up for the news letter bellow, joing the LYGIA's channel on Discord or follow the Github repository