Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions pixel_bridge/rust/image.rs
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,7 @@ pub enum PixelType {
F32,
}

#[doc(hidden)]
impl From<RustColorType> for PixelType {
fn from(value: RustColorType) -> Self {
match value {
Expand Down Expand Up @@ -204,6 +205,7 @@ pub struct Strides {
pub channels: usize,
}

#[doc(hidden)]
impl From<RustColorType> for ColorType {
fn from(value: RustColorType) -> Self {
match value {
Expand Down
8 changes: 4 additions & 4 deletions pixel_bridge/rust/reader.rs
Original file line number Diff line number Diff line change
Expand Up @@ -48,9 +48,9 @@ pub enum Format {
Ico,
}

impl From<Format> for ImageFormat {
fn from(value: Format) -> ImageFormat {
match value {
impl Format {
fn to_image_format(self) -> ImageFormat {
match self {
Format::Png => ImageFormat::Png,
Format::Jpeg => ImageFormat::Jpeg,
Format::Gif => ImageFormat::Gif,
Expand Down Expand Up @@ -96,7 +96,7 @@ impl ImageReader {
let Some(ref mut inner) = self.inner else {
return;
};
inner.set_format(format.into())
inner.set_format(format.to_image_format())
}

/// Read the image.
Expand Down
Loading