logo
pub enum NormalForm {
    Unaliased,
    PixelPacked,
    ImagePacked,
    RowMajorPacked,
    ColumnMajorPacked,
}
Expand description

Different normal forms of buffers.

A normal form is an unaliased buffer with some additional constraints. The ÌmageBuffer uses row major form with packed samples.

Variants

Unaliased

No pixel aliases another.

Unaliased also guarantees that all index calculations in the image bounds using dim_index*dim_stride (such as x*width_stride + y*height_stride) do not overflow.

PixelPacked

At least pixels are packed.

Images of these types can wrap [T]-slices into the standard color types. This is a precondition for GenericImage which requires by-reference access to pixels.

ImagePacked

All samples are packed.

This is orthogonal to PixelPacked. It requires that there are no holes in the image but it is not necessary that the pixel samples themselves are adjacent. An example of this behaviour is a planar image layout.

RowMajorPacked

The samples are in row-major form and all samples are packed.

In addition to PixelPacked and ImagePacked this also asserts that the pixel matrix is in row-major form.

ColumnMajorPacked

The samples are in column-major form and all samples are packed.

In addition to PixelPacked and ImagePacked this also asserts that the pixel matrix is in column-major form.

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

Feeds this value into the given Hasher. Read more

Feeds a slice of this type into the given Hasher. Read more

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

This method tests for !=.

Compares the logical preconditions.

a < b if the normal form a has less preconditions than b.

This method tests less than (for self and other) and is used by the < operator. Read more

This method tests less than or equal to (for self and other) and is used by the <= operator. Read more

This method tests greater than (for self and other) and is used by the > operator. Read more

This method tests greater than or equal to (for self and other) and is used by the >= operator. Read more

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

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

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

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.

Performs the conversion.