Enum NormalForm

enum NormalForm

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.

Implementations

impl Clone for NormalForm

fn clone(self: &Self) -> NormalForm

impl Copy for NormalForm

impl Debug for NormalForm

fn fmt(self: &Self, f: &mut $crate::fmt::Formatter<'_>) -> $crate::fmt::Result

impl Eq for NormalForm

impl Freeze for NormalForm

impl Hash for NormalForm

fn hash<__H: $crate::hash::Hasher>(self: &Self, state: &mut __H)

impl PartialEq for NormalForm

fn eq(self: &Self, other: &NormalForm) -> bool

impl PartialOrd for NormalForm

fn partial_cmp(self: &Self, other: &Self) -> Option<cmp::Ordering>

Compares the logical preconditions.

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

impl RefUnwindSafe for NormalForm

impl Send for NormalForm

impl StructuralPartialEq for NormalForm

impl Sync for NormalForm

impl Unpin for NormalForm

impl UnwindSafe for NormalForm

impl<T> Any for NormalForm

fn type_id(self: &Self) -> TypeId

impl<T> Borrow for NormalForm

fn borrow(self: &Self) -> &T

impl<T> BorrowMut for NormalForm

fn borrow_mut(self: &mut Self) -> &mut T

impl<T> CloneToUninit for NormalForm

unsafe fn clone_to_uninit(self: &Self, dest: *mut u8)

impl<T> From for NormalForm

fn from(t: T) -> T

Returns the argument unchanged.

impl<T> Pointable for NormalForm

unsafe fn init(init: <T as Pointable>::Init) -> usize
unsafe fn deref<'a>(ptr: usize) -> &'a T
unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T
unsafe fn drop(ptr: usize)

impl<T> ToOwned for NormalForm

fn to_owned(self: &Self) -> T
fn clone_into(self: &Self, target: &mut T)

impl<T, U> Into for NormalForm

fn into(self: Self) -> U

Calls U::from(self).

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

impl<T, U> TryFrom for NormalForm

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

impl<T, U> TryInto for NormalForm

fn try_into(self: Self) -> Result<U, <U as TryFrom<T>>::Error>