diff --git a/doc/snippets/DebugTools-gl.cpp b/doc/snippets/DebugTools-gl.cpp index 25a555742..28349e596 100644 --- a/doc/snippets/DebugTools-gl.cpp +++ b/doc/snippets/DebugTools-gl.cpp @@ -216,7 +216,7 @@ ImageView2D expected{PixelFormat::RGB8Unorm, {}}; /* [CompareImage-pixels-rgb] */ Image2D image = fb.read(fb.viewport(), {PixelFormat::RGBA8Unorm}); -CORRADE_COMPARE_AS(Containers::arrayCast(image.pixels()), +CORRADE_COMPARE_AS(image.pixels().slice(&Color4ub::rgb), "expected.png", DebugTools::CompareImageToFile); /* [CompareImage-pixels-rgb] */ } diff --git a/src/Magnum/DebugTools/CompareImage.h b/src/Magnum/DebugTools/CompareImage.h index 9d5ba6081..4183a15b3 100644 --- a/src/Magnum/DebugTools/CompareImage.h +++ b/src/Magnum/DebugTools/CompareImage.h @@ -322,8 +322,8 @@ data flipped upside down: For a different scenario, imagine you're comparing data read from a framebuffer to a ground truth image. On many systems, internal framebuffer storage has to -be four-component; however your if your ground truth image is just -three-component you can cast the pixel data to just a three-component type: +be four-component; however your if your ground truth image is three-component +you can slice the pixel data to just the RGB channels: @snippet DebugTools-gl.cpp CompareImage-pixels-rgb