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]
PixelP: Pixel,
Derive all functions from Pixel
for PixelVal
.
fn calc_minimum_pitch(width: u32, height: u32) -> usize
fn calc_size_in_bytes(width: u32, height: u32, pitch: u32) -> Option<usize>
fn load_from_raw_buffer(x: u32, y: u32, pitch: u32, buffer: &[u8]) -> Self
fn write_into_raw_buffer(&self, x: u32, y: u32, pitch: u32, buffer: &mut [u8])
Trait Implementations
impl<T: Copy> Copy for PixelVal<T> where
T: Pixel,
[src]
T: Pixel,
impl<T: Clone> Clone for PixelVal<T> where
T: Pixel,
[src]
T: Pixel,
fn clone(&self) -> PixelVal<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 PixelVal<T> where
T: Pixel,
[src]
T: Pixel,
impl<T: PartialEq> PartialEq for PixelVal<T> where
T: Pixel,
[src]
T: Pixel,
fn eq(&self, __arg_0: &PixelVal<T>) -> bool
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, __arg_0: &PixelVal<T>) -> bool
This method tests for !=
.
impl<T> Add<PixelVal<T>> for PixelVal<T> 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: Self) -> Self
The method for the +
operator
impl<T> Sub<PixelVal<T>> for PixelVal<T> 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: Self) -> Self
The method for the -
operator
impl<T> Mul<PixelVal<T>> for PixelVal<T> 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: Self) -> Self
The method for the *
operator
impl<T> Div<PixelVal<T>> for PixelVal<T> 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: Self) -> Self
The method for the /
operator
impl<T> Add<ScalarVal<T::ScalarT>> for PixelVal<T> 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: ScalarVal<T::ScalarT>) -> Self::Output
The method for the +
operator
impl<T> Sub<ScalarVal<T::ScalarT>> for PixelVal<T> 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: ScalarVal<T::ScalarT>) -> Self::Output
The method for the -
operator
impl<T> Mul<ScalarVal<T::ScalarT>> for PixelVal<T> 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: ScalarVal<T::ScalarT>) -> Self::Output
The method for the *
operator
impl<T> Div<ScalarVal<T::ScalarT>> for PixelVal<T> 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: ScalarVal<T::ScalarT>) -> Self::Output
The method for the /
operator
impl<T> AddAssign<PixelVal<T>> for PixelVal<T> 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.
fn add_assign(&mut self, rhs: PixelVal<T>)
The method for the +=
operator
impl<T> AddAssign<ScalarVal<T::ScalarT>> for PixelVal<T> 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.
fn add_assign(&mut self, rhs: ScalarVal<T::ScalarT>)
The method for the +=
operator
impl<T> SubAssign<PixelVal<T>> for PixelVal<T> 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.
fn sub_assign(&mut self, rhs: PixelVal<T>)
The method for the -=
operator
impl<T> SubAssign<ScalarVal<T::ScalarT>> for PixelVal<T> 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.
fn sub_assign(&mut self, rhs: ScalarVal<T::ScalarT>)
The method for the -=
operator
impl<T> MulAssign<PixelVal<T>> for PixelVal<T> 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.
fn mul_assign(&mut self, rhs: PixelVal<T>)
The method for the *=
operator
impl<T> MulAssign<ScalarVal<T::ScalarT>> for PixelVal<T> 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.
fn mul_assign(&mut self, rhs: ScalarVal<T::ScalarT>)
The method for the *=
operator
impl<T> DivAssign<PixelVal<T>> for PixelVal<T> 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.
fn div_assign(&mut self, rhs: PixelVal<T>)
The method for the /=
operator
impl<T> DivAssign<ScalarVal<T::ScalarT>> for PixelVal<T> 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.
fn div_assign(&mut self, rhs: ScalarVal<T::ScalarT>)
The method for the /=
operator
impl<'a, ImageT> Add<&'a ImageVal<ImageT>> for PixelVal<ImageT::PixelT> 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 PixelVal<ImageT::PixelT> 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 PixelVal<ImageT::PixelT> 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 PixelVal<ImageT::PixelT> where
ImageT: Image,
ImageT::PixelT: PixelArithmetic,
[src]
ImageT: Image,
ImageT::PixelT: PixelArithmetic,
TODO: Impl documentation