[][src]Enum image::DynamicImage

pub enum DynamicImage {
    ImageLuma8(GrayImage),
    ImageLumaA8(GrayAlphaImage),
    ImageRgb8(RgbImage),
    ImageRgba8(RgbaImage),
    ImageBgr8(ImageBuffer<Bgr<u8>, Vec<u8>>),
    ImageBgra8(ImageBuffer<Bgra<u8>, Vec<u8>>),
}

A Dynamic Image

Variants

Each pixel in this image is 8-bit Luma

Each pixel in this image is 8-bit Luma with alpha

Each pixel in this image is 8-bit Rgb

Each pixel in this image is 8-bit Rgb with alpha

Each pixel in this image is 8-bit Bgr

Each pixel in this image is 8-bit Bgr with alpha

Methods

impl DynamicImage
[src]

Creates a dynamic image backed by a buffer of grey pixels.

Creates a dynamic image backed by a buffer of grey pixels with transparency.

Creates a dynamic image backed by a buffer of RGB pixels.

Creates a dynamic image backed by a buffer of RGBA pixels.

Creates a dynamic image backed by a buffer of BGRA pixels.

Creates a dynamic image backed by a buffer of BGR pixels.

Returns a copy of this image as an RGB image.

Returns a copy of this image as an RGBA image.

Returns a copy of this image as an BGR image.

Returns a copy of this image as an RGBA image.

Returns a copy of this image as a Luma image.

Returns a copy of this image as a LumaA image.

Return a cut out of this image delimited by the bounding rectangle.

Return a reference to an 8bit RGB image

Return a mutable reference to an 8bit RGB image

Return a reference to an 8bit BGR image

Return a mutable reference to an 8bit BGR image

Return a reference to an 8bit RGBA image

Return a mutable reference to an 8bit RGBA image

Return a reference to an 8bit BGRA image

Return a mutable reference to an 8bit RGBA image

Return a reference to an 8bit Grayscale image

Return a mutable reference to an 8bit Grayscale image

Return a reference to an 8bit Grayscale image with an alpha channel

Return a mutable reference to an 8bit Grayscale image with an alpha channel

Return this image's pixels as a byte vector.

Return this image's color type.

Return a grayscale version of this image.

Invert the colors of this image. This method operates inplace.

Resize this image using the specified filter algorithm. Returns a new image. The image's aspect ratio is preserved. The image is scaled to the maximum possible size that fits within the bounds specified by nwidth and nheight.

Resize this image using the specified filter algorithm. Returns a new image. Does not preserve aspect ratio. nwidth and nheight are the new image's dimensions

Scale this image down to fit within a specific size. Returns a new image. The image's aspect ratio is preserved. The image is scaled to the maximum possible size that fits within the bounds specified by nwidth and nheight.

This method uses a fast integer algorithm where each source pixel contributes to exactly one target pixel. May give aliasing artifacts if new size is close to old size.

Scale this image down to a specific size. Returns a new image. Does not preserve aspect ratio. nwidth and nheight are the new image's dimensions. This method uses a fast integer algorithm where each source pixel contributes to exactly one target pixel. May give aliasing artifacts if new size is close to old size.

Resize this image using the specified filter algorithm. Returns a new image. The image's aspect ratio is preserved. The image is scaled to the maximum possible size that fits within the larger (relative to aspect ratio) of the bounds specified by nwidth and nheight, then cropped to fit within the other bound.

Performs a Gaussian blur on this image. sigma is a measure of how much to blur by.

Performs an unsharpen mask on this image. sigma is the amount to blur the image by. threshold is a control of how much to sharpen.

See https://en.wikipedia.org/wiki/Unsharp_masking#Digital_unsharp_masking

Filters this image with the specified 3x3 kernel.

Adjust the contrast of this image. contrast is the amount to adjust the contrast by. Negative values decrease the contrast and positive values increase the contrast.

Brighten the pixels of this image. value is the amount to brighten each pixel by. Negative values decrease the brightness and positive values increase it.

Hue rotate the supplied image. value is the degrees to rotate each pixel by. 0 and 360 do nothing, the rest rotates by the given degree value. just like the css webkit filter hue-rotate(180)

Flip this image vertically

Flip this image horizontally

Rotate this image 90 degrees clockwise.

Rotate this image 180 degrees clockwise.

Rotate this image 270 degrees clockwise.

Encode this image and write it to w

Saves the buffer to a file at the path specified.

The image format is derived from the file extension.

Trait Implementations

impl GenericImageView for DynamicImage
[src]

The type of pixel.

Underlying image type. This is mainly used by SubImages in order to always have a reference to the original image. This allows for less indirections and it eases the use of nested SubImages. Read more

The width and height of this image.

The bounding rectangle of this image.

Returns the pixel located at (x, y) Read more

Returns a reference to the underlying image.

The width of this image.

The height of this image.

Returns true if this x, y coordinate is contained inside the image.

Returns the pixel located at (x, y) Read more

Important traits for Pixels<'a, I>

Returns an Iterator over the pixels of this image. The iterator yields the coordinates of each pixel along with their value Read more

Returns an subimage that is an immutable view into this image.

impl GenericImage for DynamicImage
[src]

Underlying image type. This is mainly used by SubImages in order to always have a reference to the original image. This allows for less indirections and it eases the use of nested SubImages. Read more

Put a pixel at location (x, y) Read more

DEPRECATED: Use iterator pixels_mut to blend the pixels directly.

DEPRECATED: Do not use is function: It is unimplemented!

Returns a mutable reference to the underlying image.

Puts a pixel at location (x, y) Read more

Important traits for MutPixels<'a, I>

Deprecated

: This cannot be implemented safely in Rust. Please use the image buffer directly.

Returns an Iterator over mutable pixels of this image. The iterator yields the coordinates of each pixel along with a mutable reference to them. Read more

Copies all of the pixels from another image into this image. Read more

Returns a subimage that is a view into this image.

impl Clone for DynamicImage
[src]

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Auto Trait Implementations

Blanket Implementations

impl<T, U> Into for T where
    U: From<T>, 
[src]

Performs the conversion.

impl<T> ToOwned for T where
    T: Clone
[src]

Creates owned data from borrowed data, usually by cloning. Read more

🔬 This is a nightly-only experimental API. (toowned_clone_into)

recently added

Uses borrowed data to replace owned data, usually by cloning. Read more

impl<T> From for T
[src]

Performs the conversion.

impl<T, U> TryFrom for T where
    T: From<U>, 
[src]

🔬 This is a nightly-only experimental API. (try_from)

The type returned in the event of a conversion error.

🔬 This is a nightly-only experimental API. (try_from)

Performs the conversion.

impl<T> Borrow for T where
    T: ?Sized
[src]

Immutably borrows from an owned value. Read more

impl<T> BorrowMut for T where
    T: ?Sized
[src]

Mutably borrows from an owned value. Read more

impl<T, U> TryInto for T where
    U: TryFrom<T>, 
[src]

🔬 This is a nightly-only experimental API. (try_from)

The type returned in the event of a conversion error.

🔬 This is a nightly-only experimental API. (try_from)

Performs the conversion.

impl<T> Any for T where
    T: 'static + ?Sized
[src]

🔬 This is a nightly-only experimental API. (get_type_id)

this method will likely be replaced by an associated static

Gets the TypeId of self. Read more

impl<T> SetParameter for T
[src]

Sets value as a parameter of self.