Skip to content

Commit

Permalink
Add LRGB to colour_reference.py arrays
Browse files Browse the repository at this point in the history
  • Loading branch information
Beinsezii committed Dec 16, 2023
1 parent 27ef01b commit f852c6f
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
3 changes: 3 additions & 0 deletions colour_reference.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

d65 = colour.xyY_to_XYZ(colour.xy_to_xyY(colour.CCS_ILLUMINANTS["CIE 1931 2 Degree Standard Observer"]["D65"]))
srgb = np.array([0.2, 0.35, 0.95], dtype=np.float64)
lrgb = colour.models.eotf_sRGB(srgb)
hsv = colour.RGB_to_HSV(srgb)
xyz = colour.sRGB_to_XYZ(srgb)
lab = colour.XYZ_to_Lab(xyz)
Expand All @@ -16,6 +17,7 @@
print()

rustprint('srgb', srgb)
rustprint('lrgb', lrgb)
rustprint('hsv', hsv)
rustprint('xyz', xyz)
rustprint('lab', lab)
Expand All @@ -26,6 +28,7 @@
print()

pyprint('srgb', srgb)
pyprint('lrgb', lrgb)
pyprint('hsv', hsv)
pyprint('xyz', xyz)
pyprint('lab', lab)
Expand Down
3 changes: 1 addition & 2 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -630,13 +630,12 @@ pub extern "C" fn lch_to_lab(pixel: &mut [f32; 3]) {
mod tests {
use super::*;

// consts without colour-science references
const HEX: &str = "#3359F2";
const IRGB: [u8; 3] = [51, 89, 242];
const LRGB: [f32; 3] = [0.033105, 0.100482, 0.890006];

// colour-science references
const SRGB: [f32; 3] = [0.20000000, 0.35000000, 0.95000000];
const LRGB: [f32; 3] = [0.03310477, 0.10048151, 0.89000541];
const HSV: [f32; 3] = [0.63333333, 0.78947368, 0.95000000];
const XYZ: [f32; 3] = [0.21023057, 0.14316084, 0.85856646];
const LAB: [f32; 3] = [44.68286380, 40.81934559, -80.13283179];
Expand Down
3 changes: 1 addition & 2 deletions test_ctypes.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,8 @@
colcon.correct_gamma.restype = ctypes.c_float
colcon.hk_comp_2023.argtypes = [cpixel]

LRGB = [0.033105, 0.100482, 0.890006]

SRGB = [0.20000000, 0.35000000, 0.95000000]
LRGB = [0.03310477, 0.10048151, 0.89000541]
HSV = [0.63333333, 0.78947368, 0.95000000]
XYZ = [0.21023057, 0.14316084, 0.85856646]
LAB = [44.68286380, 40.81934559, -80.13283179]
Expand Down

0 comments on commit f852c6f

Please sign in to comment.