imageproc::integral_image

Trait ArrayData

Source
pub trait ArrayData {
    type DataType;

    // Required methods
    fn data(&self) -> Self::DataType;
    fn add(lhs: Self::DataType, other: Self::DataType) -> Self::DataType;
    fn sub(lhs: Self::DataType, other: Self::DataType) -> Self::DataType;
}
Expand description

Hack to get around lack of const generics. See comment on sum_image_pixels.

Required Associated Types§

Source

type DataType

The type of the data for this array. e.g. [T; 1] for Luma, [T; 3] for Rgb.

Required Methods§

Source

fn data(&self) -> Self::DataType

Get the data from this pixel as a constant length array.

Source

fn add(lhs: Self::DataType, other: Self::DataType) -> Self::DataType

Add the elements of two data arrays elementwise.

Source

fn sub(lhs: Self::DataType, other: Self::DataType) -> Self::DataType

Subtract the elements of two data arrays elementwise.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementations on Foreign Types§

Source§

impl<T> ArrayData for Rgb<T>
where Rgb<T>: Pixel<Subpixel = T>, T: Primitive,

Source§

type DataType = [T; 3]

Source§

fn data(&self) -> Self::DataType

Source§

fn add(lhs: Self::DataType, rhs: Self::DataType) -> Self::DataType

Source§

fn sub(lhs: Self::DataType, rhs: Self::DataType) -> Self::DataType

Source§

impl<T> ArrayData for Rgba<T>
where Rgba<T>: Pixel<Subpixel = T>, T: Primitive,

Source§

type DataType = [T; 4]

Source§

fn data(&self) -> Self::DataType

Source§

fn add(lhs: Self::DataType, rhs: Self::DataType) -> Self::DataType

Source§

fn sub(lhs: Self::DataType, rhs: Self::DataType) -> Self::DataType

Source§

impl<T: Primitive> ArrayData for Luma<T>

Source§

type DataType = [T; 1]

Source§

fn data(&self) -> Self::DataType

Source§

fn add(lhs: Self::DataType, rhs: Self::DataType) -> Self::DataType

Source§

fn sub(lhs: Self::DataType, rhs: Self::DataType) -> Self::DataType

Implementors§