mirror of
https://github.com/GraphiteEditor/Graphite.git
synced 2026-09-17 23:38:06 +08:00
Update graphene-cli and fix no-std compilation for graphene-core (#1428)
* Initialize wgpu executor from graphene cli * Make `graphene-core` `no-std` complient again * Implemnt image similarity calculation * Add nan checks * Make image comparison optional * Feature gate quantization to reduce the number of warnings
This commit is contained in:
@@ -150,13 +150,27 @@ fn dequantize_fn<'a>(color: PackedPixel, quantization: [Quantization; 4]) -> Col
|
||||
|
||||
pub fn dequantize_color(color: PackedPixel, quant: [Quantization; 4]) -> Color {
|
||||
let mut offset = 0;
|
||||
let r = decode(color.0, offset, quant[0]);
|
||||
let mut r = decode(color.0, offset, quant[0]);
|
||||
offset += quant[0].bits();
|
||||
let g = decode(color.0, offset, quant[1]);
|
||||
let mut g = decode(color.0, offset, quant[1]);
|
||||
offset += quant[1].bits();
|
||||
let b = decode(color.0, offset, quant[2]);
|
||||
let mut b = decode(color.0, offset, quant[2]);
|
||||
offset += quant[2].bits();
|
||||
let a = decode(color.0, offset, quant[3]);
|
||||
let mut a = decode(color.0, offset, quant[3]);
|
||||
if a.is_nan() {
|
||||
a = 0.;
|
||||
}
|
||||
|
||||
if r.is_nan() {
|
||||
r = 0.;
|
||||
}
|
||||
|
||||
if g.is_nan() {
|
||||
g = 0.;
|
||||
}
|
||||
if b.is_nan() {
|
||||
b = 0.;
|
||||
}
|
||||
|
||||
Color::from_rgbaf32_unchecked(r, g, b, a)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user