From f852c6f5a1f7fa412403c89fbc3b1e296993552a Mon Sep 17 00:00:00 2001 From: Beinsezii Date: Sat, 16 Dec 2023 01:47:47 -0800 Subject: [PATCH] Add LRGB to colour_reference.py arrays --- colour_reference.py | 3 +++ src/lib.rs | 3 +-- test_ctypes.py | 3 +-- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/colour_reference.py b/colour_reference.py index a4892dd..0446b33 100755 --- a/colour_reference.py +++ b/colour_reference.py @@ -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) @@ -16,6 +17,7 @@ print() rustprint('srgb', srgb) +rustprint('lrgb', lrgb) rustprint('hsv', hsv) rustprint('xyz', xyz) rustprint('lab', lab) @@ -26,6 +28,7 @@ print() pyprint('srgb', srgb) +pyprint('lrgb', lrgb) pyprint('hsv', hsv) pyprint('xyz', xyz) pyprint('lab', lab) diff --git a/src/lib.rs b/src/lib.rs index cf09e97..0a0d138 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -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]; diff --git a/test_ctypes.py b/test_ctypes.py index a02594c..dea5cda 100755 --- a/test_ctypes.py +++ b/test_ctypes.py @@ -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]