[][src]Macro ffimage::create_pixel

macro_rules! create_pixel {
    ($name:ident, $channels:expr, #[$doc:meta]) => { ... };
}

Create a new pixel type

A pixel is defined by its number of channels and the storage type (which is the same for each channel). The memory layout is C compatible by default and the Debug, Copy and Clone traits are derived. The Pixel trait is implemented automatically providing the basic building blocks for higher level structures such as image view and buffer types.

Example

use std::array;
use std::convert::{From, TryFrom};
use std::ops::{Index, IndexMut};

use ffimage::{create_pixel, define_pixel, impl_Pixel};
use ffimage::core::traits::{Pixel, StorageType};

create_pixel!(Rgb, 3, #[doc = "RGB pixel"]);