Adapt the cutover to the reviewed core-types API

This commit is contained in:
Dennis Kobert
2026-07-31 23:39:39 +02:00
parent 81a319430b
commit c30054579f
24 changed files with 170 additions and 145 deletions

View File

@@ -201,8 +201,8 @@ mod test {
use raster_types::Image;
use raster_types::Raster;
#[tokio::test]
async fn color_overlay_multiply() {
#[test]
fn color_overlay_multiply() {
let image_color = Color::from_rgbaf32_unchecked(0.7, 0.6, 0.5, 0.4);
let image = Image::new(1, 1, image_color);
@@ -212,7 +212,7 @@ mod test {
// 100% of the output should come from the multiplied value
let opacity = 100.;
let result = super::color_overlay((), List::new_from_element(Raster::new_cpu(image.clone())), overlay_color, BlendMode::Multiply, opacity);
let result = super::color_overlay(&(), List::new_from_element(Raster::new_cpu(image.clone())), overlay_color, BlendMode::Multiply, opacity);
let result = result.element(0).unwrap().clone();
// The output should just be the original green and alpha channels (as we multiply them by 1 and other channels by 0)

View File

@@ -68,7 +68,7 @@ mod test {
#[test]
fn test_image_color_palette() {
let result = image_color_palette(
(),
&(),
List::new_from_element(Raster::new_cpu(Image {
width: 100,
height: 100,
@@ -77,6 +77,6 @@ mod test {
})),
1,
);
assert_eq!(futures::executor::block_on(result), List::new_from_element(Color::from_rgbaf32(0., 0., 0., 1.).unwrap()));
assert_eq!(result, List::new_from_element(Color::from_rgbaf32(0., 0., 0., 1.).unwrap()));
}
}