Return buffer layout as a struct

Prepares extensibility for the eventual case of supporting multi-planar
image layouts that are to be written into a multi-planar buffer as
indicated by the caller in some way (possibly not via read_*_bytes but a
method taking a wrapper around the output buffer instead). Through the
struct we can later add an indicator that can be used by the caller to
decide between methods of fetching the pixel data as appropriate.
This commit is contained in:
A. Molzer committed 2025-07-19 17:46:37 +02:00
1 parent c370ac4b92
commit 48d52bed9b
3 files changed
+73 -18

No files matched your search

+1 -1
View File
@@ -541,7 +541,7 @@ fn test_image_bytes(file: &str, expected: &[(ColorType, u32)]) {
.image_buffer_layout()
.expect("Cannot describe buffer layout");
buffer.resize(layout.size(), 0u8);
buffer.resize(layout.len, 0u8);
decoder.read_image_bytes(&mut buffer).unwrap();
// Well almost a crc..