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

Fix NaN values from Okhsv when saturation is > 0 and value == 0 #332

Merged
merged 1 commit into from
May 21, 2023

Conversation

Ogeon
Copy link
Owner

@Ogeon Ogeon commented May 20, 2023

Changes the check so it looks for value == 0, regardless of saturation.

Closed Issues

@github-actions
Copy link

Benchmark for 18d47eb

Click to view benchmark
Test Base PR %
Cie family/lab to lch 3.2±0.05µs 3.2±0.09µs 0.00%
Cie family/lab to xyz 761.8±8.16ns 761.3±7.85ns -0.07%
Cie family/lch to lab 2.4±0.04µs 2.4±0.05µs 0.00%
Cie family/linsrgb to xyz 308.1±5.54ns 307.3±3.56ns -0.26%
Cie family/linsrgb to xyz - wide::f32x8 99.9±1.66ns 100.0±1.61ns +0.10%
Cie family/xyz to lab 17.9±0.25µs 17.9±0.27µs 0.00%
Cie family/xyz to yxy 623.3±7.50ns 627.4±15.06ns +0.66%
Cie family/yxy to xyz 546.7±6.60ns 548.9±9.52ns +0.40%
Matrix functions/matrix_inverse 10.7±0.15ns 11.1±0.15ns +3.74%
Matrix functions/multiply_3x3 9.7±0.16ns 9.7±0.24ns 0.00%
Matrix functions/multiply_rgb_to_xyz 6.0±0.13ns 6.0±0.08ns 0.00%
Matrix functions/multiply_xyz 6.0±0.10ns 6.0±0.12ns 0.00%
Matrix functions/multiply_xyz_to_rgb 6.0±0.11ns 6.0±0.08ns 0.00%
Matrix functions/rgb_to_xyz_matrix 24.9±0.32ns 24.9±0.41ns 0.00%
Rgb family/hsl to hsv 650.1±6.85ns 649.4±18.05ns -0.11%
Rgb family/hsl to linear hsl 13.0±0.17µs 12.9±0.16µs -0.77%
Rgb family/hsl to rgb 2.1±0.05µs 2.1±0.04µs 0.00%
Rgb family/hsv to hsl 821.8±9.91ns 822.4±11.80ns +0.07%
Rgb family/hsv to hwb 235.6±4.87ns 233.8±2.82ns -0.76%
Rgb family/hsv to linear hsv 11.7±0.16µs 11.7±0.17µs 0.00%
Rgb family/hsv to rgb 1905.9±24.54ns 1921.3±26.12ns +0.81%
Rgb family/hwb to hsv 482.6±6.33ns 480.0±6.37ns -0.54%
Rgb family/hwb to linear hwb 12.5±0.25µs 12.4±0.24µs -0.80%
Rgb family/linear hsl to hsl 11.1±0.14µs 11.2±0.46µs +0.90%
Rgb family/linear hsv to hsv 10.4±0.13µs 10.2±0.21µs -1.92%
Rgb family/linear hwb to hwb 11.2±0.15µs 11.2±0.17µs 0.00%
Rgb family/linsrgb to rgb 6.2±0.09µs 5.9±0.08µs -4.84%
Rgb family/linsrgb to rgb - wide::f32x8 5.2±0.16µs 5.1±0.08µs -1.92%
Rgb family/linsrgb_f32 to rgb_u8 961.8±20.11ns 955.3±18.92ns -0.68%
Rgb family/linsrgb_f64 to rgb_u8 1222.0±30.72ns 1224.7±32.86ns +0.22%
Rgb family/rgb to hsl 851.1±8.15ns 851.7±12.26ns +0.07%
Rgb family/rgb to hsl - wide::f32x8 469.7±8.71ns 469.9±6.46ns +0.04%
Rgb family/rgb to hsv 527.3±10.29ns 510.6±6.04ns -3.17%
Rgb family/rgb to hsv - wide::f32x8 427.2±5.75ns 428.1±5.85ns +0.21%
Rgb family/rgb to linsrgb 8.8±0.21µs 8.3±0.10µs -5.68%
Rgb family/rgb to linsrgb - wide::f32x8 3.3±0.04µs 3.3±0.05µs 0.00%
Rgb family/rgb_u8 to linsrgb_f32 307.0±4.67ns 309.2±6.83ns +0.72%
Rgb family/rgb_u8 to linsrgb_f64 311.2±4.13ns 311.7±4.25ns +0.16%
Rgb family/xyz to linsrgb 354.6±3.88ns 357.4±5.31ns +0.79%
Rgb family/xyz to linsrgb - wide::f32x8 106.5±2.44ns 105.8±1.91ns -0.66%

@Ogeon Ogeon changed the title Fix NaN values from Okhsv when saturation is > 0 and value == 0 Fix NaN values from Okhsv when saturation is > 0 and value == 0 May 21, 2023
@Ogeon
Copy link
Owner Author

Ogeon commented May 21, 2023

bors r+

@bors
Copy link
Contributor

bors bot commented May 21, 2023

Build succeeded!

The publicly hosted instance of bors-ng is deprecated and will go away soon.

If you want to self-host your own instance, instructions are here.
For more help, visit the forum.

If you want to switch to GitHub's built-in merge queue, visit their help page.

@bors bors bot merged commit 7e0a009 into master May 21, 2023
@bors bors bot deleted the fix_saturated_black_okhsv branch May 21, 2023 12:25
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.

Converting Okhsva color where the value is 0.0 to Srgba results in all components being NaN.
1 participant