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:
@@ -57,12 +57,12 @@ mod codec_utils {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
struct Decoder<I: Iterator<Item = u8>> {
|
pub struct Decoder<I: Iterator<Item = u8>> {
|
||||||
// Image metadata
|
// Image metadata
|
||||||
width: u32,
|
pub width: u32,
|
||||||
height: u32,
|
pub height: u32,
|
||||||
channels: u8,
|
pub channels: u8,
|
||||||
colorspace: u8,
|
pub colorspace: u8,
|
||||||
|
|
||||||
// QOI codec state information
|
// QOI codec state information
|
||||||
back_buffer: [PixelRGBA; 64],
|
back_buffer: [PixelRGBA; 64],
|
||||||
@@ -76,7 +76,7 @@ impl<I> Decoder<I>
|
|||||||
where
|
where
|
||||||
I: Iterator<Item = u8>,
|
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)?;
|
let _ = try_read_magic(&mut bytes)?;
|
||||||
Ok(Self {
|
Ok(Self {
|
||||||
width: try_read_u32(&mut bytes)?,
|
width: try_read_u32(&mut bytes)?,
|
||||||
|
|||||||
Reference in New Issue
Block a user