From 89572aef0afe6bbc69042136f6b3b0c3c0e6b9e2 Mon Sep 17 00:00:00 2001 From: caleb Date: Sun, 15 Oct 2023 01:15:09 +0300 Subject: [PATCH] image/image: Make set_dimensions crate only. It's a dangerous function and should not be exposed anyhowly Signed-off-by: caleb --- zune-image/src/image.rs | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/zune-image/src/image.rs b/zune-image/src/image.rs index 7e092e16..1ac9c27b 100644 --- a/zune-image/src/image.rs +++ b/zune-image/src/image.rs @@ -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); } @@ -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) }