mirror of
https://github.com/GraphiteEditor/Graphite.git
synced 2026-09-19 02:48:12 +08:00
Implement dynamic table attributes to generalize the graphic-specific Table type (#4050)
* Feature-gate serde derives behind cfg_attr in all runtime node graph type crates * Refactor Table to move its hard-coded fields into an attributes field * Encapsulate TableRow/TableRowRef/TableRowMut attribute fields behind accessor methods * Remove TaggedValue::GraphicUnused * Refactor Table<T> to use dynamic attributes instead fixed names * Fix code review soundness concerns * Add todo work * Replace row-oriented Table<T> API with column-oriented access * Fix attribute propagation bugs ---------
This commit is contained in:
@@ -12,7 +12,7 @@ async fn dehaze(_: impl Ctx, image_frame: Table<Raster<CPU>>, strength: Percenta
|
||||
image_frame
|
||||
.into_iter()
|
||||
.map(|mut row| {
|
||||
let image = row.element;
|
||||
let image = std::mem::replace(row.element_mut(), Raster::new_cpu(Image::default()));
|
||||
// Prepare the image data for processing
|
||||
let image_data = bytemuck::cast_vec(image.data.clone());
|
||||
let image_buffer = image::Rgba32FImage::from_raw(image.width, image.height, image_data).expect("Failed to convert internal image format into image-rs data type.");
|
||||
@@ -31,7 +31,7 @@ async fn dehaze(_: impl Ctx, image_frame: Table<Raster<CPU>>, strength: Percenta
|
||||
base64_string: None,
|
||||
};
|
||||
|
||||
row.element = Raster::new_cpu(dehazed_image);
|
||||
*row.element_mut() = Raster::new_cpu(dehazed_image);
|
||||
row
|
||||
})
|
||||
.collect()
|
||||
|
||||
Reference in New Issue
Block a user