mirror of
https://github.com/GraphiteEditor/Graphite.git
synced 2026-09-16 23:08:05 +08:00
Switch the Color struct back to storing unassociated alpha (#4518)
* Switch Color struct back to storing unassociated alpha * Address review feedback * Update the Invert node and legacy image migration for straight alpha and add round-trip tests --------- Co-authored-by: Keavon Chambers <keavon@keavon.com>
This commit is contained in:
@@ -115,9 +115,7 @@ impl RasterGpuToRasterCpuConverter {
|
||||
let start = row * row_stride;
|
||||
let row_slice = &view[start..start + row_bytes];
|
||||
for px in row_slice.chunks_exact(4) {
|
||||
// `Image<Color>` pixels are stored linear-light with associated (premultiplied) alpha
|
||||
let srgba = SRGBA8::new(px[0], px[1], px[2], px[3]);
|
||||
cpu_data.push(Color::from(srgba).apply_opacity(px[3] as f32 / 255.));
|
||||
cpu_data.push(SRGBA8::new(px[0], px[1], px[2], px[3]).into());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user