From 9cffd665ca73694b13115b7a9ab77e8c6a70af4a Mon Sep 17 00:00:00 2001 From: Robert Garrett Date: Mon, 14 Oct 2024 20:20:40 -0500 Subject: [PATCH] Make Decoder parts public so they can be used I should maybe set the properties to be private and accessible strictly through accessor methods. That way nobody can accidentally write into the values. Oh well, that's a thing for later. --- src/decoder.rs | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/decoder.rs b/src/decoder.rs index a5d03db..292769d 100644 --- a/src/decoder.rs +++ b/src/decoder.rs @@ -57,12 +57,12 @@ mod codec_utils { } -struct Decoder> { +pub struct Decoder> { // Image metadata - width: u32, - height: u32, - channels: u8, - colorspace: u8, + pub width: u32, + pub height: u32, + pub channels: u8, + pub colorspace: u8, // QOI codec state information back_buffer: [PixelRGBA; 64], @@ -76,7 +76,7 @@ impl Decoder where I: Iterator, { - fn try_new(mut bytes: I) -> Result { + pub fn try_new(mut bytes: I) -> Result { let _ = try_read_magic(&mut bytes)?; Ok(Self { width: try_read_u32(&mut bytes)?,