pub struct PixelWand { /* private fields */ }Expand description
A safe wrapper around an ImageMagick PixelWand.
The wand owns the underlying ImageMagick handle and destroys it when dropped.
Implementations§
Source§impl PixelWand
impl PixelWand
Sourcepub fn clear_exception(&mut self) -> Result<(), MagickError>
pub fn clear_exception(&mut self) -> Result<(), MagickError>
Clears any exception currently recorded on the wand.
Sourcepub fn get_exception_type(&self) -> ExceptionType
pub fn get_exception_type(&self) -> ExceptionType
Returns the severity of the most recent exception on the wand.
Sourcepub fn get_exception(&self) -> Result<(String, ExceptionType), MagickError>
pub fn get_exception(&self) -> Result<(String, ExceptionType), MagickError>
Returns the most recent exception on the wand as a (message, severity) pair, or an error if no exception message is available.
Sourcepub fn is_wand(&self) -> Result<(), MagickError>
pub fn is_wand(&self) -> Result<(), MagickError>
Returns Ok(()) if this is a valid wand of the expected type.
Source§impl PixelWand
impl PixelWand
Sourcepub fn is_similar(&self, other: &PixelWand, fuzz: f64) -> bool
pub fn is_similar(&self, other: &PixelWand, fuzz: f64) -> bool
Return true if the distance between this pixel’s color and the other’s is
within the given fuzz factor.
Sourcepub fn get_hsl(&self) -> HSL
pub fn get_hsl(&self) -> HSL
Return the pixel’s color as hue, saturation, and lightness values.
Sourcepub fn set_hsl(&self, hsl: &HSL)
pub fn set_hsl(&self, hsl: &HSL)
Set the pixel’s color from hue, saturation, and lightness values.
Sourcepub fn fmt_w_prefix(&self, f: &mut Formatter<'_>, prefix: &str) -> Result
pub fn fmt_w_prefix(&self, f: &mut Formatter<'_>, prefix: &str) -> Result
Format the wand’s settings for debugging, indenting each line with the
given prefix.
Sourcepub fn set_color(&mut self, s: &str) -> Result<(), MagickError>
pub fn set_color(&mut self, s: &str) -> Result<(), MagickError>
Set the pixel’s color from a color string such as "#ff0000" or "red".
Sourcepub fn get_color_as_string(&self) -> Result<String, MagickError>
pub fn get_color_as_string(&self) -> Result<String, MagickError>
Wraps ImageMagick’s PixelGetColorAsString function.
Sourcepub fn get_color_as_normalized_string(&self) -> Result<String, MagickError>
pub fn get_color_as_normalized_string(&self) -> Result<String, MagickError>
Wraps ImageMagick’s PixelGetColorAsNormalizedString function.
Sourcepub fn get_color_count(&self) -> usize
pub fn get_color_count(&self) -> usize
Wraps ImageMagick’s PixelGetColorCount function.
Sourcepub fn set_color_count(&mut self, v: usize)
pub fn set_color_count(&mut self, v: usize)
Wraps ImageMagick’s PixelSetColorCount function.
pub fn fmt_unchecked_settings( &self, f: &mut Formatter<'_>, prefix: &str, ) -> Result
Sourcepub fn get_alpha_quantum(&self) -> Quantum
pub fn get_alpha_quantum(&self) -> Quantum
Wraps ImageMagick’s PixelGetAlphaQuantum function.
Sourcepub fn set_alpha_quantum(&mut self, v: Quantum)
pub fn set_alpha_quantum(&mut self, v: Quantum)
Wraps ImageMagick’s PixelSetAlphaQuantum function.
Sourcepub fn get_black_quantum(&self) -> Quantum
pub fn get_black_quantum(&self) -> Quantum
Wraps ImageMagick’s PixelGetBlackQuantum function.
Sourcepub fn set_black_quantum(&mut self, v: Quantum)
pub fn set_black_quantum(&mut self, v: Quantum)
Wraps ImageMagick’s PixelSetBlackQuantum function.
Sourcepub fn get_blue_quantum(&self) -> Quantum
pub fn get_blue_quantum(&self) -> Quantum
Wraps ImageMagick’s PixelGetBlueQuantum function.
Sourcepub fn set_blue_quantum(&mut self, v: Quantum)
pub fn set_blue_quantum(&mut self, v: Quantum)
Wraps ImageMagick’s PixelSetBlueQuantum function.
Sourcepub fn get_cyan_quantum(&self) -> Quantum
pub fn get_cyan_quantum(&self) -> Quantum
Wraps ImageMagick’s PixelGetCyanQuantum function.
Sourcepub fn set_cyan_quantum(&mut self, v: Quantum)
pub fn set_cyan_quantum(&mut self, v: Quantum)
Wraps ImageMagick’s PixelSetCyanQuantum function.
Sourcepub fn get_green_quantum(&self) -> Quantum
pub fn get_green_quantum(&self) -> Quantum
Wraps ImageMagick’s PixelGetGreenQuantum function.
Sourcepub fn set_green_quantum(&mut self, v: Quantum)
pub fn set_green_quantum(&mut self, v: Quantum)
Wraps ImageMagick’s PixelSetGreenQuantum function.
Sourcepub fn get_magenta(&self) -> f64
pub fn get_magenta(&self) -> f64
Wraps ImageMagick’s PixelGetMagenta function.
Sourcepub fn get_magenta_quantum(&self) -> Quantum
pub fn get_magenta_quantum(&self) -> Quantum
Wraps ImageMagick’s PixelGetMagentaQuantum function.
Sourcepub fn set_magenta(&mut self, v: f64)
pub fn set_magenta(&mut self, v: f64)
Wraps ImageMagick’s PixelSetMagenta function.
Sourcepub fn set_magenta_quantum(&mut self, v: Quantum)
pub fn set_magenta_quantum(&mut self, v: Quantum)
Wraps ImageMagick’s PixelSetMagentaQuantum function.
Sourcepub fn get_red_quantum(&self) -> Quantum
pub fn get_red_quantum(&self) -> Quantum
Wraps ImageMagick’s PixelGetRedQuantum function.
Sourcepub fn set_red_quantum(&mut self, v: Quantum)
pub fn set_red_quantum(&mut self, v: Quantum)
Wraps ImageMagick’s PixelSetRedQuantum function.
Sourcepub fn get_yellow(&self) -> f64
pub fn get_yellow(&self) -> f64
Wraps ImageMagick’s PixelGetYellow function.
Sourcepub fn get_yellow_quantum(&self) -> Quantum
pub fn get_yellow_quantum(&self) -> Quantum
Wraps ImageMagick’s PixelGetYellowQuantum function.
Sourcepub fn set_yellow(&mut self, v: f64)
pub fn set_yellow(&mut self, v: f64)
Wraps ImageMagick’s PixelSetYellow function.
Sourcepub fn set_yellow_quantum(&mut self, v: Quantum)
pub fn set_yellow_quantum(&mut self, v: Quantum)
Wraps ImageMagick’s PixelSetYellowQuantum function.