Ogeon / palette

A Rust library for linear color calculations and conversion
Apache License 2.0
748 stars 60 forks source link

Remove `impl<C> $op_trait<PreAlpha<C>> for {f32,f64}` `impl`s to work around issue #283 #312

Closed Ogeon closed 1 year ago

Ogeon commented 1 year ago

The compiler seem to sometimes get stuck in a loop when these operator implementations are involved. This removes them for now, until the issue is fixed.

Closed Issues

Breaking Change

Removes the possibility to write 1.0 * my_pre_alpha_value.

github-actions[bot] commented 1 year ago

Benchmark for 727577b

Click to view benchmark | Test | Base | PR | % | |------|--------------|------------------|---| | Cie family/lab to lch | 3.2±0.10µs | 3.2±0.06µs | 0.00% | | Cie family/lab to xyz | 762.0±11.59ns | 755.5±9.13ns | -0.85% | | Cie family/lch to lab | **2.4±0.05µs** | 2.5±0.07µs | **+4.17%** | | Cie family/linsrgb to xyz | 307.9±4.28ns | 307.5±4.59ns | -0.13% | | Cie family/linsrgb to xyz - wide::f32x8 | 100.5±3.33ns | 101.0±3.29ns | +0.50% | | Cie family/xyz to lab | 18.0±0.37µs | 18.0±0.38µs | 0.00% | | Cie family/xyz to yxy | 632.6±13.42ns | 631.3±7.02ns | -0.21% | | Cie family/yxy to xyz | 549.3±9.40ns | 547.0±8.22ns | -0.42% | | Matrix functions/matrix_inverse | 10.7±0.16ns | 10.7±0.16ns | 0.00% | | Matrix functions/multiply_3x3 | 9.7±0.15ns | 9.7±0.14ns | 0.00% | | Matrix functions/multiply_rgb_to_xyz | 6.0±0.13ns | 6.0±0.10ns | 0.00% | | Matrix functions/multiply_xyz | 6.0±0.12ns | 6.0±0.08ns | 0.00% | | Matrix functions/multiply_xyz_to_rgb | 6.0±0.13ns | 6.0±0.18ns | 0.00% | | Matrix functions/rgb_to_xyz_matrix | 25.1±0.79ns | 24.9±0.47ns | -0.80% | | Rgb family/hsl to hsv | 651.6±13.71ns | 650.2±8.06ns | -0.21% | | Rgb family/hsl to linear hsl | 13.2±0.43µs | **13.0±0.14µs** | **-1.52%** | | Rgb family/hsl to rgb | 2.1±0.03µs | 2.1±0.03µs | 0.00% | | Rgb family/hsv to hsl | 836.8±33.36ns | 825.6±26.96ns | -1.34% | | Rgb family/hsv to hwb | 235.7±6.70ns | **232.6±2.98ns** | **-1.32%** | | Rgb family/hsv to linear hsv | 11.7±0.17µs | 11.7±0.33µs | 0.00% | | Rgb family/hsv to rgb | 1956.4±41.86ns | **1887.7±21.16ns** | **-3.51%** | | Rgb family/hwb to hsv | 493.1±20.15ns | 488.2±20.39ns | -0.99% | | Rgb family/hwb to linear hwb | 12.4±0.25µs | **12.2±0.17µs** | **-1.61%** | | Rgb family/linear hsl to hsl | 11.2±0.17µs | 11.1±0.18µs | -0.89% | | Rgb family/linear hsv to hsv | 10.4±0.40µs | 10.3±0.15µs | -0.96% | | Rgb family/linear hwb to hwb | 11.2±0.14µs | 11.2±0.21µs | 0.00% | | Rgb family/linsrgb to rgb | **5.9±0.09µs** | 6.0±0.09µs | **+1.69%** | | Rgb family/linsrgb to rgb - wide::f32x8 | 5.1±0.08µs | 5.1±0.08µs | 0.00% | | Rgb family/linsrgb_f32 to rgb_u8 | 955.8±18.12ns | 961.1±28.81ns | +0.55% | | Rgb family/linsrgb_f64 to rgb_u8 | 1214.6±17.47ns | 1218.3±26.31ns | +0.30% | | Rgb family/rgb to hsl | 871.2±37.94ns | **846.1±8.45ns** | **-2.88%** | | Rgb family/rgb to hsl - wide::f32x8 | 488.7±31.85ns | **469.2±4.93ns** | **-3.99%** | | Rgb family/rgb to hsv | 519.7±18.11ns | 512.9±10.56ns | -1.31% | | Rgb family/rgb to hsv - wide::f32x8 | 429.0±9.62ns | 434.0±32.69ns | +1.17% | | Rgb family/rgb to linsrgb | 8.3±0.20µs | 8.3±0.17µs | 0.00% | | Rgb family/rgb to linsrgb - wide::f32x8 | 3.4±0.22µs | **3.3±0.04µs** | **-2.94%** | | Rgb family/rgb_u8 to linsrgb_f32 | **306.2±3.22ns** | 309.8±10.99ns | **+1.18%** | | Rgb family/rgb_u8 to linsrgb_f64 | **311.8±4.47ns** | 317.3±13.61ns | **+1.76%** | | Rgb family/xyz to linsrgb | 359.6±12.31ns | 354.7±6.25ns | -1.36% | | Rgb family/xyz to linsrgb - wide::f32x8 | 106.0±2.29ns | 106.9±1.72ns | +0.85% |
Ogeon commented 1 year ago

bors r+

bors[bot] commented 1 year ago

Build succeeded: