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]
T: Scalar,
impl<T: Clone> Clone for ScalarVal<T> where
T: Scalar,
[src]
T: Scalar,
fn clone(&self) -> ScalarVal<T>
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0
Performs copy-assignment from source
. Read more
impl<T: Debug> Debug for ScalarVal<T> where
T: Scalar,
[src]
T: Scalar,
impl<T: PartialEq> PartialEq for ScalarVal<T> where
T: Scalar,
[src]
T: Scalar,
fn eq(&self, __arg_0: &ScalarVal<T>) -> bool
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, __arg_0: &ScalarVal<T>) -> bool
This method tests for !=
.
impl<T> Add for ScalarVal<T> where
T: Scalar,
[src]
T: Scalar,
Derive std operator for this newtype. This will forward all calls to the inner type.
type Output = ScalarVal<<T as Add>::Output>
The resulting type after applying the +
operator
fn add(self, rhs: Self) -> Self::Output
The method for the +
operator
impl<T> Sub for ScalarVal<T> where
T: Scalar,
[src]
T: Scalar,
Derive std operator for this newtype. This will forward all calls to the inner type.
type Output = ScalarVal<<T as Sub>::Output>
The resulting type after applying the -
operator
fn sub(self, rhs: Self) -> Self::Output
The method for the -
operator
impl<T> Mul for ScalarVal<T> where
T: Scalar,
[src]
T: Scalar,
Derive std operator for this newtype. This will forward all calls to the inner type.
type Output = ScalarVal<<T as Mul>::Output>
The resulting type after applying the *
operator
fn mul(self, rhs: Self) -> Self::Output
The method for the *
operator
impl<T> Div for ScalarVal<T> where
T: Scalar,
[src]
T: Scalar,
Derive std operator for this newtype. This will forward all calls to the inner type.
type Output = ScalarVal<<T as Div>::Output>
The resulting type after applying the /
operator
fn div(self, rhs: Self) -> Self::Output
The method for the /
operator
impl<T> AddAssign for ScalarVal<T> where
T: Scalar,
[src]
T: Scalar,
Derive std operator for this newtype. This will forward all calls to the inner type.
fn add_assign(&mut self, rhs: Self)
The method for the +=
operator
impl<T> SubAssign for ScalarVal<T> where
T: Scalar,
[src]
T: Scalar,
Derive std operator for this newtype. This will forward all calls to the inner type.
fn sub_assign(&mut self, rhs: Self)
The method for the -=
operator
impl<T> MulAssign for ScalarVal<T> where
T: Scalar,
[src]
T: Scalar,
Derive std operator for this newtype. This will forward all calls to the inner type.
fn mul_assign(&mut self, rhs: Self)
The method for the *=
operator
impl<T> DivAssign for ScalarVal<T> where
T: Scalar,
[src]
T: Scalar,
Derive std operator for this newtype. This will forward all calls to the inner type.
fn div_assign(&mut self, rhs: Self)
The method for the /=
operator
impl<T> Add<PixelVal<T>> for ScalarVal<T::ScalarT> where
T: PixelArithmetic,
[src]
T: PixelArithmetic,
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.
type Output = PixelVal<T>
The resulting type after applying the +
operator
fn add(self, rhs: PixelVal<T>) -> Self::Output
The method for the +
operator
impl<T> Sub<PixelVal<T>> for ScalarVal<T::ScalarT> where
T: PixelArithmetic,
[src]
T: PixelArithmetic,
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.
type Output = PixelVal<T>
The resulting type after applying the -
operator
fn sub(self, rhs: PixelVal<T>) -> Self::Output
The method for the -
operator
impl<T> Mul<PixelVal<T>> for ScalarVal<T::ScalarT> where
T: PixelArithmetic,
[src]
T: PixelArithmetic,
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.
type Output = PixelVal<T>
The resulting type after applying the *
operator
fn mul(self, rhs: PixelVal<T>) -> Self::Output
The method for the *
operator
impl<T> Div<PixelVal<T>> for ScalarVal<T::ScalarT> where
T: PixelArithmetic,
[src]
T: PixelArithmetic,
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.
type Output = PixelVal<T>
The resulting type after applying the /
operator
fn div(self, rhs: PixelVal<T>) -> Self::Output
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]
ImageT: Image,
ImageT::PixelT: PixelArithmetic,
TODO: Impl documentation
type Output = ImageBufferVal<ImageT::PixelT>
The resulting type after applying the +
operator
fn add(self, rhs: &'a ImageVal<ImageT>) -> Self::Output
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]
ImageT: Image,
ImageT::PixelT: PixelArithmetic,
TODO: Impl documentation
type Output = ImageBufferVal<ImageT::PixelT>
The resulting type after applying the -
operator
fn sub(self, rhs: &'a ImageVal<ImageT>) -> Self::Output
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]
ImageT: Image,
ImageT::PixelT: PixelArithmetic,
TODO: Impl documentation
type Output = ImageBufferVal<ImageT::PixelT>
The resulting type after applying the *
operator
fn mul(self, rhs: &'a ImageVal<ImageT>) -> Self::Output
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]
ImageT: Image,
ImageT::PixelT: PixelArithmetic,
TODO: Impl documentation