pub struct MagickWand { /* private fields */ }Expand description
A safe wrapper around an ImageMagick MagickWand.
The wand owns the underlying ImageMagick handle and destroys it when dropped.
Implementations§
Source§impl MagickWand
impl MagickWand
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 MagickWand
MagickWand is a Rustic wrapper to the Rust bindings to ImageMagick.
impl MagickWand
MagickWand is a Rustic wrapper to the Rust bindings to ImageMagick.
Instantiating a MagickWand will construct an ImageMagick “wand”
on which operations can be performed via the MagickWand functions.
When the MagickWand is dropped, the ImageMagick wand will be
destroyed as well.
Sourcepub fn new_from_image(img: &Image<'_>) -> Result<MagickWand, MagickError>
pub fn new_from_image(img: &Image<'_>) -> Result<MagickWand, MagickError>
Creates new wand by cloning the image.
img: the image.
Sourcepub fn new_image(
&self,
columns: usize,
rows: usize,
background: &PixelWand,
) -> Result<(), MagickError>
pub fn new_image( &self, columns: usize, rows: usize, background: &PixelWand, ) -> Result<(), MagickError>
Add a blank image canvas of the given dimensions and background color.
Sourcepub fn set_resource_limit(
resource: ResourceType,
limit: u64,
) -> Result<(), MagickError>
pub fn set_resource_limit( resource: ResourceType, limit: u64, ) -> Result<(), MagickError>
opt-in platforms that have resource limits support
Sourcepub fn get_resource_limit(resource: ResourceType) -> u64
pub fn get_resource_limit(resource: ResourceType) -> u64
Returns the current limit for the given resource (e.g. the maximum number
of threads when resource is ResourceType::Thread), as previously set
by MagickWand::set_resource_limit or the ImageMagick defaults.
Sourcepub fn get_resource(resource: ResourceType) -> u64
pub fn get_resource(resource: ResourceType) -> u64
Returns the amount of the given resource currently in use.
Sourcepub fn set_option(&mut self, key: &str, value: &str) -> Result<(), MagickError>
pub fn set_option(&mut self, key: &str, value: &str) -> Result<(), MagickError>
Associate one option name/value pair with the wand.
Sourcepub fn annotate_image(
&mut self,
drawing_wand: &DrawingWand,
x: f64,
y: f64,
angle: f64,
text: &str,
) -> Result<(), MagickError>
pub fn annotate_image( &mut self, drawing_wand: &DrawingWand, x: f64, y: f64, angle: f64, text: &str, ) -> Result<(), MagickError>
Annotate the image with text drawn using the given drawing wand, at
position (x, y) and rotated by angle degrees.
Sourcepub fn add_image(&mut self, other_wand: &MagickWand) -> Result<(), MagickError>
pub fn add_image(&mut self, other_wand: &MagickWand) -> Result<(), MagickError>
Add all images from another wand to this wand at the current index.
Sourcepub fn append_all(&mut self, stack: bool) -> Result<MagickWand, MagickError>
pub fn append_all(&mut self, stack: bool) -> Result<MagickWand, MagickError>
Append all images in the wand into a single new wand, stacking them
vertically when stack is true or horizontally when false.
Sourcepub fn label_image(&self, label: &str) -> Result<(), MagickError>
pub fn label_image(&self, label: &str) -> Result<(), MagickError>
Set the image label property to the given string.
Sourcepub fn write_images(&self, path: &str, adjoin: bool) -> Result<(), MagickError>
pub fn write_images(&self, path: &str, adjoin: bool) -> Result<(), MagickError>
Write all images in the wand to the named file. When adjoin is true
and the format supports it, all images are written into a single file;
otherwise each image is written to a separately numbered file.
Sourcepub fn read_image(&self, path: &str) -> Result<(), MagickError>
pub fn read_image(&self, path: &str) -> Result<(), MagickError>
Read the image data from the named file.
Sourcepub fn read_image_blob<T: AsRef<[u8]>>(
&self,
data: T,
) -> Result<(), MagickError>
pub fn read_image_blob<T: AsRef<[u8]>>( &self, data: T, ) -> Result<(), MagickError>
Read the image data from the vector of bytes.
Sourcepub fn ping_image(&self, path: &str) -> Result<(), MagickError>
pub fn ping_image(&self, path: &str) -> Result<(), MagickError>
Same as read_image, but reads only the width, height, size and format of an image, without reading data.
Sourcepub fn ping_image_blob<T: AsRef<[u8]>>(
&self,
data: T,
) -> Result<(), MagickError>
pub fn ping_image_blob<T: AsRef<[u8]>>( &self, data: T, ) -> Result<(), MagickError>
Same as read_image, but reads only the width, height, size and format of an image, without reading data.
Sourcepub fn merge_image_layers(
&self,
method: LayerMethod,
) -> Result<MagickWand, MagickError>
pub fn merge_image_layers( &self, method: LayerMethod, ) -> Result<MagickWand, MagickError>
Composes all the image layers from the current given image onward to produce a single image of the merged layers.
The inital canvas’s size depends on the given LayerMethod, and is initialized using the first images background color. The images are then composited onto that image in sequence using the given composition that has been assigned to each individual image.
-
method: the method of selecting the size of the initial canvas. MergeLayer: Merge all layers onto a canvas just large enough to hold all the actual images. The virtual canvas of the first image is preserved but otherwise ignored.FlattenLayer: Use the virtual canvas size of first image. Images which fall outside this canvas is clipped. This can be used to ‘fill out’ a given virtual canvas.
MosaicLayer: Start with the virtual canvas of the first image, enlarging left and right edges to contain all images. Images with negative offsets will be clipped.
Sourcepub fn get_number_images(&self) -> usize
pub fn get_number_images(&self) -> usize
Returns the number of images associated with a magick wand.
Sourcepub fn compare_images(
&self,
reference: &MagickWand,
metric: MetricType,
) -> (f64, Option<MagickWand>)
pub fn compare_images( &self, reference: &MagickWand, metric: MetricType, ) -> (f64, Option<MagickWand>)
Compare two images and return tuple (distortion, diffImage)
diffImage is None if distortion == 0
Sourcepub fn compose_images(
&self,
reference: &MagickWand,
composition_operator: CompositeOperator,
clip_to_self: bool,
x: isize,
y: isize,
) -> Result<(), MagickError>
pub fn compose_images( &self, reference: &MagickWand, composition_operator: CompositeOperator, clip_to_self: bool, x: isize, y: isize, ) -> Result<(), MagickError>
Compose another image onto self at (x, y) using composition_operator
Sourcepub fn compose_images_gravity(
&self,
reference: &MagickWand,
composition_operator: CompositeOperator,
gravity_type: GravityType,
) -> Result<(), MagickError>
pub fn compose_images_gravity( &self, reference: &MagickWand, composition_operator: CompositeOperator, gravity_type: GravityType, ) -> Result<(), MagickError>
Compose another image onto self with gravity using composition_operator
Sourcepub fn coalesce(&mut self) -> Result<MagickWand, MagickError>
pub fn coalesce(&mut self) -> Result<MagickWand, MagickError>
Rebuilds image sequence with each frame size the same as first frame, and composites each frame atop of previous. Only affects GIF, and other formats with multiple pages/layers.
Sourcepub fn clut_image(
&self,
clut_wand: &MagickWand,
method: PixelInterpolateMethod,
) -> Result<(), MagickError>
pub fn clut_image( &self, clut_wand: &MagickWand, method: PixelInterpolateMethod, ) -> Result<(), MagickError>
Replaces colors in the image from a color lookup table.
Sourcepub fn hald_clut_image(&self, clut_wand: &MagickWand) -> Result<(), MagickError>
pub fn hald_clut_image(&self, clut_wand: &MagickWand) -> Result<(), MagickError>
Replaces colors in the image using a Hald color lookup table (a Hald CLUT image).
Sourcepub fn fx(&mut self, expression: &str) -> Result<MagickWand, MagickError>
pub fn fx(&mut self, expression: &str) -> Result<MagickWand, MagickError>
Evaluate the given expression for each pixel, returning a new wand with
the result. Wraps ImageMagick’s MagickFxImage.
Sourcepub fn set_size(&self, columns: usize, rows: usize) -> Result<(), MagickError>
pub fn set_size(&self, columns: usize, rows: usize) -> Result<(), MagickError>
Sets the size of the wand, used to read images larger than the canvas or to size formats (e.g. PostScript) that have no inherent dimensions.
Sourcepub fn level_image(
&self,
black_point: f64,
gamma: f64,
white_point: f64,
) -> Result<(), MagickError>
pub fn level_image( &self, black_point: f64, gamma: f64, white_point: f64, ) -> Result<(), MagickError>
Level an image. Black and white points are multiplied with QuantumRange to decrease dependencies on the end user.
Sourcepub fn levelize_image(
&self,
black_point: f64,
gamma: f64,
white_point: f64,
) -> Result<(), MagickError>
pub fn levelize_image( &self, black_point: f64, gamma: f64, white_point: f64, ) -> Result<(), MagickError>
Applies the reversed level_image. It compresses the full range of color values, so that they lie between the given black and white points. Gamma is applied before the values are mapped. It can be used to de-contrast a greyscale image to the exact levels specified.
Sourcepub fn normalize_image(&self) -> Result<(), MagickError>
pub fn normalize_image(&self) -> Result<(), MagickError>
MagickNormalizeImage enhances the contrast of a color image by adjusting the pixels color to span the entire range of colors available
Sourcepub fn ordered_dither_image(
&self,
threshold_map: &str,
) -> Result<(), MagickError>
pub fn ordered_dither_image( &self, threshold_map: &str, ) -> Result<(), MagickError>
MagickOrderedDitherImage performs an ordered dither based on a number of pre-defined dithering threshold maps, but over multiple intensity levels, which can be different for different channels, according to the input arguments.
Sourcepub fn sigmoidal_contrast_image(
&self,
sharpen: bool,
strength: f64,
midpoint: f64,
) -> Result<(), MagickError>
pub fn sigmoidal_contrast_image( &self, sharpen: bool, strength: f64, midpoint: f64, ) -> Result<(), MagickError>
Apply sigmoidal contrast to the image
Adjusts the contrast of an image with a non-linear sigmoidal contrast algorithm. Increase
the contrast of the image using a sigmoidal transfer function without saturating highlights
or shadows. Contrast indicates how much to increase the contrast (0 is none; 3 is typical;
20 is pushing it); mid-point indicates where midtones fall in the resultant image (0.0 is
white; 0.5 is middle-gray; 1.0 is black). Set sharpen to true to increase the image
contrast otherwise the contrast is reduced.
sharpen: increase or decrease image contraststrength: strength of the contrast, the larger the number the more ‘threshold-like’ it becomes.midpoint: midpoint of the function as a number in range [0, 1]
Sourcepub fn extend_image(
&self,
width: usize,
height: usize,
x: isize,
y: isize,
) -> Result<(), MagickError>
pub fn extend_image( &self, width: usize, height: usize, x: isize, y: isize, ) -> Result<(), MagickError>
Extend the image as defined by the geometry, gravity, and wand background color. Set the (x,y) offset of the geometry to move the original wand relative to the extended wand.
Sourcepub fn profile_image<'a, T: Into<Option<&'a [u8]>>>(
&self,
name: &str,
profile: T,
) -> Result<(), MagickError>
pub fn profile_image<'a, T: Into<Option<&'a [u8]>>>( &self, name: &str, profile: T, ) -> Result<(), MagickError>
Add or remove a named ICC, IPTC, or generic profile from the image.
Passing None (or an empty profile) for profile removes the named
profile.
Sourcepub fn strip_image(&self) -> Result<(), MagickError>
pub fn strip_image(&self) -> Result<(), MagickError>
Strip the image of all profiles and comments.
Sourcepub fn flip_image(&self) -> Result<(), MagickError>
pub fn flip_image(&self) -> Result<(), MagickError>
Flip the image vertically (mirror about the horizontal axis).
Sourcepub fn negate_image(&self) -> Result<(), MagickError>
pub fn negate_image(&self) -> Result<(), MagickError>
Negate the colors in the image, producing its photographic negative.
Sourcepub fn flop_image(&self) -> Result<(), MagickError>
pub fn flop_image(&self) -> Result<(), MagickError>
Flop the image horizontally (mirror about the vertical axis).
Sourcepub fn blur_image(&self, radius: f64, sigma: f64) -> Result<(), MagickError>
pub fn blur_image(&self, radius: f64, sigma: f64) -> Result<(), MagickError>
Blur the image by convolving it with a Gaussian operator of the given
radius and standard deviation (sigma), both in pixels. For reasonable
results the radius should be larger than sigma; use a radius of 0 to let
ImageMagick select a suitable radius.
Sourcepub fn gaussian_blur_image(
&self,
radius: f64,
sigma: f64,
) -> Result<(), MagickError>
pub fn gaussian_blur_image( &self, radius: f64, sigma: f64, ) -> Result<(), MagickError>
Blur the image with a Gaussian operator of the given radius and
standard deviation (sigma), both in pixels. Use a radius of 0 to let
ImageMagick select a suitable radius.
Sourcepub fn statistic_image(
&self,
statistic_type: StatisticType,
width: usize,
height: usize,
) -> Result<(), MagickError>
pub fn statistic_image( &self, statistic_type: StatisticType, width: usize, height: usize, ) -> Result<(), MagickError>
Replace each pixel with corresponding statistic from the neighborhood of the specified width and height.
statistic_type: the statistic type (e.g.StatisticType::Median,StatisticType::Mode, etc.).width: the width of the pixel neighborhood.height: the height of the pixel neighborhood.
Sourcepub fn median_blur_image(
&self,
width: usize,
height: usize,
) -> Result<(), MagickError>
pub fn median_blur_image( &self, width: usize, height: usize, ) -> Result<(), MagickError>
Calculate median for each pixel’s neighborhood.
See statistic_image
Sourcepub fn adaptive_resize_image(
&self,
width: usize,
height: usize,
) -> Result<(), MagickError>
pub fn adaptive_resize_image( &self, width: usize, height: usize, ) -> Result<(), MagickError>
Adaptively resize the currently selected image.
Sourcepub fn rotate_image(
&self,
background: &PixelWand,
degrees: f64,
) -> Result<(), MagickError>
pub fn rotate_image( &self, background: &PixelWand, degrees: f64, ) -> Result<(), MagickError>
Rotate the currently selected image by the given number of degrees, filling any empty space with the background color of a given PixelWand
Sourcepub fn trim_image(&self, fuzz: f64) -> Result<(), MagickError>
pub fn trim_image(&self, fuzz: f64) -> Result<(), MagickError>
Trim the image removing the background color from the edges.
fuzz is the color-matching tolerance in raw quantum units
(0..=QuantumRange), not a fraction or percentage. To express the
ImageMagick command line’s -fuzz 15%, multiply: e.g. on a Q16 build use
0.15 * 65535.0. Passing a small value such as 0.15 is effectively a
zero-tolerance trim and will not remove a noisy border.
Sourcepub fn get_image_virtual_pixel_method(&self) -> VirtualPixelMethod
pub fn get_image_virtual_pixel_method(&self) -> VirtualPixelMethod
Returns the virtual pixel method used when accessing pixels outside the
image (for example by blur_image near the edges).
Sourcepub fn set_image_virtual_pixel_method(
&mut self,
method: VirtualPixelMethod,
) -> VirtualPixelMethod
pub fn set_image_virtual_pixel_method( &mut self, method: VirtualPixelMethod, ) -> VirtualPixelMethod
Sets the virtual pixel method used when accessing pixels outside the
image, returning the previous method. This is the equivalent of the
command line -virtual-pixel setting, e.g. VirtualPixelMethod::Edge
for -virtual-pixel edge.
Sourcepub fn get_image_width(&self) -> usize
pub fn get_image_width(&self) -> usize
Retrieve the width of the image.
Sourcepub fn get_image_height(&self) -> usize
pub fn get_image_height(&self) -> usize
Retrieve the height of the image.
Sourcepub fn get_image_page(&self) -> (usize, usize, isize, isize)
pub fn get_image_page(&self) -> (usize, usize, isize, isize)
Retrieve the page geometry (width, height, x offset, y offset) of the image.
Sourcepub fn reset_image_page(&self, page_geometry: &str) -> Result<(), MagickError>
pub fn reset_image_page(&self, page_geometry: &str) -> Result<(), MagickError>
Reset the Wand page canvas and position.
Sourcepub fn get_image_artifact(&self, artifact: &str) -> Result<String, MagickError>
pub fn get_image_artifact(&self, artifact: &str) -> Result<String, MagickError>
Returns a value associated with the specified artifact.
artifact: the artifact.
Sourcepub fn get_image_artifacts(
&self,
pattern: &str,
) -> Result<Vec<String>, MagickError>
pub fn get_image_artifacts( &self, pattern: &str, ) -> Result<Vec<String>, MagickError>
Returns the values of all image artifacts whose names match the given pattern.
Sourcepub fn set_image_artifact(
&mut self,
artifact: &str,
value: &str,
) -> Result<(), MagickError>
pub fn set_image_artifact( &mut self, artifact: &str, value: &str, ) -> Result<(), MagickError>
Sets a key-value pair in the image artifact namespace. Artifacts differ from properties. Properties are public and are generally exported to an external image format if the format supports it. Artifacts are private and are utilized by the internal ImageMagick API to modify the behavior of certain algorithms.
artifact: the artifact.value: the value.
§Example
This example shows how you can blend an image with its blurred copy with 50% opacity by
setting “compose:args” to “50”. This is equivalent to having -define compose:args=50 when
using imagemagick cli.
use magick_rust::{MagickWand, PixelWand, CompositeOperator};
fn main() -> Result<(), magick_rust::MagickError> {
let mut wand1 = MagickWand::new();
wand1.new_image(4, 4, &PixelWand::new())?; // Replace with `read_image` to open your image file
let wand2 = wand1.clone();
wand1.median_blur_image(10, 10)?;
wand1.set_image_artifact("compose:args", "50")?;
wand1.compose_images(&wand2, CompositeOperator::Blend, false, 0, 0)?;
Ok(())
}Sourcepub fn delete_image_artifact(
&mut self,
artifact: &str,
) -> Result<(), MagickError>
pub fn delete_image_artifact( &mut self, artifact: &str, ) -> Result<(), MagickError>
Deletes a wand artifact.
artifact: the artifact.
Sourcepub fn get_image_property(&self, name: &str) -> Result<String, MagickError>
pub fn get_image_property(&self, name: &str) -> Result<String, MagickError>
Retrieve the named image property value.
Sourcepub fn get_image_properties(
&self,
pattern: &str,
) -> Result<Vec<String>, MagickError>
pub fn get_image_properties( &self, pattern: &str, ) -> Result<Vec<String>, MagickError>
Returns the values of all image properties whose names match the given pattern.
Sourcepub fn set_image_property(
&self,
name: &str,
value: &str,
) -> Result<(), MagickError>
pub fn set_image_property( &self, name: &str, value: &str, ) -> Result<(), MagickError>
Set the named image property.
Sourcepub fn get_image_pixel_color(&self, x: isize, y: isize) -> Option<PixelWand>
pub fn get_image_pixel_color(&self, x: isize, y: isize) -> Option<PixelWand>
Returns a PixelWand instance for the pixel specified by x and y offests.
Sourcepub fn set_sampling_factors(
&self,
samplingFactors: &[f64],
) -> Result<(), MagickError>
pub fn set_sampling_factors( &self, samplingFactors: &[f64], ) -> Result<(), MagickError>
Sets the image sampling factors.
samplingFactors: An array of floats representing the sampling factor for each color component (in RGB order).
Sourcepub fn get_image_histogram(&self) -> Option<Vec<PixelWand>>
pub fn get_image_histogram(&self) -> Option<Vec<PixelWand>>
Returns the image histogram as a vector of PixelWand instances for every unique color.
Sourcepub fn sharpen_image(&self, radius: f64, sigma: f64) -> Result<(), MagickError>
pub fn sharpen_image(&self, radius: f64, sigma: f64) -> Result<(), MagickError>
Sharpens an image. We convolve the image with a Gaussian operator of the given radius and standard deviation (sigma). For reasonable results, the radius should be larger than sigma. Use a radius of 0 and SharpenImage() selects a suitable radius for you.
radius: the radius of the Gaussian, in pixels, not counting the center pixel.
sigma: the standard deviation of the Gaussian, in pixels.
Sourcepub fn set_background_color(
&self,
pixel_wand: &PixelWand,
) -> Result<(), MagickError>
pub fn set_background_color( &self, pixel_wand: &PixelWand, ) -> Result<(), MagickError>
Set the background color.
Sourcepub fn set_image_background_color(
&self,
pixel_wand: &PixelWand,
) -> Result<(), MagickError>
pub fn set_image_background_color( &self, pixel_wand: &PixelWand, ) -> Result<(), MagickError>
Set the image background color.
Sourcepub fn get_image_resolution(&self) -> Result<(f64, f64), MagickError>
pub fn get_image_resolution(&self) -> Result<(f64, f64), MagickError>
Returns the image resolution as a pair (horizontal resolution, vertical resolution)
Sourcepub fn get_image_range(&self) -> Result<(f64, f64), MagickError>
pub fn get_image_range(&self) -> Result<(f64, f64), MagickError>
Returns the range of the image as a pair (minima, maxima), in raw
quantum values (i.e. 0..=QuantumRange). The range is computed over the
channels currently enabled by the image’s channel mask; by default that
is every channel. To restrict the range to a single channel, see
MagickWand::get_image_channel_range.
Sourcepub fn get_image_channel_range(
&mut self,
channel: ChannelType,
) -> Result<(f64, f64), MagickError>
pub fn get_image_channel_range( &mut self, channel: ChannelType, ) -> Result<(f64, f64), MagickError>
Returns the range of a single channel as a pair (minima, maxima), in
raw quantum values (i.e. 0..=QuantumRange). This is the equivalent of
PHP Imagick’s getImageChannelRange, which was removed from the C API in
ImageMagick 7: it is implemented by temporarily setting the image channel
mask, reading the range, then restoring the previous mask.
Sourcepub fn set_image_resolution(
&self,
x_resolution: f64,
y_resolution: f64,
) -> Result<(), MagickError>
pub fn set_image_resolution( &self, x_resolution: f64, y_resolution: f64, ) -> Result<(), MagickError>
Sets the image resolution
Sourcepub fn set_resolution(
&self,
x_resolution: f64,
y_resolution: f64,
) -> Result<(), MagickError>
pub fn set_resolution( &self, x_resolution: f64, y_resolution: f64, ) -> Result<(), MagickError>
Sets the wand resolution
Sourcepub fn sepia_tone_image(&self, threshold: f64) -> Result<(), MagickError>
pub fn sepia_tone_image(&self, threshold: f64) -> Result<(), MagickError>
Applies a special effect to the image, similar to the effect achieved in
a photo darkroom by sepia toning. The threshold controls the extent of
the tone darkening and is given as a fraction of the quantum range
(a value around 0.8, i.e. 80%, is typical).
Sourcepub fn export_image_pixels(
&self,
x: isize,
y: isize,
width: usize,
height: usize,
map: &str,
) -> Option<Vec<u8>>
pub fn export_image_pixels( &self, x: isize, y: isize, width: usize, height: usize, map: &str, ) -> Option<Vec<u8>>
Extracts pixel data from the image as a vector of 0..255 values defined by map.
See https://imagemagick.org/api/magick-image.php#MagickExportImagePixels for more information.
Sourcepub fn export_image_pixels_double(
&self,
x: isize,
y: isize,
width: usize,
height: usize,
map: &str,
) -> Option<Vec<f64>>
pub fn export_image_pixels_double( &self, x: isize, y: isize, width: usize, height: usize, map: &str, ) -> Option<Vec<f64>>
Extracts pixel data from the image as a vector of f64 values defined by
map. Like export_image_pixels but with
floating-point (DoublePixel) storage.
Sourcepub fn resize_image(
&self,
width: usize,
height: usize,
filter: FilterType,
) -> Result<(), MagickError>
pub fn resize_image( &self, width: usize, height: usize, filter: FilterType, ) -> Result<(), MagickError>
Resize the image to the specified width and height, using the specified filter type.
Sourcepub fn scale_image(
&self,
width_scale: f64,
height_scale: f64,
filter: FilterType,
) -> Result<(), MagickError>
pub fn scale_image( &self, width_scale: f64, height_scale: f64, filter: FilterType, ) -> Result<(), MagickError>
Resize image by specifying the new size in percent of last size.
Effectively resizes image to (current width * width_scale, current height *
height_scale)
Sourcepub fn thumbnail_image(
&self,
width: usize,
height: usize,
) -> Result<(), MagickError>
pub fn thumbnail_image( &self, width: usize, height: usize, ) -> Result<(), MagickError>
Resize the image to the specified width and height, using the ‘thumbnail’ optimizations which remove a lot of image meta-data with the goal of producing small low cost images suited for display on the web.
Sourcepub fn crop_image(
&self,
width: usize,
height: usize,
x: isize,
y: isize,
) -> Result<(), MagickError>
pub fn crop_image( &self, width: usize, height: usize, x: isize, y: isize, ) -> Result<(), MagickError>
Extract a region of the image. The width and height is used as the size of the region. X and Y is the offset.
Sourcepub fn sample_image(
&self,
width: usize,
height: usize,
) -> Result<(), MagickError>
pub fn sample_image( &self, width: usize, height: usize, ) -> Result<(), MagickError>
Sample the image to the target resolution
This is incredibly fast, as it does 1-1 pixel mapping for downscales, and box filtering for upscales
Sourcepub fn resample_image(
&self,
x_resolution: f64,
y_resolution: f64,
filter: FilterType,
) -> Result<(), MagickError>
pub fn resample_image( &self, x_resolution: f64, y_resolution: f64, filter: FilterType, ) -> Result<(), MagickError>
Resample the image to the specified horizontal and vertical resolution, using the specified filter type.
Sourcepub fn liquid_rescale_image(
&self,
width: usize,
height: usize,
delta_x: f64,
rigidity: f64,
) -> Result<(), MagickError>
pub fn liquid_rescale_image( &self, width: usize, height: usize, delta_x: f64, rigidity: f64, ) -> Result<(), MagickError>
Rescale the image using seam carving algorithm
Sourcepub fn implode(
&self,
amount: f64,
method: PixelInterpolateMethod,
) -> Result<(), MagickError>
pub fn implode( &self, amount: f64, method: PixelInterpolateMethod, ) -> Result<(), MagickError>
Implodes the image towards the center by the specified percentage
Sourcepub fn fit(&self, width: usize, height: usize)
pub fn fit(&self, width: usize, height: usize)
Resize the image to fit within the given dimensions, maintaining the current aspect ratio.
Sourcepub fn requires_orientation(&self) -> bool
pub fn requires_orientation(&self) -> bool
Detect if the loaded image is not in top-left orientation, and hence should be “auto” oriented so it is suitable for viewing.
Sourcepub fn auto_orient(&self) -> bool
pub fn auto_orient(&self) -> bool
Automatically adjusts the loaded image so that its orientation is suitable for viewing (i.e. top-left orientation).
Returns true if successful or false if an error occurred.
Sourcepub fn write_image(&self, path: &str) -> Result<(), MagickError>
pub fn write_image(&self, path: &str) -> Result<(), MagickError>
Write the current image to the provided path.
Sourcepub fn write_image_blob(&self, format: &str) -> Result<Vec<u8>, MagickError>
pub fn write_image_blob(&self, format: &str) -> Result<Vec<u8>, MagickError>
Write the image in the desired format to a new blob.
The format argument may be any ImageMagick supported image
format (e.g. GIF, JPEG, PNG, etc).
Sourcepub fn write_images_blob(&self, format: &str) -> Result<Vec<u8>, MagickError>
pub fn write_images_blob(&self, format: &str) -> Result<Vec<u8>, MagickError>
Write the images in the desired format to a new blob.
The format argument may be any ImageMagick supported image
format (e.g. GIF, JPEG, PNG, etc).
Sourcepub fn get_image_alpha_channel(&self) -> bool
pub fn get_image_alpha_channel(&self) -> bool
Return false if the image alpha channel is not activated. That is, the image is RGB rather than RGBA or CMYK rather than CMYKA
Sourcepub fn draw_image(
&mut self,
drawing_wand: &DrawingWand,
) -> Result<(), MagickError>
pub fn draw_image( &mut self, drawing_wand: &DrawingWand, ) -> Result<(), MagickError>
Renders the drawing wand on the current image
Sourcepub fn deskew_image(&mut self, threshold: f64) -> Result<(), MagickError>
pub fn deskew_image(&mut self, threshold: f64) -> Result<(), MagickError>
Removes skew from the image. Skew is an artifact that occurs in scanned images because of the camera being misaligned, imperfections in the scanning or surface, or simply because the paper was not placed completely flat when scanned
Sourcepub fn set_image_mask(
&mut self,
pixel_mask: PixelMask,
clip_mask: &MagickWand,
) -> Result<(), MagickError>
pub fn set_image_mask( &mut self, pixel_mask: PixelMask, clip_mask: &MagickWand, ) -> Result<(), MagickError>
Sets image clip mask.
pixel_mask: type of mask, Read or Write.clip_mask: the clip_mask wand.
Sourcepub fn set_image_channel_mask(&mut self, option: ChannelType) -> ChannelType
pub fn set_image_channel_mask(&mut self, option: ChannelType) -> ChannelType
Set image channel mask
Sourcepub fn evaluate_image(
&mut self,
op: MagickEvaluateOperator,
val: f64,
) -> Result<(), MagickError>
pub fn evaluate_image( &mut self, op: MagickEvaluateOperator, val: f64, ) -> Result<(), MagickError>
Apply an arithmetic, relational, or logical expression to an image. Use these operators to lighten or darken an image, to increase or decrease contrast in an image, or to produce the “negative” of an image.
Sourcepub fn border_image(
&self,
pixel_wand: &PixelWand,
width: usize,
height: usize,
compose: CompositeOperator,
) -> Result<(), MagickError>
pub fn border_image( &self, pixel_wand: &PixelWand, width: usize, height: usize, compose: CompositeOperator, ) -> Result<(), MagickError>
Surround the image with a border of the color defined
by the pixel_wand.
Sourcepub fn floodfill_paint_image(
&self,
fill: &PixelWand,
fuzz: f64,
border_color: &PixelWand,
x: isize,
y: isize,
invert: bool,
) -> Result<(), MagickError>
pub fn floodfill_paint_image( &self, fill: &PixelWand, fuzz: f64, border_color: &PixelWand, x: isize, y: isize, invert: bool, ) -> Result<(), MagickError>
Flood-fill the image starting at the pixel (x, y), replacing every
connected neighbouring pixel that matches the target with fill.
This is the building block for “remove the background” operations such as
the ImageMagick command line
-fill none -fuzz 75% -draw "alpha 0,0 floodfill": read the image, give
it an alpha channel, then flood-fill from a corner with a transparent
fill color.
fill: the color painted into the matched region (e.g."none"for transparency).fuzz: how far a pixel’s color may differ from the target and still be considered a match, in raw quantum units (0..=QuantumRange). For a percentage, multiply: e.g. 75% on a Q16 build is0.75 * 65535.0.border_color: the target color to flood. Withinvert == false, the region of connected pixels matchingborder_color(withinfuzz), starting from(x, y), is painted withfill. Withinvert == true, the connected region of pixels that do not matchborder_coloris painted instead.x,y: the seed pixel where the fill begins.invert: invert the sense of the match, as described above.
Sourcepub fn transparent_paint_image(
&self,
target: &PixelWand,
alpha: f64,
fuzz: f64,
invert: bool,
) -> Result<(), MagickError>
pub fn transparent_paint_image( &self, target: &PixelWand, alpha: f64, fuzz: f64, invert: bool, ) -> Result<(), MagickError>
Change any pixel that matches target (within fuzz) to the given
alpha transparency. This is the wand-level equivalent of the command
line -transparent <color> and avoids dropping down to the core
TransparentPaintImage API.
To make a color disappear, give the image an alpha channel (e.g.
set_image_alpha_channel(AlphaChannelOption::OpaqueAlphaChannel)), then
paint that color with alpha == 0.0.
target: the color to match.alpha: the transparency to apply to matched pixels, where1.0is fully opaque and0.0is fully transparent.fuzz: how far a pixel’s color may differ fromtargetand still be considered a match, in raw quantum units (0..=QuantumRange). For a percentage, multiply: e.g. 10% on a Q16 build is0.10 * 65535.0.invert: whentrue, paint the pixels that do not matchtargetinstead.
Sourcepub fn shadow_image(
&self,
alpha: f64,
sigma: f64,
x: isize,
y: isize,
) -> Result<(), MagickError>
pub fn shadow_image( &self, alpha: f64, sigma: f64, x: isize, y: isize, ) -> Result<(), MagickError>
Simulate an image shadow
Sourcepub fn import_image_pixels(
&mut self,
x: isize,
y: isize,
columns: usize,
rows: usize,
pixels: &[u8],
map: &str,
) -> Result<(), MagickError>
pub fn import_image_pixels( &mut self, x: isize, y: isize, columns: usize, rows: usize, pixels: &[u8], map: &str, ) -> Result<(), MagickError>
Accepts pixel data and stores it in the image at the location you specify. See https://imagemagick.org/api/magick-image.php#MagickImportImagePixels for more information.
Sourcepub fn import_image_pixels_double(
&mut self,
x: isize,
y: isize,
columns: usize,
rows: usize,
pixels: &[f64],
map: &str,
) -> Result<(), MagickError>
pub fn import_image_pixels_double( &mut self, x: isize, y: isize, columns: usize, rows: usize, pixels: &[f64], map: &str, ) -> Result<(), MagickError>
Accepts f64 pixel data and stores it in the image at the given
location. Like import_image_pixels but with
floating-point (DoublePixel) storage.
Sourcepub fn images(&self) -> Images<'_>
pub fn images(&self) -> Images<'_>
Borrow the wand’s image list for read-only frame access.
This is the ergonomic way to work with multi-image wands (such as the
frames of an animated GIF): the returned Images view resets the
iterator and hands out frame borrows that automatically position the
iterator before each access. See Self::images_mut for mutable access.
Sourcepub fn images_mut(&mut self) -> ImagesMut<'_>
pub fn images_mut(&mut self) -> ImagesMut<'_>
Borrow the wand’s image list for mutable frame access.
Because ImageMagick exposes a single internal iterator, only one frame may be borrowed mutably at a time; this is enforced at compile time.
Sourcepub fn reset_iterator(&self)
pub fn reset_iterator(&self)
Reset the wand iterator so that the next call to Self::next_image
returns the first image. This is most useful before iterating an image
list with next_image; it leaves the wand positioned before the first
image rather than on it (see Self::set_first_iterator for that).
See https://imagemagick.org/api/magick-wand.php#MagickResetIterator for more information.
Sourcepub fn set_first_iterator(&self)
pub fn set_first_iterator(&self)
Set the wand iterator to the first image. See https://imagemagick.org/api/magick-wand.php#MagickSetFirstIterator for more information.
Sourcepub fn set_last_iterator(&self)
pub fn set_last_iterator(&self)
Set the wand iterator to the last image. See https://imagemagick.org/api/magick-wand.php#MagickSetLastIterator for more information.
Sourcepub fn next_image(&self) -> bool
pub fn next_image(&self) -> bool
Set the next image in the wand as the current image.
Returns true while the iterator advanced onto a valid image, and
false once it has moved past the last image.
See https://imagemagick.org/api/magick-image.php#MagickNextImage for more information.
Sourcepub fn previous_image(&self) -> bool
pub fn previous_image(&self) -> bool
Set the previous image in the wand as the current image.
Returns true while the iterator stepped back onto a valid image, and
false once it has moved before the first image.
See https://imagemagick.org/api/magick-image.php#MagickPreviousImage for more information.
Sourcepub fn has_next_image(&self) -> bool
pub fn has_next_image(&self) -> bool
Returns true if the wand has more images when traversing the list in
the forward direction.
See https://imagemagick.org/api/magick-image.php#MagickHasNextImage for more information.
Sourcepub fn has_previous_image(&self) -> bool
pub fn has_previous_image(&self) -> bool
Returns true if the wand has more images when traversing the list in
the reverse direction.
See https://imagemagick.org/api/magick-image.php#MagickHasPreviousImage for more information.
Sourcepub fn remove_image(&mut self) -> Result<(), MagickError>
pub fn remove_image(&mut self) -> Result<(), MagickError>
Remove the current image from the image list. See https://imagemagick.org/api/magick-image.php#MagickRemoveImage for more information.
Sourcepub fn auto_threshold(
&self,
method: AutoThresholdMethod,
) -> Result<(), MagickError>
pub fn auto_threshold( &self, method: AutoThresholdMethod, ) -> Result<(), MagickError>
Automatically performs threshold method to reduce grayscale data down to a binary black & white image. Included algorithms are Kapur, Otsu, and Triangle methods. See https://imagemagick.org/api/magick-image.php#MagickAutoThresholdImage for more information.
Sourcepub fn transform_image_colorspace(
&self,
colorspace: ColorspaceType,
) -> Result<(), MagickError>
pub fn transform_image_colorspace( &self, colorspace: ColorspaceType, ) -> Result<(), MagickError>
Set the image colorspace, transforming (unlike set_image_colorspace) image data in
the process.
Sourcepub fn quantize_image(
&self,
number_of_colors: usize,
colorspace: ColorspaceType,
tree_depth: usize,
dither_method: DitherMethod,
measure_error: bool,
) -> Result<(), MagickError>
pub fn quantize_image( &self, number_of_colors: usize, colorspace: ColorspaceType, tree_depth: usize, dither_method: DitherMethod, measure_error: bool, ) -> Result<(), MagickError>
Reduce the number of colors in the image.
Sourcepub fn quantize_images(
&self,
number_of_colors: usize,
colorspace: ColorspaceType,
tree_depth: usize,
dither_method: DitherMethod,
measure_error: bool,
) -> Result<(), MagickError>
pub fn quantize_images( &self, number_of_colors: usize, colorspace: ColorspaceType, tree_depth: usize, dither_method: DitherMethod, measure_error: bool, ) -> Result<(), MagickError>
Reduce the number of colors in the images.
Sourcepub fn function_image(
&self,
function: MagickFunction,
args: &[f64],
) -> Result<(), MagickError>
pub fn function_image( &self, function: MagickFunction, args: &[f64], ) -> Result<(), MagickError>
Applies an arithmetic, relational, or logical expression to an image. Use these operators to lighten or darken an image, to increase or decrease contrast in an image, or to produce the “negative” of an image.
function: the image function.args: the function arguments.
§Example
This example show how you can apply smoothstep function (a polynomial -2x^3 + 3x^2) to
every image pixel.
use magick_rust::{MagickWand, PixelWand, MagickFunction};
fn main() -> Result<(), magick_rust::MagickError> {
let mut wand1 = MagickWand::new();
wand1.new_image(4, 4, &PixelWand::new())?; // Replace with `read_image` to open your image file
// Apply smoothstep polynomial
wand1.function_image(MagickFunction::Polynomial, &[-2.0, 3.0, 0.0, 0.0])?;
Ok(())
}Sourcepub fn polynomial_image(&self, terms: &[f64]) -> Result<(), MagickError>
pub fn polynomial_image(&self, terms: &[f64]) -> Result<(), MagickError>
Returns an image where each pixel is the sum of the pixels in the image sequence after applying its corresponding terms (coefficient and degree pairs).
terms: the list of polynomial coefficients and degree pairs and a constant.
Sourcepub fn convolve_image(
&self,
kernel_info: &KernelInfo,
) -> Result<(), MagickError>
pub fn convolve_image( &self, kernel_info: &KernelInfo, ) -> Result<(), MagickError>
Applies a custom convolution kernel to the image.
kernel_info: An array of doubles representing the convolution kernel.
Sourcepub fn morphology_image(
&self,
morphology_method: MorphologyMethod,
iterations: isize,
kernel_info: &KernelInfo,
) -> Result<(), MagickError>
pub fn morphology_image( &self, morphology_method: MorphologyMethod, iterations: isize, kernel_info: &KernelInfo, ) -> Result<(), MagickError>
Applies a user supplied kernel to the image according to the given morphology method.
morphology_method: the morphology method to be applied.iterations: apply the operation this many times (or no change). A value of -1 means loop until no change found. How this is applied may depend on the morphology method. Typically this is a value of 1.kernel_info: An array of doubles representing the morphology kernel.
Sourcepub fn color_matrix_image(
&self,
color_matrix: &KernelInfo,
) -> Result<(), MagickError>
pub fn color_matrix_image( &self, color_matrix: &KernelInfo, ) -> Result<(), MagickError>
Apply color transformation to an image. The method permits saturation changes, hue rotation, luminance to alpha, and various other effects. Although variable-sized transformation matrices can be used, typically one uses a 5x5 matrix for an RGBA image and a 6x6 for CMYKA (or RGBA with offsets). The matrix is similar to those used by Adobe Flash except offsets are in column 6 rather than 5 (in support of CMYKA images) and offsets are normalized (divide Flash offset by 255).
color_matrix: the color matrix.
Sourcepub fn channel_fx_image(
&self,
expression: &str,
) -> Result<MagickWand, MagickError>
pub fn channel_fx_image( &self, expression: &str, ) -> Result<MagickWand, MagickError>
Applies a channel expression to the specified image. The expression consists of one or more channels, either mnemonic or numeric (e.g. red, 1), separated by actions as follows:
<=> exchange two channels (e.g. red<=>blue) => transfer a channel to another (e.g. red=>green) , separate channel operations (e.g. red, green) | read channels from next input image (e.g. red | green) ; write channels to next output image (e.g. red; green; blue) A channel without a operation symbol implies extract. For example, to create 3 grayscale images from the red, green, and blue channels of an image, use:
expression: the expression.
Sourcepub fn combine_images(
&self,
colorspace: ColorspaceType,
) -> Result<MagickWand, MagickError>
pub fn combine_images( &self, colorspace: ColorspaceType, ) -> Result<MagickWand, MagickError>
Combines one or more images into a single image. The grayscale value of the pixels of each image in the sequence is assigned in order to the specified channels of the combined image. The typical ordering would be image 1 => Red, 2 => Green, 3 => Blue, etc.
colorspace: the colorspace.
Sourcepub fn get_image(&self) -> Result<Image<'_>, MagickError>
pub fn get_image(&self) -> Result<Image<'_>, MagickError>
Returns the current image from the magick wand.
Sourcepub fn contrast_stretch_image(
&self,
black_point: f64,
white_point: f64,
) -> Result<(), MagickError>
pub fn contrast_stretch_image( &self, black_point: f64, white_point: f64, ) -> Result<(), MagickError>
Enhances contrast of an image by stretching the range of intensity values.
Sourcepub fn set_image_alpha(&self, alpha: f64) -> Result<(), MagickError>
pub fn set_image_alpha(&self, alpha: f64) -> Result<(), MagickError>
Sets the image to the specified alpha level.
Sourcepub fn modulate_image(
&self,
brightness: f64,
saturation: f64,
hue: f64,
) -> Result<(), MagickError>
pub fn modulate_image( &self, brightness: f64, saturation: f64, hue: f64, ) -> Result<(), MagickError>
Control the brightness, saturation, and hue of an image
Sourcepub fn brightness_contrast_image(
&self,
brightness: f64,
contrast: f64,
) -> Result<(), MagickError>
pub fn brightness_contrast_image( &self, brightness: f64, contrast: f64, ) -> Result<(), MagickError>
Control the brightness and contrast
Sourcepub fn set_image_alpha_channel(
&self,
alpha_channel: AlphaChannelOption,
) -> Result<(), MagickError>
pub fn set_image_alpha_channel( &self, alpha_channel: AlphaChannelOption, ) -> Result<(), MagickError>
Set the image alpha channel mode.
Sourcepub fn unique_image_colors(&self) -> Result<(), MagickError>
pub fn unique_image_colors(&self) -> Result<(), MagickError>
Discard all but one of any pixel color.
Sourcepub fn kmeans(
&self,
number_colors: usize,
max_iterations: usize,
tolerance: f64,
) -> Result<(), MagickError>
pub fn kmeans( &self, number_colors: usize, max_iterations: usize, tolerance: f64, ) -> Result<(), MagickError>
Applies k-means color reduction to the image.
Sourcepub fn auto_gamma(&self) -> Result<(), MagickError>
pub fn auto_gamma(&self) -> Result<(), MagickError>
Extracts the ‘mean’ from the image and adjust the image to try make set its gamma appropriately.
Sourcepub fn auto_level(&self) -> Result<(), MagickError>
pub fn auto_level(&self) -> Result<(), MagickError>
Adjusts the levels of a particular image channel by scaling the minimum and maximum values to the full quantum range.
Sourcepub fn get_image_colors(&self) -> usize
pub fn get_image_colors(&self) -> usize
Wraps ImageMagick’s MagickGetImageColors function.
Sourcepub fn get_filename(&self) -> Result<String, MagickError>
pub fn get_filename(&self) -> Result<String, MagickError>
Wraps ImageMagick’s MagickGetFilename function.
Sourcepub fn set_filename(&mut self, s: &str) -> Result<(), MagickError>
pub fn set_filename(&mut self, s: &str) -> Result<(), MagickError>
Wraps ImageMagick’s MagickSetFilename function.
Sourcepub fn get_font(&self) -> Result<String, MagickError>
pub fn get_font(&self) -> Result<String, MagickError>
Wraps ImageMagick’s MagickGetFont function.
Sourcepub fn set_font(&mut self, s: &str) -> Result<(), MagickError>
pub fn set_font(&mut self, s: &str) -> Result<(), MagickError>
Wraps ImageMagick’s MagickSetFont function.
Sourcepub fn get_format(&self) -> Result<String, MagickError>
pub fn get_format(&self) -> Result<String, MagickError>
Wraps ImageMagick’s MagickGetFormat function.
Sourcepub fn set_format(&mut self, s: &str) -> Result<(), MagickError>
pub fn set_format(&mut self, s: &str) -> Result<(), MagickError>
Wraps ImageMagick’s MagickSetFormat function.
Sourcepub fn get_image_filename(&self) -> Result<String, MagickError>
pub fn get_image_filename(&self) -> Result<String, MagickError>
Wraps ImageMagick’s MagickGetImageFilename function.
Sourcepub fn set_image_filename(&mut self, s: &str) -> Result<(), MagickError>
pub fn set_image_filename(&mut self, s: &str) -> Result<(), MagickError>
Wraps ImageMagick’s MagickSetImageFilename function.
Sourcepub fn get_image_format(&self) -> Result<String, MagickError>
pub fn get_image_format(&self) -> Result<String, MagickError>
Wraps ImageMagick’s MagickGetImageFormat function.
Sourcepub fn set_image_format(&mut self, s: &str) -> Result<(), MagickError>
pub fn set_image_format(&mut self, s: &str) -> Result<(), MagickError>
Wraps ImageMagick’s MagickSetImageFormat function.
pub fn fmt_string_settings(&self, f: &mut Formatter<'_>, prefix: &str) -> Result
Sourcepub fn get_colorspace(&self) -> ColorspaceType
pub fn get_colorspace(&self) -> ColorspaceType
Wraps ImageMagick’s MagickGetColorspace function.
Sourcepub fn set_colorspace(&mut self, v: ColorspaceType) -> Result<(), MagickError>
pub fn set_colorspace(&mut self, v: ColorspaceType) -> Result<(), MagickError>
Wraps ImageMagick’s MagickSetColorspace function.
Sourcepub fn get_image_compose(&self) -> CompositeOperator
pub fn get_image_compose(&self) -> CompositeOperator
Wraps ImageMagick’s MagickGetImageCompose function.
Sourcepub fn set_image_compose(
&mut self,
v: CompositeOperator,
) -> Result<(), MagickError>
pub fn set_image_compose( &mut self, v: CompositeOperator, ) -> Result<(), MagickError>
Wraps ImageMagick’s MagickSetImageCompose function.
Sourcepub fn get_compression(&self) -> CompressionType
pub fn get_compression(&self) -> CompressionType
Wraps ImageMagick’s MagickGetCompression function.
Sourcepub fn set_compression(&mut self, v: CompressionType) -> Result<(), MagickError>
pub fn set_compression(&mut self, v: CompressionType) -> Result<(), MagickError>
Wraps ImageMagick’s MagickSetCompression function.
Sourcepub fn get_compression_quality(&self) -> usize
pub fn get_compression_quality(&self) -> usize
Wraps ImageMagick’s MagickGetCompressionQuality function.
Sourcepub fn set_compression_quality(&mut self, v: usize) -> Result<(), MagickError>
pub fn set_compression_quality(&mut self, v: usize) -> Result<(), MagickError>
Wraps ImageMagick’s MagickSetCompressionQuality function.
Sourcepub fn get_gravity(&self) -> GravityType
pub fn get_gravity(&self) -> GravityType
Wraps ImageMagick’s MagickGetGravity function.
Sourcepub fn set_gravity(&mut self, v: GravityType) -> Result<(), MagickError>
pub fn set_gravity(&mut self, v: GravityType) -> Result<(), MagickError>
Wraps ImageMagick’s MagickSetGravity function.
Sourcepub fn get_image_colorspace(&self) -> ColorspaceType
pub fn get_image_colorspace(&self) -> ColorspaceType
Wraps ImageMagick’s MagickGetImageColorspace function.
Sourcepub fn set_image_colorspace(
&mut self,
v: ColorspaceType,
) -> Result<(), MagickError>
pub fn set_image_colorspace( &mut self, v: ColorspaceType, ) -> Result<(), MagickError>
Wraps ImageMagick’s MagickSetImageColorspace function.
Sourcepub fn get_image_compression(&self) -> CompressionType
pub fn get_image_compression(&self) -> CompressionType
Wraps ImageMagick’s MagickGetImageCompression function.
Sourcepub fn set_image_compression(
&mut self,
v: CompressionType,
) -> Result<(), MagickError>
pub fn set_image_compression( &mut self, v: CompressionType, ) -> Result<(), MagickError>
Wraps ImageMagick’s MagickSetImageCompression function.
Sourcepub fn get_image_compression_quality(&self) -> usize
pub fn get_image_compression_quality(&self) -> usize
Wraps ImageMagick’s MagickGetImageCompressionQuality function.
Sourcepub fn set_image_compression_quality(
&mut self,
v: usize,
) -> Result<(), MagickError>
pub fn set_image_compression_quality( &mut self, v: usize, ) -> Result<(), MagickError>
Wraps ImageMagick’s MagickSetImageCompressionQuality function.
Sourcepub fn get_image_delay(&self) -> usize
pub fn get_image_delay(&self) -> usize
Wraps ImageMagick’s MagickGetImageDelay function.
Sourcepub fn set_image_delay(&mut self, v: usize) -> Result<(), MagickError>
pub fn set_image_delay(&mut self, v: usize) -> Result<(), MagickError>
Wraps ImageMagick’s MagickSetImageDelay function.
Sourcepub fn get_image_depth(&self) -> usize
pub fn get_image_depth(&self) -> usize
Wraps ImageMagick’s MagickGetImageDepth function.
Sourcepub fn set_image_depth(&mut self, v: usize) -> Result<(), MagickError>
pub fn set_image_depth(&mut self, v: usize) -> Result<(), MagickError>
Wraps ImageMagick’s MagickSetImageDepth function.
Sourcepub fn get_image_dispose(&self) -> DisposeType
pub fn get_image_dispose(&self) -> DisposeType
Wraps ImageMagick’s MagickGetImageDispose function.
Sourcepub fn set_image_dispose(&mut self, v: DisposeType) -> Result<(), MagickError>
pub fn set_image_dispose(&mut self, v: DisposeType) -> Result<(), MagickError>
Wraps ImageMagick’s MagickSetImageDispose function.
Sourcepub fn get_image_endian(&self) -> EndianType
pub fn get_image_endian(&self) -> EndianType
Wraps ImageMagick’s MagickGetImageEndian function.
Sourcepub fn set_image_endian(&mut self, v: EndianType) -> Result<(), MagickError>
pub fn set_image_endian(&mut self, v: EndianType) -> Result<(), MagickError>
Wraps ImageMagick’s MagickSetImageEndian function.
Sourcepub fn get_image_fuzz(&self) -> f64
pub fn get_image_fuzz(&self) -> f64
Wraps ImageMagick’s MagickGetImageFuzz function.
Sourcepub fn set_image_fuzz(&mut self, v: f64) -> Result<(), MagickError>
pub fn set_image_fuzz(&mut self, v: f64) -> Result<(), MagickError>
Wraps ImageMagick’s MagickSetImageFuzz function.
Sourcepub fn get_image_gamma(&self) -> f64
pub fn get_image_gamma(&self) -> f64
Wraps ImageMagick’s MagickGetImageGamma function.
Sourcepub fn set_image_gamma(&mut self, v: f64) -> Result<(), MagickError>
pub fn set_image_gamma(&mut self, v: f64) -> Result<(), MagickError>
Wraps ImageMagick’s MagickSetImageGamma function.
Sourcepub fn get_image_gravity(&self) -> GravityType
pub fn get_image_gravity(&self) -> GravityType
Wraps ImageMagick’s MagickGetImageGravity function.
Sourcepub fn set_image_gravity(&mut self, v: GravityType) -> Result<(), MagickError>
pub fn set_image_gravity(&mut self, v: GravityType) -> Result<(), MagickError>
Wraps ImageMagick’s MagickSetImageGravity function.
Sourcepub fn get_image_interlace_scheme(&self) -> InterlaceType
pub fn get_image_interlace_scheme(&self) -> InterlaceType
Wraps ImageMagick’s MagickGetImageInterlaceScheme function.
Sourcepub fn set_image_interlace_scheme(
&mut self,
v: InterlaceType,
) -> Result<(), MagickError>
pub fn set_image_interlace_scheme( &mut self, v: InterlaceType, ) -> Result<(), MagickError>
Wraps ImageMagick’s MagickSetImageInterlaceScheme function.
Sourcepub fn get_image_interpolate_method(&self) -> PixelInterpolateMethod
pub fn get_image_interpolate_method(&self) -> PixelInterpolateMethod
Wraps ImageMagick’s MagickGetImageInterpolateMethod function.
Sourcepub fn set_image_interpolate_method(
&mut self,
v: PixelInterpolateMethod,
) -> Result<(), MagickError>
pub fn set_image_interpolate_method( &mut self, v: PixelInterpolateMethod, ) -> Result<(), MagickError>
Wraps ImageMagick’s MagickSetImageInterpolateMethod function.
Sourcepub fn get_image_iterations(&self) -> usize
pub fn get_image_iterations(&self) -> usize
Wraps ImageMagick’s MagickGetImageIterations function.
Sourcepub fn set_image_iterations(&mut self, v: usize) -> Result<(), MagickError>
pub fn set_image_iterations(&mut self, v: usize) -> Result<(), MagickError>
Wraps ImageMagick’s MagickSetImageIterations function.
Sourcepub fn get_image_orientation(&self) -> OrientationType
pub fn get_image_orientation(&self) -> OrientationType
Wraps ImageMagick’s MagickGetImageOrientation function.
Sourcepub fn set_image_orientation(
&mut self,
v: OrientationType,
) -> Result<(), MagickError>
pub fn set_image_orientation( &mut self, v: OrientationType, ) -> Result<(), MagickError>
Wraps ImageMagick’s MagickSetImageOrientation function.
Sourcepub fn get_image_rendering_intent(&self) -> RenderingIntent
pub fn get_image_rendering_intent(&self) -> RenderingIntent
Wraps ImageMagick’s MagickGetImageRenderingIntent function.
Sourcepub fn set_image_rendering_intent(
&mut self,
v: RenderingIntent,
) -> Result<(), MagickError>
pub fn set_image_rendering_intent( &mut self, v: RenderingIntent, ) -> Result<(), MagickError>
Wraps ImageMagick’s MagickSetImageRenderingIntent function.
Sourcepub fn get_image_scene(&self) -> usize
pub fn get_image_scene(&self) -> usize
Wraps ImageMagick’s MagickGetImageScene function.
Sourcepub fn set_image_scene(&mut self, v: usize) -> Result<(), MagickError>
pub fn set_image_scene(&mut self, v: usize) -> Result<(), MagickError>
Wraps ImageMagick’s MagickSetImageScene function.
Sourcepub fn get_image_type(&self) -> ImageType
pub fn get_image_type(&self) -> ImageType
Wraps ImageMagick’s MagickGetImageType function.
Sourcepub fn set_image_type(&mut self, v: ImageType) -> Result<(), MagickError>
pub fn set_image_type(&mut self, v: ImageType) -> Result<(), MagickError>
Wraps ImageMagick’s MagickSetImageType function.
Sourcepub fn get_image_units(&self) -> ResolutionType
pub fn get_image_units(&self) -> ResolutionType
Wraps ImageMagick’s MagickGetImageUnits function.
Sourcepub fn set_image_units(&mut self, v: ResolutionType) -> Result<(), MagickError>
pub fn set_image_units(&mut self, v: ResolutionType) -> Result<(), MagickError>
Wraps ImageMagick’s MagickSetImageUnits function.
Sourcepub fn get_interlace_scheme(&self) -> InterlaceType
pub fn get_interlace_scheme(&self) -> InterlaceType
Wraps ImageMagick’s MagickGetInterlaceScheme function.
Sourcepub fn set_interlace_scheme(
&mut self,
v: InterlaceType,
) -> Result<(), MagickError>
pub fn set_interlace_scheme( &mut self, v: InterlaceType, ) -> Result<(), MagickError>
Wraps ImageMagick’s MagickSetInterlaceScheme function.
Sourcepub fn get_interpolate_method(&self) -> PixelInterpolateMethod
pub fn get_interpolate_method(&self) -> PixelInterpolateMethod
Wraps ImageMagick’s MagickGetInterpolateMethod function.
Sourcepub fn set_interpolate_method(
&mut self,
v: PixelInterpolateMethod,
) -> Result<(), MagickError>
pub fn set_interpolate_method( &mut self, v: PixelInterpolateMethod, ) -> Result<(), MagickError>
Wraps ImageMagick’s MagickSetInterpolateMethod function.
Sourcepub fn get_iterator_index(&self) -> isize
pub fn get_iterator_index(&self) -> isize
Wraps ImageMagick’s MagickGetIteratorIndex function.
Sourcepub fn set_iterator_index(&mut self, v: isize) -> Result<(), MagickError>
pub fn set_iterator_index(&mut self, v: isize) -> Result<(), MagickError>
Wraps ImageMagick’s MagickSetIteratorIndex function.
Sourcepub fn get_orientation(&self) -> OrientationType
pub fn get_orientation(&self) -> OrientationType
Wraps ImageMagick’s MagickGetOrientation function.
Sourcepub fn set_orientation(&mut self, v: OrientationType) -> Result<(), MagickError>
pub fn set_orientation(&mut self, v: OrientationType) -> Result<(), MagickError>
Wraps ImageMagick’s MagickSetOrientation function.
Sourcepub fn get_pointsize(&self) -> f64
pub fn get_pointsize(&self) -> f64
Wraps ImageMagick’s MagickGetPointsize function.
Sourcepub fn set_pointsize(&mut self, v: f64) -> Result<(), MagickError>
pub fn set_pointsize(&mut self, v: f64) -> Result<(), MagickError>
Wraps ImageMagick’s MagickSetPointsize function.
Sourcepub fn set_type(&mut self, v: ImageType) -> Result<(), MagickError>
pub fn set_type(&mut self, v: ImageType) -> Result<(), MagickError>
Wraps ImageMagick’s MagickSetType function.