pub struct Image { /* private fields */ }Expand description
The main image type that provides sharpening operations.
This struct uses copy-on-write semantics internally to minimize memory allocations when cloning images.
§Examples
use sharpy::Image;
// Load from file
let image = Image::load("photo.jpg")?;
// Create from existing image data
use image::RgbImage;
let rgb_image = RgbImage::new(800, 600);
let image = Image::from_rgb(rgb_image)?;Implementations§
Source§impl Image
impl Image
pub fn from_dynamic(img: DynamicImage) -> Result<Self>
pub fn from_rgb(img: RgbImage) -> Result<Self>
pub fn load<P: AsRef<Path>>(path: P) -> Result<Self>
pub fn from_arc_dynamic(arc_img: Arc<DynamicImage>) -> Result<Self>
pub fn from_arc_rgb(arc_img: Arc<RgbImage>) -> Result<Self>
pub fn from_dynamic_ref(img: &DynamicImage) -> Result<Self>
pub fn into_arc_dynamic(self) -> Arc<DynamicImage>
pub fn into_dynamic(self) -> DynamicImage
pub fn into_rgb(self) -> RgbImage
pub fn save<P: AsRef<Path>>(self, path: P) -> Result<()>
pub fn dimensions(&self) -> (u32, u32)
pub fn histogram(&self) -> [u32; 256]
pub fn unsharp_mask( self, radius: f32, amount: f32, threshold: u8, ) -> Result<Self>
pub fn high_pass_sharpen(self, strength: f32) -> Result<Self>
pub fn enhance_edges(self, strength: f32, method: EdgeMethod) -> Result<Self>
pub fn clarity(self, strength: f32, radius: f32) -> Result<Self>
Sourcepub fn sharpen(self) -> SharpeningBuilder
pub fn sharpen(self) -> SharpeningBuilder
Creates a sharpening builder for fluent configuration.
§Example
let sharpened = image.sharpen()
.unsharp_mask(1.0, 1.0, 0)
.clarity(0.5, 2.0)
.apply()
.unwrap();Trait Implementations§
Auto Trait Implementations§
impl Freeze for Image
impl RefUnwindSafe for Image
impl Send for Image
impl Sync for Image
impl Unpin for Image
impl UnwindSafe for Image
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more