Struct image2::Image[][src]

pub struct Image<T: Type, C: Color> {
    pub meta: Meta<T, C>,
    pub data: Box<[T]>,
}
Expand description

Image type

Fields

meta: Meta<T, C>

Metadata

data: Box<[T]>

Pixel data

Implementations

Get image hash

Create a new image with the given size and data

Safety

This is marked as unsafe because it does not check to ensure the data passed in matches the dimensions

Create a new image

Create a new image with the same size, type and color

Create a new image with the same size and color as an existing image with the given type

Create a new image with the same size and type as an existing image with the given color

Create a new image with the same size as an existing image with the given type and color

Returns the number of channels

Get image meta

Image width

Image height

Returns (width, height, channels)

Get image size

Convert image data into byte vec

Copy image data into new byte vec

Get image data as bytes

Get image data as mutable bytes

Get data at specified index

Get mutable data at specified index

Set data to specified location

Returns true when (x, y) is in bounds for the given image

Get image data from an image, reusing an existing data buffer big enough for a single pixel

Load data from and Image into an existing Pixel structure

Get an empty pixel for the image color type

Get a normalized pixel from an image

Set a normalized pixel to the specified location

Get a normalized float value

Set normalized float value

Get row

Get mutable row

Iterate over image rows

Iterate over mutable image rows

Iterate over image rows

Iterate over mutable image rows

Read an image from disk

Write an image to disk

Iterate over part of an image with mutable data access

Iterate over part of an image

Get pixel iterator

Get mutable pixel iterator

Iterate over each pixel applying f to every pixel

Iterate over a region of pixels qpplying f to every pixel

Iterate over each pixel of two images at once

Iterate over pixels, with a mutable closure

Iterate over pixels in region, with a mutable closure

Iterate over mutable pixels, with a mutable closure

Iterate over mutable pixels in region, with a mutable closure

Copy a region of an image to a new image

Copy into a region from another image starting at the given offset

Apply a filter using an Image as output

Apply an async filter using an Image as output

Run a filter using the same Image as input and output

Run a filter using an Image as input

Run an async filter using an Image as input

Convert image type/color

Convert image type/color

Get image histogram

Convert to log RGB

Convert to linear RGB

Resize an image

Scale an image

Use the image as a mutable halide_buffer_t

Use the image as a mutable halide_buffer_t

Trait Implementations

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

Deserialize this value from the given Serde deserializer. Read more

The returned type after indexing.

Performs the indexing (container[index]) operation. Read more

Performs the mutable indexing (container[index]) operation. Read more

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

Serialize this value into the given Serde serializer. Read more

OpenGL color

OpenGL type

Get metadata

Get data buffer

Convert to texture

OpenGL color

OpenGL type

Get metadata

Get data buffer

Convert to texture

OpenGL color

OpenGL type

Get metadata

Get data buffer

Convert to texture

OpenGL color

OpenGL type

Get metadata

Get data buffer

Convert to texture

OpenGL color

OpenGL type

Get metadata

Get data buffer

Convert to texture

OpenGL color

OpenGL type

Get metadata

Get data buffer

Convert to texture

OpenGL color

OpenGL type

Get metadata

Get data buffer

Convert to texture

OpenGL color

OpenGL type

Get metadata

Get data buffer

Convert to texture

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Performs the conversion.

The alignment of pointer.

The type for initializers.

Initializes a with the given initializer. Read more

Dereferences the given pointer. Read more

Mutably dereferences the given pointer. Read more

Drops the object pointed to by the given pointer. Read more

The resulting type after obtaining ownership.

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

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.