Skip to content

Commit

Permalink
image/image: Make set_dimensions crate only.
Browse files Browse the repository at this point in the history
It's a dangerous function and should not be exposed anyhowly

Signed-off-by: caleb <[email protected]>
  • Loading branch information
etemesi254 committed Oct 14, 2023
1 parent 34bb304 commit 89572ae
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion zune-image/src/image.rs
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,7 @@ impl Image {
frame.write_rgba(colorspace, out).unwrap();
}
}
pub fn set_dimensions(&mut self, width: usize, height: usize) {
pub(crate) fn set_dimensions(&mut self, width: usize, height: usize) {
self.metadata.set_dimensions(width, height);
}

Expand Down Expand Up @@ -506,10 +506,16 @@ impl Image {
impl Image {
/// Convert an image from one colorspace to another
///
/// # Arguments
/// - to: The colorspace to convert image into
///
pub fn convert_color(&mut self, to: ColorSpace) -> Result<(), ImageErrors> {
ColorspaceConv::new(to).execute(self)
}
/// Convert an image from one depth to another
///
/// # Arguments
/// - to: The bit-depth to convert the image into
pub fn convert_depth(&mut self, to: BitDepth) -> Result<(), ImageErrors> {
Depth::new(to).execute(self)
}
Expand Down

0 comments on commit 89572ae

Please sign in to comment.