Trait nannou::image::imageops::ColorMap[][src]

pub trait ColorMap {
    type Color;
    pub fn index_of(&self, color: &Self::Color) -> usize;
pub fn map_color(&self, color: &mut Self::Color); pub fn lookup(&self, index: usize) -> Option<Self::Color> { ... }
pub fn has_lookup(&self) -> bool { ... } }

A color map

Associated Types

type Color[src]

The color type on which the map operates on

Loading content...

Required methods

pub fn index_of(&self, color: &Self::Color) -> usize[src]

Returns the index of the closest match of color in the color map.

pub fn map_color(&self, color: &mut Self::Color)[src]

Maps color to the closest color in the color map.

Loading content...

Provided methods

pub fn lookup(&self, index: usize) -> Option<Self::Color>[src]

Looks up color by index in the color map. If idx is out of range for the color map, or ColorMap doesn’t implement lookup None is returned.

pub fn has_lookup(&self) -> bool[src]

Determine if this implementation of ColorMap overrides the default lookup.

Loading content...

Implementations on Foreign Types

impl ColorMap for NeuQuant[src]

type Color = Rgba<u8>

pub fn has_lookup(&self) -> bool[src]

Indicate NeuQuant implements lookup.

Loading content...

Implementors

impl ColorMap for nannou::image::math::nq::NeuQuant[src]

type Color = Rgba<u8>

pub fn has_lookup(&self) -> bool[src]

Indicate NeuQuant implements lookup.

impl ColorMap for BiLevel[src]

type Color = Luma<u8>

pub fn has_lookup(&self) -> bool[src]

Indicate NeuQuant implements lookup.

Loading content...