MCPcopy Create free account
hub / github.com/PerroEngine/Perro / srgb_to_linear_rgb

Function srgb_to_linear_rgb

perro_source/render_stack/perro_graphics/src/lib.rs:48–54  ·  view source on GitHub ↗
(rgb: [f32; 3])

Source from the content-addressed store, hash-verified

46pub(crate) fn srgb_channel_to_linear(c: f32) -> f32 {
47 if !c.is_finite() || c <= 0.0 {
48 0.0
49 } else if c <= 0.04045 {
50 c / 12.92
51 } else if c <= 1.0 {
52 ((c + 0.055) / 1.055).powf(2.4)
53 } else {
54 c
55 }
56}
57

Callers 4

build_scene_uniformFunction · 0.85
prepareMethod · 0.85
pack_emissive_hdrFunction · 0.85
build_instanceFunction · 0.85

Calls 1

srgb_channel_to_linearFunction · 0.85

Tested by

no test coverage detected