Struct img::ScalarVal [] [src]

pub struct ScalarVal<T>(pub T)
where
    T: Scalar
;

Newtype which wraps Scalar

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 Scalar.

Even though ScalarVal does not implement Scalar itself, it derives all functions from it. Therefore it is possible to work with ScalarVal without accessing the newtype element.

Examples

use img::ScalarVal;
let a = ScalarVal(21u8);
let b = ScalarVal(2u8);
let c = a * b;
assert_eq!(c, ScalarVal(42));

Trait Implementations

impl<T: Copy> Copy for ScalarVal<T> where
    T: Scalar
[src]

impl<T: Clone> Clone for ScalarVal<T> where
    T: Scalar
[src]

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

impl<T: Debug> Debug for ScalarVal<T> where
    T: Scalar
[src]

Formats the value using the given formatter.

impl<T: PartialEq> PartialEq for ScalarVal<T> where
    T: Scalar
[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 for ScalarVal<T> where
    T: Scalar
[src]

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

The resulting type after applying the + operator

The method for the + operator

impl<T> Sub for ScalarVal<T> where
    T: Scalar
[src]

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

The resulting type after applying the - operator

The method for the - operator

impl<T> Mul for ScalarVal<T> where
    T: Scalar
[src]

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

The resulting type after applying the * operator

The method for the * operator

impl<T> Div for ScalarVal<T> where
    T: Scalar
[src]

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

The resulting type after applying the / operator

The method for the / operator

impl<T> AddAssign for ScalarVal<T> where
    T: Scalar
[src]

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

The method for the += operator

impl<T> SubAssign for ScalarVal<T> where
    T: Scalar
[src]

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

The method for the -= operator

impl<T> MulAssign for ScalarVal<T> where
    T: Scalar
[src]

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

The method for the *= operator

impl<T> DivAssign for ScalarVal<T> where
    T: Scalar
[src]

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

The method for the /= operator

impl<T> Add<PixelVal<T>> for ScalarVal<T::ScalarT> 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 ScalarVal<T::ScalarT> 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 ScalarVal<T::ScalarT> 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 ScalarVal<T::ScalarT> 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<'a, ImageT> Add<&'a ImageVal<ImageT>> for ScalarVal<<ImageT::PixelT as PixelArithmetic>::ScalarT> 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 ScalarVal<<ImageT::PixelT as PixelArithmetic>::ScalarT> 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 ScalarVal<<ImageT::PixelT as PixelArithmetic>::ScalarT> 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 ScalarVal<<ImageT::PixelT as PixelArithmetic>::ScalarT> where
    ImageT: Image,
    ImageT::PixelT: PixelArithmetic
[src]

TODO: Impl documentation

The resulting type after applying the / operator

The method for the / operator