Skip to main content

ImageData

Trait ImageData 

Source
pub unsafe trait ImageData: Copy + Default {
    type STORAGE: Copy;

    const TYPE: ImageType;

    // Required methods
    fn getter(    ) -> unsafe extern "C" fn(MImage, *mut mint, mint, *mut Self) -> c_int;
    fn setter() -> unsafe extern "C" fn(MImage, *mut mint, mint, Self) -> c_int;
}
Expand description

Trait implemented for types that can logically be stored in an Image.

The STORAGE associated type represents the data that is physically stored in the Image buffer.

The following logical types can be used in an image:

§Safety

This trait is already implemented for all types that can legally be stored in an Image. Implementing this trait for other types may lead to undefined behavior.

Required Associated Constants§

Source

const TYPE: ImageType

The ImageType variant represented by Self.

Required Associated Types§

Source

type STORAGE: Copy

The type of the data that is physically stored in the Image buffer.

In practice, this type is equal to Self for every logicaly type except bool, which represents a bitmapped image that logically stores a single bit of boolean data, but physically allocate one byte for each pixel/channel.

Required Methods§

Source

fn getter() -> unsafe extern "C" fn(MImage, *mut mint, mint, *mut Self) -> c_int

Source

fn setter() -> unsafe extern "C" fn(MImage, *mut mint, mint, Self) -> c_int

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementations on Foreign Types§

Source§

impl ImageData for bool

Source§

const TYPE: ImageType = ImageType::Bit

Source§

type STORAGE = i8

Source§

fn getter() -> unsafe extern "C" fn(MImage, *mut mint, mint, *mut Self) -> c_int

Source§

fn setter() -> unsafe extern "C" fn(MImage, *mut mint, mint, Self) -> c_int

Source§

impl ImageData for f32

Source§

const TYPE: ImageType = ImageType::Real32

Source§

type STORAGE = f32

Source§

fn getter() -> unsafe extern "C" fn(MImage, *mut mint, mint, *mut Self) -> c_int

Source§

fn setter() -> unsafe extern "C" fn(MImage, *mut mint, mint, Self) -> c_int

Source§

impl ImageData for f64

Source§

const TYPE: ImageType = ImageType::Real64

Source§

type STORAGE = f64

Source§

fn getter() -> unsafe extern "C" fn(MImage, *mut mint, mint, *mut Self) -> c_int

Source§

fn setter() -> unsafe extern "C" fn(MImage, *mut mint, mint, Self) -> c_int

Source§

impl ImageData for u8

Source§

const TYPE: ImageType = ImageType::Bit8

Source§

type STORAGE = u8

Source§

fn getter() -> unsafe extern "C" fn(MImage, *mut mint, mint, *mut Self) -> c_int

Source§

fn setter() -> unsafe extern "C" fn(MImage, *mut mint, mint, Self) -> c_int

Source§

impl ImageData for u16

Source§

const TYPE: ImageType = ImageType::Bit16

Source§

type STORAGE = u16

Source§

fn getter() -> unsafe extern "C" fn(MImage, *mut mint, mint, *mut Self) -> c_int

Source§

fn setter() -> unsafe extern "C" fn(MImage, *mut mint, mint, Self) -> c_int

Implementors§