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.
This commit is contained in:
2024-10-14 20:20:40 -05:00
parent 431c808b72
commit 9cffd665ca

View File

@@ -57,12 +57,12 @@ mod codec_utils {
}
struct Decoder<I: Iterator<Item = u8>> {
pub struct Decoder<I: Iterator<Item = u8>> {
// 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<I> Decoder<I>
where
I: Iterator<Item = u8>,
{
fn try_new(mut bytes: I) -> Result<Self, DecodeError> {
pub fn try_new(mut bytes: I) -> Result<Self, DecodeError> {
let _ = try_read_magic(&mut bytes)?;
Ok(Self {
width: try_read_u32(&mut bytes)?,