Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Split the TransferFn trait and add lookup tables for sRGB #279

Merged
merged 3 commits into from
Apr 9, 2022

Conversation

Ogeon
Copy link
Owner

@Ogeon Ogeon commented Apr 3, 2022

This changes how the transfer functions work a bit:

  • TransferFn has been split into FromLinear and IntoLinear.
  • The two traits take two type parameters; one for the linear encoding and one for the non-linear encoding.

The split is useful for cases when a conversion is irreversible, as mentioned in #245. The two type parameters makes it possible to convert between number types while encoding and decoding. This makes it possible to skip .into_format() in some cases (currently when converting between u8 and either f32 or f64). In addition to that, I made those special cases faster by using fast-srgb8, and a similar lookup table for f64.

Closed Issues

Breaking Change

  • TransferFn has been split into FromLinear and IntoLinear.
  • {Rgb, Luma}::{from, into}_linear and {Rgb, Luma}::{from, into}_encoding are now allowed to change the output type. This changes the API and type inference. The solution for the type inference is usually to remove into_format from the call chain.
  • {Rgb, Luma}::{from, into}_encoding will only convert from linear encoding, not "cross convert" between encodings.
  • The number type parameter and 'staticlifetime were removed from RgbStandard, LumaStandard and RgbSpace.

@Ogeon Ogeon force-pushed the split_transfer_fn branch from 8cbc44c to c0930e8 Compare April 3, 2022 19:20
@github-actions
Copy link

github-actions bot commented Apr 3, 2022

Benchmark for 50df92e

Click to view benchmark
Test Base PR %
Cie family/lab to lch 3.4±0.32µs 38.0 MElem/sec N/A N/A
Cie family/lab to xyz 886.8±33.66ns 146.3 MElem/sec N/A N/A
Cie family/lch to lab 2.7±0.15µs 47.2 MElem/sec N/A N/A
Cie family/linsrgb to xyz 3.9±0.18µs 32.9 MElem/sec N/A N/A
Cie family/linsrgb to xyz - wide::f32x8 716.2±37.33ns 181.1 MElem/sec N/A N/A
Cie family/xyz to lab 19.9±0.90µs 20.0±0.97µs +0.50%
Cie family/xyz to yxy 594.0±26.37ns 218.4 MElem/sec N/A N/A
Cie family/yxy to xyz 645.9±29.99ns 200.8 MElem/sec N/A N/A
Matrix functions/matrix_inverse 11.9±0.60ns 80.4 MElem/sec N/A N/A
Matrix functions/multiply_3x3 11.2±0.73ns 84.9 MElem/sec N/A N/A
Matrix functions/multiply_rgb_to_xyz 5.3±0.25ns 181.4 MElem/sec N/A N/A
Matrix functions/multiply_xyz 5.3±0.25ns 181.4 MElem/sec N/A N/A
Matrix functions/multiply_xyz_to_rgb 5.2±0.19ns 182.6 MElem/sec N/A N/A
Matrix functions/rgb_to_xyz_matrix 22.6±1.31ns 42.2 MElem/sec N/A N/A
Rgb family/hsl to hsv 723.8±59.96ns 179.2 MElem/sec N/A N/A
Rgb family/hsl to linear hsl 14.0±0.61µs 14.4±3.62µs +2.86%
Rgb family/hsl to rgb 2.8±0.14µs 46.9 MElem/sec N/A N/A
Rgb family/hsv to hsl 1362.4±62.01ns 95.2 MElem/sec N/A N/A
Rgb family/hsv to hwb 272.1±25.03ns 476.7 MElem/sec N/A N/A
Rgb family/hsv to linear hsv 13.3±0.65µs 13.1±0.71µs -1.50%
Rgb family/hsv to rgb 2.5±0.10µs 52.1 MElem/sec N/A N/A
Rgb family/hwb to hsv 599.1±28.08ns 216.5 MElem/sec N/A N/A
Rgb family/hwb to linear hwb 13.9±0.66µs 14.0±0.71µs +0.72%
Rgb family/linear hsl to hsl 11.8±0.54µs 11.0 MElem/sec N/A N/A
Rgb family/linear hsv to hsv 11.5±0.51µs 11.3 MElem/sec N/A N/A
Rgb family/linear hwb to hwb 11.8±0.63µs 11.0 MElem/sec N/A N/A
Rgb family/linsrgb to rgb 6.9±0.49µs 18.8 MElem/sec N/A N/A
Rgb family/linsrgb to rgb - wide::f32x8 9.2±0.72µs 14.1 MElem/sec N/A N/A
Rgb family/linsrgb_f32 to rgb_u8 7.4±0.31µs 17.6 MElem/sec N/A N/A
Rgb family/rgb to hsl 1059.3±56.93ns 122.4 MElem/sec N/A N/A
Rgb family/rgb to hsl - wide::f32x8 672.2±52.89ns 192.9 MElem/sec N/A N/A
Rgb family/rgb to hsv 790.2±43.66ns 164.1 MElem/sec N/A N/A
Rgb family/rgb to hsv - wide::f32x8 624.1±28.36ns 207.8 MElem/sec N/A N/A
Rgb family/rgb to linsrgb 9.6±0.48µs 13.5 MElem/sec N/A N/A
Rgb family/rgb to linsrgb - wide::f32x8 6.5±0.42µs 19.9 MElem/sec N/A N/A
Rgb family/rgb_u8 to linsrgb_f32 9.7±0.60µs 13.3 MElem/sec N/A N/A
Rgb family/xyz to linsrgb 6.4±0.32µs 20.4 MElem/sec N/A N/A
Rgb family/xyz to linsrgb - wide::f32x8 1108.0±68.79ns 117.1 MElem/sec N/A N/A

@Ogeon
Copy link
Owner Author

Ogeon commented Apr 3, 2022

Oh, right, the throughput still breaks it. 😫

@github-actions
Copy link

github-actions bot commented Apr 3, 2022

Benchmark for edf7b81

Click to view benchmark
Test Base PR %
Cie family/lab to lch 4.1±0.17µs 4.2±0.23µs +2.44%
Cie family/lab to xyz 1098.5±85.75ns 1049.9±46.12ns -4.42%
Cie family/lch to lab 2.8±0.12µs 2.8±0.13µs 0.00%
Cie family/linsrgb to xyz 4.5±0.23µs 4.6±0.18µs +2.22%
Cie family/linsrgb to xyz - wide::f32x8 817.3±48.09ns 805.4±27.52ns -1.46%
Cie family/xyz to lab 21.0±0.72µs 22.1±1.02µs +5.24%
Cie family/xyz to yxy 586.2±37.33ns 589.7±25.43ns +0.60%
Cie family/yxy to xyz 793.2±73.37ns 719.7±28.98ns -9.27%
Matrix functions/matrix_inverse 12.2±0.39ns 12.5±0.44ns +2.46%
Matrix functions/multiply_3x3 11.2±0.89ns 11.3±0.39ns +0.89%
Matrix functions/multiply_rgb_to_xyz 5.4±0.11ns 5.6±0.36ns +3.70%
Matrix functions/multiply_xyz 5.4±0.15ns 5.7±0.30ns +5.56%
Matrix functions/multiply_xyz_to_rgb 5.5±0.15ns 5.6±0.41ns +1.82%
Matrix functions/rgb_to_xyz_matrix 23.4±1.15ns 23.7±1.50ns +1.28%
Rgb family/hsl to hsv 686.1±25.75ns 676.0±25.55ns -1.47%
Rgb family/hsl to linear hsl 15.1±0.36µs 15.2±0.41µs +0.66%
Rgb family/hsl to rgb 2.9±0.21µs 2.9±0.13µs 0.00%
Rgb family/hsv to hsl 1254.3±37.48ns 1392.4±289.76ns +11.01%
Rgb family/hsv to hwb 272.3±13.71ns 266.1±10.60ns -2.28%
Rgb family/hsv to linear hsv 14.8±0.72µs 15.6±0.79µs +5.41%
Rgb family/hsv to rgb 2.8±0.10µs 2.9±0.50µs +3.57%
Rgb family/hwb to hsv 599.5±31.44ns 580.7±27.22ns -3.14%
Rgb family/hwb to linear hwb 15.3±0.58µs 15.4±0.82µs +0.65%
Rgb family/linear hsl to hsl 12.7±0.43µs 13.0±0.56µs +2.36%
Rgb family/linear hsv to hsv 12.5±0.52µs 17.5±0.65µs +40.00%
Rgb family/linear hwb to hwb 13.9±2.70µs 13.1±0.69µs -5.76%
Rgb family/linsrgb to rgb 8.0±0.91µs 7.3±0.21µs -8.75%
Rgb family/linsrgb to rgb - wide::f32x8 9.5±1.01µs 8.8±0.25µs -7.37%
Rgb family/linsrgb_f32 to rgb_u8 8.3±0.29µs 16.4±0.51µs +97.59%
Rgb family/rgb to hsl 1054.2±37.68ns 1077.6±28.48ns +2.22%
Rgb family/rgb to hsl - wide::f32x8 686.9±60.89ns 652.6±35.29ns -4.99%
Rgb family/rgb to hsv 807.1±30.29ns 840.0±38.52ns +4.08%
Rgb family/rgb to hsv - wide::f32x8 621.3±22.48ns 618.6±29.20ns -0.43%
Rgb family/rgb to linsrgb 10.4±0.93µs 10.4±0.29µs 0.00%
Rgb family/rgb to linsrgb - wide::f32x8 6.7±0.23µs 7.0±0.21µs +4.48%
Rgb family/rgb_u8 to linsrgb_f32 10.7±0.60µs 280.9±11.32ns -97.37%
Rgb family/xyz to linsrgb 7.5±0.23µs 7.5±0.29µs 0.00%
Rgb family/xyz to linsrgb - wide::f32x8 1244.3±66.42ns 1220.6±51.58ns -1.90%

@github-actions
Copy link

github-actions bot commented Apr 3, 2022

Benchmark for edf7b81

Click to view benchmark
Test Base PR %
Cie family/lab to lch 3.4±1.00µs 3.2±0.18µs -5.88%
Cie family/lab to xyz 783.5±57.30ns 813.5±92.45ns +3.83%
Cie family/lch to lab 2.3±0.16µs 2.3±0.45µs 0.00%
Cie family/linsrgb to xyz 3.7±0.42µs 3.6±0.14µs -2.70%
Cie family/linsrgb to xyz - wide::f32x8 648.6±75.56ns 629.0±25.49ns -3.02%
Cie family/xyz to lab 18.2±0.78µs 18.4±2.58µs +1.10%
Cie family/xyz to yxy 661.5±20.15ns 660.2±26.34ns -0.20%
Cie family/yxy to xyz 485.6±68.82ns 517.0±17.27ns +6.47%
Matrix functions/matrix_inverse 10.2±0.45ns 10.4±2.16ns +1.96%
Matrix functions/multiply_3x3 9.9±0.92ns 9.9±1.29ns 0.00%
Matrix functions/multiply_rgb_to_xyz 4.9±0.21ns 5.0±1.02ns +2.04%
Matrix functions/multiply_xyz 4.8±0.38ns 4.8±0.29ns 0.00%
Matrix functions/multiply_xyz_to_rgb 4.8±0.14ns 4.9±0.16ns +2.08%
Matrix functions/rgb_to_xyz_matrix 20.7±5.21ns 20.1±2.10ns -2.90%
Rgb family/hsl to hsv 633.8±64.94ns 649.5±29.68ns +2.48%
Rgb family/hsl to linear hsl 12.6±0.60µs 13.3±1.56µs +5.56%
Rgb family/hsl to rgb 2.3±0.05µs 2.2±0.15µs -4.35%
Rgb family/hsv to hsl 1507.0±196.30ns 1184.4±66.53ns -21.41%
Rgb family/hsv to hwb 249.1±64.81ns 225.3±13.87ns -9.55%
Rgb family/hsv to linear hsv 11.9±0.84µs 12.0±0.65µs +0.84%
Rgb family/hsv to rgb 2.3±0.23µs 2.2±0.28µs -4.35%
Rgb family/hwb to hsv 484.4±33.76ns 631.9±131.69ns +30.45%
Rgb family/hwb to linear hwb 12.4±0.87µs 13.3±2.74µs +7.26%
Rgb family/linear hsl to hsl 10.8±0.34µs 11.1±1.21µs +2.78%
Rgb family/linear hsv to hsv 10.3±0.48µs 10.7±0.57µs +3.88%
Rgb family/linear hwb to hwb 11.2±0.31µs 11.6±1.80µs +3.57%
Rgb family/linsrgb to rgb 6.1±0.77µs 6.0±0.40µs -1.64%
Rgb family/linsrgb to rgb - wide::f32x8 8.1±0.25µs 7.7±0.17µs -4.94%
Rgb family/linsrgb_f32 to rgb_u8 6.7±0.16µs 13.8±0.51µs +105.97%
Rgb family/rgb to hsl 887.6±14.01ns 883.3±24.67ns -0.48%
Rgb family/rgb to hsl - wide::f32x8 473.2±12.19ns 471.0±15.03ns -0.46%
Rgb family/rgb to hsv 689.5±71.74ns 661.0±18.05ns -4.13%
Rgb family/rgb to hsv - wide::f32x8 435.3±14.41ns 430.3±20.12ns -1.15%
Rgb family/rgb to linsrgb 8.5±0.29µs 8.7±0.35µs +2.35%
Rgb family/rgb to linsrgb - wide::f32x8 5.7±0.23µs 5.8±0.28µs +1.75%
Rgb family/rgb_u8 to linsrgb_f32 9.1±1.55µs 235.0±40.76ns -97.42%
Rgb family/xyz to linsrgb 6.1±0.24µs 6.4±0.24µs +4.92%
Rgb family/xyz to linsrgb - wide::f32x8 931.1±42.97ns 949.7±24.78ns +2.00%

@Ogeon
Copy link
Owner Author

Ogeon commented Apr 4, 2022

Some of those benchmark results don't make sense. I'll give them another spin and see if they are less noisy... But I may also reconsider the float -> byte conversion. The improvement wasn't so large anyway.

@github-actions
Copy link

github-actions bot commented Apr 4, 2022

Benchmark for edf7b81

Click to view benchmark
Test Base PR %
Cie family/lab to lch 3.6±0.16µs 3.6±0.11µs 0.00%
Cie family/lab to xyz 873.8±39.03ns 845.9±56.13ns -3.19%
Cie family/lch to lab 2.6±0.09µs 2.5±0.16µs -3.85%
Cie family/linsrgb to xyz 3.8±0.19µs 3.7±0.21µs -2.63%
Cie family/linsrgb to xyz - wide::f32x8 649.7±45.62ns 658.7±42.19ns +1.39%
Cie family/xyz to lab 20.8±0.70µs 20.8±1.13µs 0.00%
Cie family/xyz to yxy 723.1±37.36ns 741.1±41.59ns +2.49%
Cie family/yxy to xyz 494.0±31.44ns 542.2±31.81ns +9.76%
Matrix functions/matrix_inverse 11.0±0.94ns 10.9±0.74ns -0.91%
Matrix functions/multiply_3x3 10.6±0.45ns 10.9±0.61ns +2.83%
Matrix functions/multiply_rgb_to_xyz 5.6±0.16ns 5.2±0.37ns -7.14%
Matrix functions/multiply_xyz 5.4±0.32ns 5.1±0.29ns -5.56%
Matrix functions/multiply_xyz_to_rgb 5.3±0.23ns 5.1±0.35ns -3.77%
Matrix functions/rgb_to_xyz_matrix 22.4±0.83ns 22.2±1.23ns -0.89%
Rgb family/hsl to hsv 651.3±32.49ns 679.6±31.07ns +4.35%
Rgb family/hsl to linear hsl 13.3±0.88µs 15.0±1.01µs +12.78%
Rgb family/hsl to rgb 2.5±0.19µs 2.6±0.10µs +4.00%
Rgb family/hsv to hsl 1538.2±91.63ns 1334.7±46.58ns -13.23%
Rgb family/hsv to hwb 241.1±16.67ns 263.2±6.44ns +9.17%
Rgb family/hsv to linear hsv 12.7±0.91µs 13.3±0.97µs +4.72%
Rgb family/hsv to rgb 2.3±0.15µs 2.4±0.13µs +4.35%
Rgb family/hwb to hsv 546.4±20.81ns 708.5±33.67ns +29.67%
Rgb family/hwb to linear hwb 14.2±0.80µs 15.2±0.45µs +7.04%
Rgb family/linear hsl to hsl 11.5±0.82µs 11.3±0.70µs -1.74%
Rgb family/linear hsv to hsv 10.6±0.49µs 11.3±0.72µs +6.60%
Rgb family/linear hwb to hwb 11.4±0.55µs 12.3±0.70µs +7.89%
Rgb family/linsrgb to rgb 6.5±0.47µs 6.6±0.45µs +1.54%
Rgb family/linsrgb to rgb - wide::f32x8 8.2±0.43µs 8.7±0.48µs +6.10%
Rgb family/linsrgb_f32 to rgb_u8 6.8±0.30µs 15.3±0.95µs +125.00%
Rgb family/rgb to hsl 906.3±46.07ns 918.7±40.19ns +1.37%
Rgb family/rgb to hsl - wide::f32x8 509.8±22.71ns 537.2±22.46ns +5.37%
Rgb family/rgb to hsv 745.8±38.56ns 771.8±26.76ns +3.49%
Rgb family/rgb to hsv - wide::f32x8 466.5±27.46ns 483.8±33.65ns +3.71%
Rgb family/rgb to linsrgb 9.1±0.49µs 9.3±0.42µs +2.20%
Rgb family/rgb to linsrgb - wide::f32x8 6.1±0.41µs 6.7±0.17µs +9.84%
Rgb family/rgb_u8 to linsrgb_f32 9.9±0.59µs 254.8±16.92ns -97.43%
Rgb family/xyz to linsrgb 6.4±0.38µs 6.9±0.25µs +7.81%
Rgb family/xyz to linsrgb - wide::f32x8 969.8±58.69ns 979.2±53.08ns +0.97%

@Ogeon
Copy link
Owner Author

Ogeon commented Apr 4, 2022

It's interesting how it's consistently severely slower. I'll have to double check and see if I measured it correctly later.

@Ogeon Ogeon force-pushed the split_transfer_fn branch from bb7645d to 35af548 Compare April 9, 2022 13:06
@Ogeon
Copy link
Owner Author

Ogeon commented Apr 9, 2022

I had measured it in some weird way. 🤔 I have simply replaced my hack solution with fast-srgb8. It uses the same table as I had added for f32 and has a very fast algorithm for the reverse case.

@github-actions
Copy link

github-actions bot commented Apr 9, 2022

Benchmark for c2360e5

Click to view benchmark
Test Base PR %
Cie family/lab to lch 2.9±0.17µs 2.9±0.16µs 0.00%
Cie family/lab to xyz 749.9±44.64ns 714.7±18.16ns -4.69%
Cie family/lch to lab 2.1±0.12µs 2.2±0.11µs +4.76%
Cie family/linsrgb to xyz 3.3±0.19µs 3.4±0.17µs +3.03%
Cie family/linsrgb to xyz - wide::f32x8 598.4±38.40ns 595.3±27.13ns -0.52%
Cie family/xyz to lab 16.8±0.91µs 18.1±0.54µs +7.74%
Cie family/xyz to yxy 487.9±26.52ns 546.5±25.79ns +12.01%
Cie family/yxy to xyz 601.8±33.79ns 414.9±8.20ns -31.06%
Matrix functions/matrix_inverse 9.8±0.56ns 9.2±0.21ns -6.12%
Matrix functions/multiply_3x3 9.0±0.51ns 8.5±0.18ns -5.56%
Matrix functions/multiply_rgb_to_xyz 4.5±0.26ns 4.5±0.27ns 0.00%
Matrix functions/multiply_xyz 4.4±0.24ns 4.2±0.10ns -4.55%
Matrix functions/multiply_xyz_to_rgb 4.6±0.25ns 4.4±0.22ns -4.35%
Matrix functions/rgb_to_xyz_matrix 18.6±1.07ns 16.2±0.30ns -12.90%
Rgb family/hsl to hsv 543.2±35.76ns 639.1±28.46ns +17.65%
Rgb family/hsl to linear hsl 12.6±0.24µs 11.5±0.61µs -8.73%
Rgb family/hsl to rgb 2.2±0.13µs 2.1±0.12µs -4.55%
Rgb family/hsv to hsl 1110.5±60.01ns 1308.0±70.55ns +17.78%
Rgb family/hsv to hwb 214.8±10.95ns 224.1±11.99ns +4.33%
Rgb family/hsv to linear hsv 11.2±0.63µs 11.2±0.62µs 0.00%
Rgb family/hsv to rgb 2.0±0.11µs 2.1±0.11µs +5.00%
Rgb family/hwb to hsv 569.9±30.53ns 503.4±29.23ns -11.67%
Rgb family/hwb to linear hwb 12.5±0.19µs 11.7±0.71µs -6.40%
Rgb family/linear hsl to hsl 10.4±0.15µs 10.1±0.56µs -2.88%
Rgb family/linear hsv to hsv 9.5±0.12µs 9.9±0.67µs +4.21%
Rgb family/linear hwb to hwb 10.2±0.18µs 10.3±0.65µs +0.98%
Rgb family/linsrgb to rgb 6.0±0.13µs 5.4±0.25µs -10.00%
Rgb family/linsrgb to rgb - wide::f32x8 7.7±0.09µs 7.3±0.42µs -5.19%
Rgb family/linsrgb_f32 to rgb_u8 6.6±0.10µs 865.6±48.25ns -86.88%
Rgb family/linsrgb_f64 to rgb_u8 991.0±53.87ns N/A N/A
Rgb family/rgb to hsl 826.7±44.92ns 732.1±15.78ns -11.44%
Rgb family/rgb to hsl - wide::f32x8 445.2±25.39ns 418.9±9.61ns -5.91%
Rgb family/rgb to hsv 625.0±34.16ns 665.7±8.68ns +6.51%
Rgb family/rgb to hsv - wide::f32x8 400.7±23.54ns 429.2±7.34ns +7.11%
Rgb family/rgb to linsrgb 7.6±0.48µs 7.9±0.43µs +3.95%
Rgb family/rgb to linsrgb - wide::f32x8 5.4±0.32µs 5.2±0.10µs -3.70%
Rgb family/rgb_u8 to linsrgb_f32 8.9±0.22µs 225.2±11.45ns -97.47%
Rgb family/rgb_u8 to linsrgb_f64 293.6±16.22ns N/A N/A
Rgb family/xyz to linsrgb 6.2±0.34µs 6.3±0.34µs +1.61%
Rgb family/xyz to linsrgb - wide::f32x8 943.2±56.37ns 1102.4±57.09ns +16.88%

@github-actions
Copy link

github-actions bot commented Apr 9, 2022

Benchmark for ce26b32

Click to view benchmark
Test Base PR %
Cie family/lab to lch 3.1±0.04µs 3.2±0.05µs +3.23%
Cie family/lab to xyz 801.3±10.50ns 804.7±10.98ns +0.42%
Cie family/lch to lab 2.3±0.04µs 2.3±0.04µs 0.00%
Cie family/linsrgb to xyz 3.6±0.07µs 3.6±0.07µs 0.00%
Cie family/linsrgb to xyz - wide::f32x8 629.4±9.55ns 632.1±7.91ns +0.43%
Cie family/xyz to lab 18.0±0.32µs 18.1±0.43µs +0.56%
Cie family/xyz to yxy 515.3±6.96ns 619.6±86.45ns +20.24%
Cie family/yxy to xyz 651.6±6.97ns 469.2±9.21ns -27.99%
Matrix functions/matrix_inverse 10.3±0.12ns 10.3±0.09ns 0.00%
Matrix functions/multiply_3x3 9.6±0.12ns 9.8±0.40ns +2.08%
Matrix functions/multiply_rgb_to_xyz 4.8±0.11ns 4.9±0.25ns +2.08%
Matrix functions/multiply_xyz 4.8±0.07ns 4.8±0.13ns 0.00%
Matrix functions/multiply_xyz_to_rgb 4.8±0.06ns 4.9±0.17ns +2.08%
Matrix functions/rgb_to_xyz_matrix 20.1±0.27ns 18.3±0.24ns -8.96%
Rgb family/hsl to hsv 579.5±13.31ns 656.7±21.78ns +13.32%
Rgb family/hsl to linear hsl 12.6±0.21µs 12.1±0.21µs -3.97%
Rgb family/hsl to rgb 2.3±0.05µs 2.3±0.04µs 0.00%
Rgb family/hsv to hsl 1173.0±34.58ns 1380.0±26.61ns +17.65%
Rgb family/hsv to hwb 228.0±4.73ns 228.9±2.67ns +0.39%
Rgb family/hsv to linear hsv 11.9±0.28µs 11.8±0.14µs -0.84%
Rgb family/hsv to rgb 2.2±0.09µs 2.2±0.03µs 0.00%
Rgb family/hwb to hsv 610.8±18.18ns 531.0±10.86ns -13.06%
Rgb family/hwb to linear hwb 12.4±0.28µs 12.5±0.31µs +0.81%
Rgb family/linear hsl to hsl 10.6±0.59µs 10.8±0.15µs +1.89%
Rgb family/linear hsv to hsv 9.6±0.43µs 10.6±0.26µs +10.42%
Rgb family/linear hwb to hwb 10.2±1.17µs 11.0±0.19µs +7.84%
Rgb family/linsrgb to rgb 6.0±0.08µs 5.9±0.12µs -1.67%
Rgb family/linsrgb to rgb - wide::f32x8 7.8±0.25µs 7.7±0.14µs -1.28%
Rgb family/linsrgb_f32 to rgb_u8 6.7±0.14µs 941.0±14.63ns -85.96%
Rgb family/linsrgb_f64 to rgb_u8 1063.6±15.91ns N/A N/A
Rgb family/rgb to hsl 877.9±16.66ns 828.6±19.50ns -5.62%
Rgb family/rgb to hsl - wide::f32x8 473.9±12.46ns 470.0±6.22ns -0.82%
Rgb family/rgb to hsv 669.4±28.43ns 665.5±11.35ns -0.58%
Rgb family/rgb to hsv - wide::f32x8 433.6±13.39ns 427.7±5.79ns -1.36%
Rgb family/rgb to linsrgb 8.3±0.12µs 8.4±0.20µs +1.20%
Rgb family/rgb to linsrgb - wide::f32x8 5.8±0.42µs 5.7±0.07µs -1.72%
Rgb family/rgb_u8 to linsrgb_f32 8.9±0.17µs 231.7±3.65ns -97.40%
Rgb family/rgb_u8 to linsrgb_f64 317.9±6.04ns N/A N/A
Rgb family/xyz to linsrgb 6.6±0.18µs 6.6±0.10µs 0.00%
Rgb family/xyz to linsrgb - wide::f32x8 1005.5±41.76ns 1010.5±43.76ns +0.50%

@Ogeon
Copy link
Owner Author

Ogeon commented Apr 9, 2022

bors r+

@bors
Copy link
Contributor

bors bot commented Apr 9, 2022

Build succeeded:

@bors bors bot merged commit 03a31f1 into master Apr 9, 2022
@bors bors bot deleted the split_transfer_fn branch April 9, 2022 16:40
@Ogeon Ogeon changed the title Split the TransferFn trait and add lookup tables for sRGB Split the TransferFn trait and add lookup tables for sRGB Mar 19, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Improve the (non-)linear transfer function trait sRGB conversion lookup tables
1 participant