Struct img::PixelVal [] [src]

pub struct PixelVal<T>(pub T)
where
    T: Pixel
;

Newtype which wraps Pixel

This type should be used in all places where you are working with actual values. This is for example the case function definitions, parameters and return types. For all cases where you want a type bound of a parameter you should use Pixel.

Even though PixelVal does not implement Pixel itself, it derives all functions from it. Additional to that, all functions from PixelArithmetic are derived if it is supported. Therefore it is possible to work with PixelVal without accessing the newtype element.

Examples

use img::{ScalarVal, PixelVal, GrayVal8U};
let a = GrayVal8U::new(ScalarVal(21));
let b = GrayVal8U::new(ScalarVal(2));
let c = a * b;
assert_eq!(c.intensity(), ScalarVal(42));

Methods

impl<PixelP> PixelVal<PixelP> where
    PixelP: Pixel
[src]

Derive all functions from Pixel for PixelVal.

Trait Implementations

impl<T: Copy> Copy for PixelVal<T> where
    T: Pixel
[src]

impl<T: Clone> Clone for PixelVal<T> where
    T: Pixel
[src]

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

impl<T: Debug> Debug for PixelVal<T> where
    T: Pixel
[src]

Formats the value using the given formatter.

impl<T: PartialEq> PartialEq for PixelVal<T> where
    T: Pixel
[src]

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

impl<T> Add<PixelVal<T>> for PixelVal<T> where
    T: PixelArithmetic
[src]

Derive std operator for this newtype. This will forward all calls to the inner type.

On the inner type the corresponding function of PixelArithmetic is called.

The resulting type after applying the + operator

The method for the + operator

impl<T> Sub<PixelVal<T>> for PixelVal<T> where
    T: PixelArithmetic
[src]

Derive std operator for this newtype. This will forward all calls to the inner type.

On the inner type the corresponding function of PixelArithmetic is called.

The resulting type after applying the - operator

The method for the - operator

impl<T> Mul<PixelVal<T>> for PixelVal<T> where
    T: PixelArithmetic
[src]

Derive std operator for this newtype. This will forward all calls to the inner type.

On the inner type the corresponding function of PixelArithmetic is called.

The resulting type after applying the * operator

The method for the * operator

impl<T> Div<PixelVal<T>> for PixelVal<T> where
    T: PixelArithmetic
[src]

Derive std operator for this newtype. This will forward all calls to the inner type.

On the inner type the corresponding function of PixelArithmetic is called.

The resulting type after applying the / operator

The method for the / operator

impl<T> Add<ScalarVal<T::ScalarT>> for PixelVal<T> where
    T: PixelArithmetic
[src]

Derive std operator for this newtype. This will forward all calls to the inner type.

On the inner type the corresponding function of PixelArithmetic is called.

The resulting type after applying the + operator

The method for the + operator

impl<T> Sub<ScalarVal<T::ScalarT>> for PixelVal<T> where
    T: PixelArithmetic
[src]

Derive std operator for this newtype. This will forward all calls to the inner type.

On the inner type the corresponding function of PixelArithmetic is called.

The resulting type after applying the - operator

The method for the - operator

impl<T> Mul<ScalarVal<T::ScalarT>> for PixelVal<T> where
    T: PixelArithmetic
[src]

Derive std operator for this newtype. This will forward all calls to the inner type.

On the inner type the corresponding function of PixelArithmetic is called.

The resulting type after applying the * operator

The method for the * operator

impl<T> Div<ScalarVal<T::ScalarT>> for PixelVal<T> where
    T: PixelArithmetic
[src]

Derive std operator for this newtype. This will forward all calls to the inner type.

On the inner type the corresponding function of PixelArithmetic is called.

The resulting type after applying the / operator

The method for the / operator

impl<T> AddAssign<PixelVal<T>> for PixelVal<T> where
    T: PixelArithmetic
[src]

Derive std operator for this newtype. This will forward all calls to the inner type.

On the inner type the corresponding function of PixelArithmetic is called.

The method for the += operator

impl<T> AddAssign<ScalarVal<T::ScalarT>> for PixelVal<T> where
    T: PixelArithmetic
[src]

Derive std operator for this newtype. This will forward all calls to the inner type.

On the inner type the corresponding function of PixelArithmetic is called.

The method for the += operator

impl<T> SubAssign<PixelVal<T>> for PixelVal<T> where
    T: PixelArithmetic
[src]

Derive std operator for this newtype. This will forward all calls to the inner type.

On the inner type the corresponding function of PixelArithmetic is called.

The method for the -= operator

impl<T> SubAssign<ScalarVal<T::ScalarT>> for PixelVal<T> where
    T: PixelArithmetic
[src]

Derive std operator for this newtype. This will forward all calls to the inner type.

On the inner type the corresponding function of PixelArithmetic is called.

The method for the -= operator

impl<T> MulAssign<PixelVal<T>> for PixelVal<T> where
    T: PixelArithmetic
[src]

Derive std operator for this newtype. This will forward all calls to the inner type.

On the inner type the corresponding function of PixelArithmetic is called.

The method for the *= operator

impl<T> MulAssign<ScalarVal<T::ScalarT>> for PixelVal<T> where
    T: PixelArithmetic
[src]

Derive std operator for this newtype. This will forward all calls to the inner type.

On the inner type the corresponding function of PixelArithmetic is called.

The method for the *= operator

impl<T> DivAssign<PixelVal<T>> for PixelVal<T> where
    T: PixelArithmetic
[src]

Derive std operator for this newtype. This will forward all calls to the inner type.

On the inner type the corresponding function of PixelArithmetic is called.

The method for the /= operator

impl<T> DivAssign<ScalarVal<T::ScalarT>> for PixelVal<T> where
    T: PixelArithmetic
[src]

Derive std operator for this newtype. This will forward all calls to the inner type.

On the inner type the corresponding function of PixelArithmetic is called.

The method for the /= operator

impl<'a, ImageT> Add<&'a ImageVal<ImageT>> for PixelVal<ImageT::PixelT> where
    ImageT: Image,
    ImageT::PixelT: PixelArithmetic
[src]

TODO: Impl documentation

The resulting type after applying the + operator

The method for the + operator

impl<'a, ImageT> Sub<&'a ImageVal<ImageT>> for PixelVal<ImageT::PixelT> where
    ImageT: Image,
    ImageT::PixelT: PixelArithmetic
[src]

TODO: Impl documentation

The resulting type after applying the - operator

The method for the - operator

impl<'a, ImageT> Mul<&'a ImageVal<ImageT>> for PixelVal<ImageT::PixelT> where
    ImageT: Image,
    ImageT::PixelT: PixelArithmetic
[src]

TODO: Impl documentation

The resulting type after applying the * operator

The method for the * operator

impl<'a, ImageT> Div<&'a ImageVal<ImageT>> for PixelVal<ImageT::PixelT> where
    ImageT: Image,
    ImageT::PixelT: PixelArithmetic
[src]

TODO: Impl documentation

The resulting type after applying the / operator

The method for the / operator