mirror of
https://github.com/GraphiteEditor/Graphite.git
synced 2026-09-19 19:08:05 +08:00
Instance tables refactor part 7: Remove RasterDataType and add Raster<CPU>/Raster<GPU>
This commit is contained in:
@@ -1,12 +1,13 @@
|
||||
use graph_craft::proto::types::Percentage;
|
||||
use graphene_core::raster::image::{Image, RasterDataTable};
|
||||
use graphene_core::{Color, Ctx};
|
||||
use graphene_core::Ctx;
|
||||
use graphene_core::raster::image::Image;
|
||||
use graphene_core::raster_types::{CPU, Raster, RasterDataTable};
|
||||
use image::{DynamicImage, GenericImage, GenericImageView, GrayImage, ImageBuffer, Luma, Rgba, RgbaImage};
|
||||
use ndarray::{Array2, ArrayBase, Dim, OwnedRepr};
|
||||
use std::cmp::{max, min};
|
||||
|
||||
#[node_macro::node(category("Raster"))]
|
||||
async fn dehaze(_: impl Ctx, image_frame: RasterDataTable<Color>, strength: Percentage) -> RasterDataTable<Color> {
|
||||
async fn dehaze(_: impl Ctx, image_frame: RasterDataTable<CPU>, strength: Percentage) -> RasterDataTable<CPU> {
|
||||
let mut result_table = RasterDataTable::default();
|
||||
|
||||
for mut image_frame_instance in image_frame.instance_iter() {
|
||||
@@ -29,7 +30,7 @@ async fn dehaze(_: impl Ctx, image_frame: RasterDataTable<Color>, strength: Perc
|
||||
base64_string: None,
|
||||
};
|
||||
|
||||
image_frame_instance.instance = dehazed_image;
|
||||
image_frame_instance.instance = Raster::new_cpu(dehazed_image);
|
||||
image_frame_instance.source_node_id = None;
|
||||
result_table.push(image_frame_instance);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user