[−][src]Struct vek::vec::repr_c::rgb::Rgb
Vector type suited for RGB color data.
There is no trait bound on ColorComponent
, but if T
doesn't implement it, you'll
miss some goodies.
Fields
r: T
g: T
b: T
Methods
impl<T> Rgb<T>
[src]
impl<T> Rgb<T>
impl<T> Rgb<T>
[src]
impl<T> Rgb<T>
pub fn broadcast(val: T) -> Self where | [src] |
Broadcasts a single value to all elements of a new vector.
This function is also named splat()
in some libraries, or
set1()
in Intel intrinsics.
"Broadcast" was chosen as the name because it is explicit enough and is the same wording as the description in relevant Intel intrinsics.
assert_eq!(Vec4::broadcast(5), Vec4::new(5,5,5,5)); assert_eq!(Vec4::broadcast(5), Vec4::from(5));
pub fn zero() -> Self where | [src] |
Creates a new vector with all elements set to zero.
assert_eq!(Vec4::zero(), Vec4::new(0,0,0,0)); assert_eq!(Vec4::zero(), Vec4::broadcast(0)); assert_eq!(Vec4::zero(), Vec4::from(0));
pub fn one() -> Self where | [src] |
Creates a new vector with all elements set to one.
assert_eq!(Vec4::one(), Vec4::new(1,1,1,1)); assert_eq!(Vec4::one(), Vec4::broadcast(1)); assert_eq!(Vec4::one(), Vec4::from(1));
pub fn iota() -> Self where | [src] |
Produces a vector of the first n
integers, starting from zero,
where n
is the number of elements for this vector type.
The iota (ι) function, originating from APL.
See this StackOverflow answer.
This is mostly useful for debugging purposes and tests.
assert_eq!(Vec4::iota(), Vec4::new(0, 1, 2, 3));
pub const fn elem_count(&self) -> usize | [src] |
Convenience method which returns the number of elements of this vector.
let v = Vec4::new(0,1,2,3); assert_eq!(v.elem_count(), 4);
pub const ELEM_COUNT: usize
[src]
Convenience constant representing the number of elements for this vector type.
pub fn into_tuple(self) -> (T, T, T) | [src] |
Converts this into a tuple with the same number of elements by consuming.
pub fn into_array(self) -> [T; 3] | [src] |
Converts this vector into a fixed-size array.
pub fn as_slice(&self) -> &[T] | [src] |
View this vector as an immutable slice.
pub fn as_mut_slice(&mut self) -> &mut [T] | [src] |
View this vector as a mutable slice.
pub fn from_slice(slice: &[T]) -> Self where | [src] |
Collects the content of a slice into a new vector. Elements are initialized to their default values.
pub fn map<D, F>(self, f: F) -> Rgb<D> where | [src] |
Returns a memberwise-converted copy of this vector, using the given conversion closure.
let v = Vec4::new(0_f32, 1., 1.8, 3.14); let i = v.map(|x| x.round() as i32); assert_eq!(i, Vec4::new(0, 1, 2, 3));
Performing LERP on integer vectors by concisely converting them to floats:
let a = Vec4::new(0,1,2,3).map(|x| x as f32); let b = Vec4::new(2,3,4,5).map(|x| x as f32); let v = Vec4::lerp(a, b, 0.5_f32).map(|x| x.round() as i32); assert_eq!(v, Vec4::new(1,2,3,4));
pub fn map2<D, F, S>(self, other: Rgb<S>, f: F) -> Rgb<D> where | [src] |
Applies the function f to each element of two vectors, pairwise, and returns the result.
let a = Vec4::<u8>::new(255, 254, 253, 252); let b = Vec4::<u8>::new(1, 2, 3, 4); let v = a.map2(b, |a, b| a.wrapping_add(b)); assert_eq!(v, Vec4::zero()); let v = a.map2(b, u8::wrapping_add); assert_eq!(v, Vec4::zero());
pub fn apply<F>(&mut self, f: F) where | [src] |
Applies the function f to each element of this vector, in-place.
let mut v = Vec4::new(0_u32, 1, 2, 3); v.apply(|x| x.count_ones()); assert_eq!(v, Vec4::new(0, 1, 1, 2));
pub fn apply2<F, S>(&mut self, other: Rgb<S>, f: F) where | [src] |
Applies the function f to each element of two vectors, pairwise, in-place.
let mut a = Vec4::<u8>::new(255, 254, 253, 252); let b = Vec4::<u8>::new(1, 2, 3, 4); a.apply2(b, |a, b| a.wrapping_add(b)); assert_eq!(a, Vec4::zero()); a.apply2(b, u8::wrapping_add); assert_eq!(a, b);
pub fn numcast<D>(self) -> Option<Rgb<D>> where | [src] |
Returns a memberwise-converted copy of this vector, using NumCast
.
let v = Vec4::new(0_f32, 1., 2., 3.); let i: Vec4<i32> = v.numcast().unwrap(); assert_eq!(i, Vec4::new(0, 1, 2, 3));
pub fn mul_add<V: Into<Self>>(self, mul: V, add: V) -> Self where | [src] |
Fused multiply-add. Returns self * mul + add
, and may be implemented
efficiently by the hardware.
The compiler is often able to detect this kind of operation, so generally you don't need to use it. However, it can make your intent clear.
The name for this method is the one used by the same operation on primitive floating-point types.
let a = Vec4::new(0,1,2,3); let b = Vec4::new(4,5,6,7); let c = Vec4::new(8,9,0,1); assert_eq!(a*b+c, a.mul_add(b, c));
pub fn is_any_negative(&self) -> bool where | [src] |
Is any of the elements negative ?
This was intended for checking the validity of extent vectors, but can make sense for other types too.
pub fn are_all_positive(&self) -> bool where | [src] |
Are all of the elements positive ?
pub fn min<V>(a: V, b: V) -> Self where | [src] |
Compares elements of a
and b
, and returns the minimum values into a new
vector, using total ordering.
let a = Vec4::new(0,1,2,3); let b = Vec4::new(3,2,1,0); let m = Vec4::new(0,1,1,0); assert_eq!(m, Vec4::min(a, b));
pub fn max<V>(a: V, b: V) -> Self where | [src] |
Compares elements of a
and b
, and returns the maximum values into a new
vector, using total ordering.
let a = Vec4::new(0,1,2,3); let b = Vec4::new(3,2,1,0); let m = Vec4::new(3,2,2,3); assert_eq!(m, Vec4::max(a, b));
pub fn partial_min<V>(a: V, b: V) -> Self where | [src] |
Compares elements of a
and b
, and returns the minimum values into a new
vector, using partial ordering.
let a = Vec4::new(0,1,2,3); let b = Vec4::new(3,2,1,0); let m = Vec4::new(0,1,1,0); assert_eq!(m, Vec4::partial_min(a, b));
pub fn partial_max<V>(a: V, b: V) -> Self where | [src] |
Compares elements of a
and b
, and returns the minimum values into a new
vector, using partial ordering.
let a = Vec4::new(0,1,2,3); let b = Vec4::new(3,2,1,0); let m = Vec4::new(3,2,2,3); assert_eq!(m, Vec4::partial_max(a, b));
pub fn reduce_min(self) -> T where | [src] |
Returns the element which has the lowest value in this vector, using total ordering.
assert_eq!(-5, Vec4::new(0, 5, -5, 8).reduce_min());
pub fn reduce_max(self) -> T where | [src] |
Returns the element which has the highest value in this vector, using total ordering.
assert_eq!(8, Vec4::new(0, 5, -5, 8).reduce_max());
pub fn reduce_partial_min(self) -> T where | [src] |
Returns the element which has the lowest value in this vector, using partial ordering.
assert_eq!(-5_f32, Vec4::new(0_f32, 5., -5., 8.).reduce_partial_min());
pub fn reduce_partial_max(self) -> T where | [src] |
Returns the element which has the highest value in this vector, using partial ordering.
assert_eq!(8_f32, Vec4::new(0_f32, 5., -5., 8.).reduce_partial_max());
pub fn reduce_bitand(self) -> T where | [src] |
Returns the result of bitwise-AND (&
) on all elements of this vector.
assert_eq!(true, Vec4::new(true, true, true, true).reduce_bitand()); assert_eq!(false, Vec4::new(true, false, true, true).reduce_bitand()); assert_eq!(false, Vec4::new(true, true, true, false).reduce_bitand());
pub fn reduce_bitor(self) -> T where | [src] |
Returns the result of bitwise-OR (|
) on all elements of this vector.
assert_eq!(false, Vec4::new(false, false, false, false).reduce_bitor()); assert_eq!(true, Vec4::new(false, false, true, false).reduce_bitor());
pub fn reduce_bitxor(self) -> T where | [src] |
Returns the result of bitwise-XOR (^
) on all elements of this vector.
assert_eq!(false, Vec4::new(true, true, true, true).reduce_bitxor()); assert_eq!(true, Vec4::new(true, false, true, true).reduce_bitxor());
pub fn reduce<F>(self, f: F) -> T where | [src] |
Reduces this vector with the given accumulator closure.
pub fn product(self) -> T where | [src] |
Returns the product of each of this vector's elements.
assert_eq!(1*2*3*4, Vec4::new(1, 2, 3, 4).product());
pub fn sum(self) -> T where | [src] |
Returns the sum of each of this vector's elements.
assert_eq!(1+2+3+4, Vec4::new(1, 2, 3, 4).sum());
pub fn average(self) -> T where | [src] |
Returns the average of this vector's elements.
assert_eq!(2.5_f32, Vec4::new(1_f32, 2., 3., 4.).average());
You should avoid using it on u8
vectors, not only because integer
overflows cause panics in debug mode, but also because of integer division, the result
may not be the one you expect.
// This causes a panic! let red = Vec4::new(255u8, 1, 0, 0); let grey_level = red.average(); assert_eq!(grey_level, 128);
You may want to convert the elements to bigger integers (or floating-point) instead:
let red = Vec4::new(255u8, 1, 128, 128); let red = red.map(|c| c as u16); let grey_level = red.average() as u8; assert_eq!(grey_level, 128); let red = red.map(|c| c as f32); let grey_level = red.average().round() as u8; assert_eq!(grey_level, 128);
pub fn sqrt(self) -> Self where | [src] |
Returns a new vector which elements are the respective square roots of this vector's elements.
let v = Vec4::new(1f32, 2f32, 3f32, 4f32); let s = Vec4::new(1f32, 4f32, 9f32, 16f32); assert_eq!(v, s.sqrt());
pub fn rsqrt(self) -> Self where | [src] |
Returns a new vector which elements are the respective reciprocal square roots of this vector's elements.
let v = Vec4::new(1f32, 0.5f32, 1f32/3f32, 0.25f32); let s = Vec4::new(1f32, 4f32, 9f32, 16f32); assert_eq!(v, s.rsqrt());
pub fn recip(self) -> Self where | [src] |
Returns a new vector which elements are the respective reciprocal of this vector's elements.
let v = Vec4::new(1f32, 0.5f32, 0.25f32, 0.125f32); let s = Vec4::new(1f32, 2f32, 4f32, 8f32); assert_eq!(v, s.recip()); assert_eq!(s, v.recip());
pub fn ceil(self) -> Self where | [src] |
Returns a new vector which elements are rounded to the nearest greater integer.
let v = Vec4::new(0_f32, 1., 1.8, 3.14); assert_eq!(v.ceil(), Vec4::new(0f32, 1f32, 2f32, 4f32));
pub fn floor(self) -> Self where | [src] |
Returns a new vector which elements are rounded down to the nearest lower integer.
let v = Vec4::new(0_f32, 1., 1.8, 3.14); assert_eq!(v.floor(), Vec4::new(0f32, 1f32, 1f32, 3f32));
pub fn round(self) -> Self where | [src] |
Returns a new vector which elements are rounded to the nearest integer.
let v = Vec4::new(0_f32, 1., 1.8, 3.14); assert_eq!(v.round(), Vec4::new(0f32, 1f32, 2f32, 3f32));
pub fn hadd(self, rhs: Self) -> Self where | [src] |
Horizontally adds adjacent pairs of elements in self
and rhs
into a new vector.
let a = Vec4::new(0, 1, 2, 3); let b = Vec4::new(4, 5, 6, 7); let h = Vec4::new(0+1, 2+3, 4+5, 6+7); assert_eq!(h, a.hadd(b));
pub fn partial_cmpeq<Rhs: AsRef<Self>>(&self, rhs: &Rhs) -> Rgb<bool> where | [src] |
Compares each element of two vectors with the partial equality test, returning a boolean vector.
let u = Vec4::new(0,2,2,6); let v = Vec4::new(0,1,2,3); assert_eq!(u.partial_cmpeq(&v), Vec4::new(true, false, true, false));
pub fn partial_cmpne<Rhs: AsRef<Self>>(&self, rhs: &Rhs) -> Rgb<bool> where | [src] |
Compares each element of two vectors with the partial not-equal test, returning a boolean vector.
let u = Vec4::new(0,2,2,6); let v = Vec4::new(0,1,2,3); assert_eq!(u.partial_cmpne(&v), Vec4::new(false, true, false, true));
pub fn partial_cmpge<Rhs: AsRef<Self>>(&self, rhs: &Rhs) -> Rgb<bool> where | [src] |
Compares each element of two vectors with the partial greater-or-equal test, returning a boolean vector.
let u = Vec4::new(0,2,2,2); let v = Vec4::new(0,1,2,3); assert_eq!(u.partial_cmpge(&v), Vec4::new(true, true, true, false));
pub fn partial_cmpgt<Rhs: AsRef<Self>>(&self, rhs: &Rhs) -> Rgb<bool> where | [src] |
Compares each element of two vectors with the partial greater-than test, returning a boolean vector.
let u = Vec4::new(0,2,2,6); let v = Vec4::new(0,1,2,3); assert_eq!(u.partial_cmpgt(&v), Vec4::new(false, true, false, true));
pub fn partial_cmple<Rhs: AsRef<Self>>(&self, rhs: &Rhs) -> Rgb<bool> where | [src] |
Compares each element of two vectors with the partial less-or-equal test, returning a boolean vector.
let u = Vec4::new(0,2,2,2); let v = Vec4::new(0,1,2,3); assert_eq!(u.partial_cmple(&v), Vec4::new(true, false, true, true));
pub fn partial_cmplt<Rhs: AsRef<Self>>(&self, rhs: &Rhs) -> Rgb<bool> where | [src] |
Compares each element of two vectors with the partial less-than test, returning a boolean vector.
let u = Vec4::new(0,2,2,2); let v = Vec4::new(0,1,2,3); assert_eq!(u.partial_cmplt(&v), Vec4::new(false, false, false, true));
pub fn cmpeq<Rhs: AsRef<Self>>(&self, rhs: &Rhs) -> Rgb<bool> where | [src] |
Compares each element of two vectors with the partial equality test, returning a boolean vector.
let u = Vec4::new(0,2,2,6); let v = Vec4::new(0,1,2,3); assert_eq!(u.cmpeq(&v), Vec4::new(true, false, true, false));
pub fn cmpne<Rhs: AsRef<Self>>(&self, rhs: &Rhs) -> Rgb<bool> where | [src] |
Compares each element of two vectors with the total not-equal test, returning a boolean vector.
let u = Vec4::new(0,2,2,6); let v = Vec4::new(0,1,2,3); assert_eq!(u.cmpne(&v), Vec4::new(false, true, false, true));
pub fn cmpge<Rhs: AsRef<Self>>(&self, rhs: &Rhs) -> Rgb<bool> where | [src] |
Compares each element of two vectors with the total greater-or-equal test, returning a boolean vector.
let u = Vec4::new(0,2,2,2); let v = Vec4::new(0,1,2,3); assert_eq!(u.cmpge(&v), Vec4::new(true, true, true, false));
pub fn cmpgt<Rhs: AsRef<Self>>(&self, rhs: &Rhs) -> Rgb<bool> where | [src] |
Compares each element of two vectors with the total greater-than test, returning a boolean vector.
let u = Vec4::new(0,2,2,6); let v = Vec4::new(0,1,2,3); assert_eq!(u.cmpgt(&v), Vec4::new(false, true, false, true));
pub fn cmple<Rhs: AsRef<Self>>(&self, rhs: &Rhs) -> Rgb<bool> where | [src] |
Compares each element of two vectors with the total less-or-equal test, returning a boolean vector.
let u = Vec4::new(0,2,2,2); let v = Vec4::new(0,1,2,3); assert_eq!(u.cmple(&v), Vec4::new(true, false, true, true));
pub fn cmplt<Rhs: AsRef<Self>>(&self, rhs: &Rhs) -> Rgb<bool> where | [src] |
Compares each element of two vectors with the total less-than test, returning a boolean vector.
let u = Vec4::new(0,2,2,2); let v = Vec4::new(0,1,2,3); assert_eq!(u.cmplt(&v), Vec4::new(false, false, false, true));
pub fn lerp_unclamped_precise<S: Into<Self>>( | [src] |
Returns the linear interpolation of from
to to
with factor
unconstrained.
See the Lerp
trait.
pub fn lerp_unclamped<S: Into<Self>>(from: Self, to: Self, factor: S) -> Self where | [src] |
Same as lerp_unclamped_precise
, implemented as a possibly faster but less precise operation.
See the Lerp
trait.
pub fn lerp<S: Into<Self> + Clamp + Zero + One>( | [src] |
Returns the linear interpolation of from
to to
with factor
constrained to be
between 0 and 1.
See the Lerp
trait.
pub fn lerp_precise<S: Into<Self> + Clamp + Zero + One>( | [src] |
Returns the linear interpolation of from
to to
with factor
constrained to be
between 0 and 1.
See the Lerp
trait.
impl Rgb<bool>
[src]
impl Rgb<bool>
pub fn reduce_and(self) -> bool | [src] |
Returns the result of logical AND (&&
) on all elements of this vector.
assert_eq!(true, Vec4::new(true, true, true, true).reduce_and()); assert_eq!(false, Vec4::new(true, false, true, true).reduce_and()); assert_eq!(false, Vec4::new(true, true, true, false).reduce_and());
pub fn reduce_or(self) -> bool | [src] |
Returns the result of logical OR (||
) on all elements of this vector.
assert_eq!(false, Vec4::new(false, false, false, false).reduce_or()); assert_eq!(true, Vec4::new(false, false, true, false).reduce_or());
pub fn reduce_ne(self) -> bool | [src] |
Reduces this vector using total inequality.
assert_eq!(false, Vec4::new(true, true, true, true).reduce_ne()); assert_eq!(true, Vec4::new(true, false, true, true).reduce_ne());
impl<T: ColorComponent> Rgb<T>
[src]
impl<T: ColorComponent> Rgb<T>
pub fn black() -> Self | [src] |
pub fn white() -> Self | [src] |
pub fn red() -> Self | [src] |
pub fn green() -> Self | [src] |
pub fn blue() -> Self | [src] |
pub fn cyan() -> Self | [src] |
pub fn magenta() -> Self | [src] |
pub fn yellow() -> Self | [src] |
pub fn gray(value: T) -> Self where | [src] |
pub fn grey(value: T) -> Self where | [src] |
pub fn inverted_rgb(self) -> Self where | [src] |
Returns this color with RGB elements inverted.
let orange = Rgb::new(255_u8, 128, 0); assert_eq!(orange.inverted_rgb(), Rgb::new(0, 127, 255)); assert_eq!(Rgb::<u8>::black().inverted_rgb(), Rgb::white()); assert_eq!(Rgb::<u8>::white().inverted_rgb(), Rgb::black()); assert_eq!(Rgb::<u8>::red().inverted_rgb(), Rgb::cyan());
pub fn average_rgb(self) -> T where | [src] |
Returns the average of this vector's RGB elements.
For Rgb
, this is the same as average
, and is provided for compatibility
with Rgba
.
Be careful when calling this on integer vectors. See the average()
method
of vectors for a discussion and example.
impl<T> Rgb<T>
[src]
impl<T> Rgb<T>
pub fn shuffled_bgr(self) -> Self | [src] |
Returns this vector with R and B elements swapped.
impl<T> CVec<T>
[src]
impl<T> CVec<T>
pub fn into_repr_simd(self) -> Rgb<T> | [src] |
Converts this vector into its #[repr(simd)]
counterpart.
Trait Implementations
impl<T: IsBetween<Output = bool> + Copy> IsBetween<T> for Rgb<T>
[src]
impl<T: IsBetween<Output = bool> + Copy> IsBetween<T> for Rgb<T>
type Output = Rgb<bool>
bool
for scalars, or vector of bool
s for vectors.
fn is_between(self, lower: T, upper: T) -> Self::Output | [src] |
fn is_between01(self) -> Self::Output where | [src] |
Returns whether this value is between 0 and 1 (inclusive).
impl<T: IsBetween<Output = bool>> IsBetween<Rgb<T>> for Rgb<T>
[src]
impl<T: IsBetween<Output = bool>> IsBetween<Rgb<T>> for Rgb<T>
type Output = Rgb<bool>
bool
for scalars, or vector of bool
s for vectors.
fn is_between(self, lower: Self, upper: Self) -> Self::Output | [src] |
fn is_between01(self) -> Self::Output where | [src] |
Returns whether this value is between 0 and 1 (inclusive).
impl<T: Clamp + Copy> Clamp<T> for Rgb<T>
[src]
impl<T: Clamp + Copy> Clamp<T> for Rgb<T>
fn clamped(self, lower: T, upper: T) -> Self | [src] |
fn clamp(val: Self, lower: Bound, upper: Bound) -> Self | [src] |
Alias to clamped
, which doesn't take self
. Read more
fn clamped01(self) -> Self where | [src] |
Constrains this value to be between 0 and 1 (inclusive).
fn clamp01(val: Self) -> Self where | [src] |
Alias to clamped01
, which doesn't take self
.
impl<T: Clamp> Clamp<Rgb<T>> for Rgb<T>
[src]
impl<T: Clamp> Clamp<Rgb<T>> for Rgb<T>
fn clamped(self, lower: Self, upper: Self) -> Self | [src] |
fn clamp(val: Self, lower: Bound, upper: Bound) -> Self | [src] |
Alias to clamped
, which doesn't take self
. Read more
fn clamped01(self) -> Self where | [src] |
Constrains this value to be between 0 and 1 (inclusive).
fn clamp01(val: Self) -> Self where | [src] |
Alias to clamped01
, which doesn't take self
.
impl<T> MulAdd<Rgb<T>, Rgb<T>> for Rgb<T> where
T: MulAdd<T, T, Output = T>,
[src]
impl<T> MulAdd<Rgb<T>, Rgb<T>> for Rgb<T> where
T: MulAdd<T, T, Output = T>,
type Output = Rgb<T>
The resulting type after applying the fused multiply-add operation.
fn mul_add(self, a: Rgb<T>, b: Rgb<T>) -> Self::Output | [src] |
impl<'c, T> MulAdd<Rgb<T>, Rgb<T>> for &'c Rgb<T> where
&'c T: MulAdd<T, T, Output = T>,
[src]
impl<'c, T> MulAdd<Rgb<T>, Rgb<T>> for &'c Rgb<T> where
&'c T: MulAdd<T, T, Output = T>,
type Output = Rgb<T>
The resulting type after applying the fused multiply-add operation.
fn mul_add(self, a: Rgb<T>, b: Rgb<T>) -> Self::Output | [src] |
impl<'b, T> MulAdd<Rgb<T>, &'b Rgb<T>> for Rgb<T> where
T: MulAdd<T, &'b T, Output = T>,
[src]
impl<'b, T> MulAdd<Rgb<T>, &'b Rgb<T>> for Rgb<T> where
T: MulAdd<T, &'b T, Output = T>,
type Output = Rgb<T>
The resulting type after applying the fused multiply-add operation.
fn mul_add(self, a: Rgb<T>, b: &'b Rgb<T>) -> Self::Output | [src] |
impl<'b, 'c, T> MulAdd<Rgb<T>, &'b Rgb<T>> for &'c Rgb<T> where
&'c T: MulAdd<T, &'b T, Output = T>,
[src]
impl<'b, 'c, T> MulAdd<Rgb<T>, &'b Rgb<T>> for &'c Rgb<T> where
&'c T: MulAdd<T, &'b T, Output = T>,
type Output = Rgb<T>
The resulting type after applying the fused multiply-add operation.
fn mul_add(self, a: Rgb<T>, b: &'b Rgb<T>) -> Self::Output | [src] |
impl<'a, T> MulAdd<&'a Rgb<T>, Rgb<T>> for Rgb<T> where
T: MulAdd<&'a T, T, Output = T>,
[src]
impl<'a, T> MulAdd<&'a Rgb<T>, Rgb<T>> for Rgb<T> where
T: MulAdd<&'a T, T, Output = T>,
type Output = Rgb<T>
The resulting type after applying the fused multiply-add operation.
fn mul_add(self, a: &'a Rgb<T>, b: Rgb<T>) -> Self::Output | [src] |
impl<'a, 'c, T> MulAdd<&'a Rgb<T>, Rgb<T>> for &'c Rgb<T> where
&'c T: MulAdd<&'a T, T, Output = T>,
[src]
impl<'a, 'c, T> MulAdd<&'a Rgb<T>, Rgb<T>> for &'c Rgb<T> where
&'c T: MulAdd<&'a T, T, Output = T>,
type Output = Rgb<T>
The resulting type after applying the fused multiply-add operation.
fn mul_add(self, a: &'a Rgb<T>, b: Rgb<T>) -> Self::Output | [src] |
impl<'a, 'b, T> MulAdd<&'a Rgb<T>, &'b Rgb<T>> for Rgb<T> where
T: MulAdd<&'a T, &'b T, Output = T>,
[src]
impl<'a, 'b, T> MulAdd<&'a Rgb<T>, &'b Rgb<T>> for Rgb<T> where
T: MulAdd<&'a T, &'b T, Output = T>,
type Output = Rgb<T>
The resulting type after applying the fused multiply-add operation.
fn mul_add(self, a: &'a Rgb<T>, b: &'b Rgb<T>) -> Self::Output | [src] |
impl<'a, 'b, 'c, T> MulAdd<&'a Rgb<T>, &'b Rgb<T>> for &'c Rgb<T> where
&'c T: MulAdd<&'a T, &'b T, Output = T>,
[src]
impl<'a, 'b, 'c, T> MulAdd<&'a Rgb<T>, &'b Rgb<T>> for &'c Rgb<T> where
&'c T: MulAdd<&'a T, &'b T, Output = T>,
type Output = Rgb<T>
The resulting type after applying the fused multiply-add operation.
fn mul_add(self, a: &'a Rgb<T>, b: &'b Rgb<T>) -> Self::Output | [src] |
impl<T, Factor> Lerp<Factor> for Rgb<T> where
T: Lerp<Factor, Output = T>,
Factor: Copy,
[src]
impl<T, Factor> Lerp<Factor> for Rgb<T> where
T: Lerp<Factor, Output = T>,
Factor: Copy,
type Output = Self
The resulting type after performing the LERP operation.
fn lerp_unclamped_precise(from: Self, to: Self, factor: Factor) -> Self | [src] |
fn lerp_unclamped(from: Self, to: Self, factor: Factor) -> Self | [src] |
fn lerp(from: Self, to: Self, factor: Factor) -> Self::Output where | [src] |
Alias to lerp_unclamped
which constrains factor
to be between 0 and 1 (inclusive). Read more
fn lerp_precise(from: Self, to: Self, factor: Factor) -> Self::Output where | [src] |
Alias to lerp_unclamped_precise
which constrains factor
to be between 0 and 1 (inclusive). Read more
impl<'a, T, Factor> Lerp<Factor> for &'a Rgb<T> where
&'a T: Lerp<Factor, Output = T>,
Factor: Copy,
[src]
impl<'a, T, Factor> Lerp<Factor> for &'a Rgb<T> where
&'a T: Lerp<Factor, Output = T>,
Factor: Copy,
type Output = Rgb<T>
The resulting type after performing the LERP operation.
fn lerp_unclamped_precise(from: Self, to: Self, factor: Factor) -> Rgb<T> | [src] |
fn lerp_unclamped(from: Self, to: Self, factor: Factor) -> Rgb<T> | [src] |
fn lerp(from: Self, to: Self, factor: Factor) -> Self::Output where | [src] |
Alias to lerp_unclamped
which constrains factor
to be between 0 and 1 (inclusive). Read more
fn lerp_precise(from: Self, to: Self, factor: Factor) -> Self::Output where | [src] |
Alias to lerp_unclamped_precise
which constrains factor
to be between 0 and 1 (inclusive). Read more
impl<T: Wrap + Copy> Wrap<T> for Rgb<T>
[src]
impl<T: Wrap + Copy> Wrap<T> for Rgb<T>
fn wrapped(self, upper: T) -> Self | [src] |
fn wrapped_between(self, lower: T, upper: T) -> Self | [src] |
fn pingpong(self, upper: T) -> Self | [src] |
fn wrap(val: Self, upper: Bound) -> Self | [src] |
Alias to wrapped()
which doesn't take self
. Read more
fn wrapped_2pi(self) -> Self where | [src] |
Returns this value, wrapped between zero and two times 𝛑 (inclusive). Read more
fn wrap_2pi(val: Self) -> Self where | [src] |
Alias to wrapped_2pi
which doesn't take self
. Read more
fn wrap_between(val: Self, lower: Bound, upper: Bound) -> Self where | [src] |
Alias to wrapped_between
which doesn't take self
. Read more
fn delta_angle(self, target: Self) -> Self where | [src] |
Calculates the shortest difference between two given angles, in radians.
fn delta_angle_degrees(self, target: Self) -> Self where | [src] |
Calculates the shortest difference between two given angles, in degrees. Read more
impl<T: Wrap> Wrap<Rgb<T>> for Rgb<T>
[src]
impl<T: Wrap> Wrap<Rgb<T>> for Rgb<T>
fn wrapped(self, upper: Rgb<T>) -> Self | [src] |
fn wrapped_between(self, lower: Self, upper: Self) -> Self | [src] |
fn pingpong(self, upper: Self) -> Self | [src] |
fn wrap(val: Self, upper: Bound) -> Self | [src] |
Alias to wrapped()
which doesn't take self
. Read more
fn wrapped_2pi(self) -> Self where | [src] |
Returns this value, wrapped between zero and two times 𝛑 (inclusive). Read more
fn wrap_2pi(val: Self) -> Self where | [src] |
Alias to wrapped_2pi
which doesn't take self
. Read more
fn wrap_between(val: Self, lower: Bound, upper: Bound) -> Self where | [src] |
Alias to wrapped_between
which doesn't take self
. Read more
fn delta_angle(self, target: Self) -> Self where | [src] |
Calculates the shortest difference between two given angles, in radians.
fn delta_angle_degrees(self, target: Self) -> Self where | [src] |
Calculates the shortest difference between two given angles, in degrees. Read more
impl<T: Copy> Copy for Rgb<T>
[src]
impl<T: Copy> Copy for Rgb<T>
impl<T> DerefMut for Rgb<T>
[src]
impl<T> DerefMut for Rgb<T>
impl<T> Deref for Rgb<T>
[src]
impl<T> Deref for Rgb<T>
impl<T: Display> Display for Rgb<T>
[src]
impl<T: Display> Display for Rgb<T>
Displays the vector, formatted as rgb({}, {}, {})
.
impl<T: Debug> Debug for Rgb<T>
[src]
impl<T: Debug> Debug for Rgb<T>
impl<V, T> Sub<V> for Rgb<T> where
V: Into<Rgb<T>>,
T: Sub<T, Output = T>,
[src]
impl<V, T> Sub<V> for Rgb<T> where
V: Into<Rgb<T>>,
T: Sub<T, Output = T>,
type Output = Self
The resulting type after applying the -
operator.
fn sub(self, rhs: V) -> Self::Output | [src] |
impl<'a, T> Sub<&'a Rgb<T>> for Rgb<T> where
T: Sub<&'a T, Output = T>,
[src]
impl<'a, T> Sub<&'a Rgb<T>> for Rgb<T> where
T: Sub<&'a T, Output = T>,
type Output = Rgb<T>
The resulting type after applying the -
operator.
fn sub(self, rhs: &'a Rgb<T>) -> Self::Output | [src] |
impl<'a, T> Sub<Rgb<T>> for &'a Rgb<T> where
&'a T: Sub<T, Output = T>,
[src]
impl<'a, T> Sub<Rgb<T>> for &'a Rgb<T> where
&'a T: Sub<T, Output = T>,
type Output = Rgb<T>
The resulting type after applying the -
operator.
fn sub(self, rhs: Rgb<T>) -> Self::Output | [src] |
impl<'a, 'b, T> Sub<&'a Rgb<T>> for &'b Rgb<T> where
&'b T: Sub<&'a T, Output = T>,
[src]
impl<'a, 'b, T> Sub<&'a Rgb<T>> for &'b Rgb<T> where
&'b T: Sub<&'a T, Output = T>,
type Output = Rgb<T>
The resulting type after applying the -
operator.
fn sub(self, rhs: &'a Rgb<T>) -> Self::Output | [src] |
impl<'a, T> Sub<T> for &'a Rgb<T> where
&'a T: Sub<T, Output = T>,
T: Copy,
[src]
impl<'a, T> Sub<T> for &'a Rgb<T> where
&'a T: Sub<T, Output = T>,
T: Copy,
type Output = Rgb<T>
The resulting type after applying the -
operator.
fn sub(self, rhs: T) -> Self::Output | [src] |
impl<'a, 'b, T> Sub<&'a T> for &'b Rgb<T> where
&'b T: Sub<&'a T, Output = T>,
[src]
impl<'a, 'b, T> Sub<&'a T> for &'b Rgb<T> where
&'b T: Sub<&'a T, Output = T>,
type Output = Rgb<T>
The resulting type after applying the -
operator.
fn sub(self, rhs: &'a T) -> Self::Output | [src] |
impl<T: PartialEq> PartialEq<Rgb<T>> for Rgb<T>
[src]
impl<T: PartialEq> PartialEq<Rgb<T>> for Rgb<T>
impl<T: Eq> Eq for Rgb<T>
[src]
impl<T: Eq> Eq for Rgb<T>
impl<T: Hash> Hash for Rgb<T>
[src]
impl<T: Hash> Hash for Rgb<T>
fn hash<__HT: Hasher>(&self, state: &mut __HT) | [src] |
fn hash_slice<H>(data: &[Self], state: &mut H) where | 1.3.0 [src] |
Feeds a slice of this type into the given [Hasher
]. Read more
impl<T> From<Rgb<T>> for Vec3<T>
[src]
impl<T> From<Rgb<T>> for Vec3<T>
impl<T: ColorComponent> From<Rgb<T>> for Rgba<T>
[src]
impl<T: ColorComponent> From<Rgb<T>> for Rgba<T>
impl<T> From<(T, T, T)> for Rgb<T>
[src]
impl<T> From<(T, T, T)> for Rgb<T>
impl<T> From<[T; 3]> for Rgb<T>
[src]
impl<T> From<[T; 3]> for Rgb<T>
impl<T: Copy> From<T> for Rgb<T>
[src]
impl<T: Copy> From<T> for Rgb<T>
A vector can be obtained from a single scalar by broadcasting it.
This conversion is important because it allows scalars to be smoothly accepted as operands in most vector operations.
For instance :
assert_eq!(Vec4::min(4, 5), Vec4::broadcast(4)); assert_eq!(Vec4::max(4, 5), Vec4::broadcast(5)); assert_eq!(Vec4::from(4), Vec4::broadcast(4)); assert_eq!(Vec4::from(4).mul_add(4, 5), Vec4::broadcast(21)); // scaling_3d() logically accepts a Vec3... let _ = Mat4::<f32>::scaling_3d(Vec3::broadcast(5.0)); // ... but there you go; quick uniform scale, thanks to Into ! let _ = Mat4::scaling_3d(5_f32);
On the other hand, it also allows writing nonsense.
To minimize surprises, the names of operations try to be as explicit as possible.
// This creates a matrix that translates to (5,5,5), but it's probably not what you meant. // Hopefully the `_3d` suffix would help you catch this. let _ = Mat4::translation_3d(5_f32); // translation_3d() takes V: Into<Vec3> because it allows it to accept // Vec2, Vec3 and Vec4, and also with both repr(C) and repr(simd) layouts.
impl<T> From<Vec3<T>> for Rgb<T>
[src]
impl<T> From<Vec3<T>> for Rgb<T>
impl<T> From<Rgba<T>> for Rgb<T>
[src]
impl<T> From<Rgba<T>> for Rgb<T>
impl<T> From<Rgb<T>> for Rgb<T>
[src]
impl<T> From<Rgb<T>> for Rgb<T>
impl<T> From<Rgb<T>> for CVec<T>
[src]
impl<T> From<Rgb<T>> for CVec<T>
impl<V, T> Add<V> for Rgb<T> where
V: Into<Rgb<T>>,
T: Add<T, Output = T>,
[src]
impl<V, T> Add<V> for Rgb<T> where
V: Into<Rgb<T>>,
T: Add<T, Output = T>,
type Output = Self
The resulting type after applying the +
operator.
fn add(self, rhs: V) -> Self::Output | [src] |
impl<'a, T> Add<&'a Rgb<T>> for Rgb<T> where
T: Add<&'a T, Output = T>,
[src]
impl<'a, T> Add<&'a Rgb<T>> for Rgb<T> where
T: Add<&'a T, Output = T>,
type Output = Rgb<T>
The resulting type after applying the +
operator.
fn add(self, rhs: &'a Rgb<T>) -> Self::Output | [src] |
impl<'a, T> Add<Rgb<T>> for &'a Rgb<T> where
&'a T: Add<T, Output = T>,
[src]
impl<'a, T> Add<Rgb<T>> for &'a Rgb<T> where
&'a T: Add<T, Output = T>,
type Output = Rgb<T>
The resulting type after applying the +
operator.
fn add(self, rhs: Rgb<T>) -> Self::Output | [src] |
impl<'a, 'b, T> Add<&'a Rgb<T>> for &'b Rgb<T> where
&'b T: Add<&'a T, Output = T>,
[src]
impl<'a, 'b, T> Add<&'a Rgb<T>> for &'b Rgb<T> where
&'b T: Add<&'a T, Output = T>,
type Output = Rgb<T>
The resulting type after applying the +
operator.
fn add(self, rhs: &'a Rgb<T>) -> Self::Output | [src] |
impl<'a, T> Add<T> for &'a Rgb<T> where
&'a T: Add<T, Output = T>,
T: Copy,
[src]
impl<'a, T> Add<T> for &'a Rgb<T> where
&'a T: Add<T, Output = T>,
T: Copy,
type Output = Rgb<T>
The resulting type after applying the +
operator.
fn add(self, rhs: T) -> Self::Output | [src] |
impl<'a, 'b, T> Add<&'a T> for &'b Rgb<T> where
&'b T: Add<&'a T, Output = T>,
[src]
impl<'a, 'b, T> Add<&'a T> for &'b Rgb<T> where
&'b T: Add<&'a T, Output = T>,
type Output = Rgb<T>
The resulting type after applying the +
operator.
fn add(self, rhs: &'a T) -> Self::Output | [src] |
impl<V, T> Mul<V> for Rgb<T> where
V: Into<Rgb<T>>,
T: Mul<T, Output = T>,
[src]
impl<V, T> Mul<V> for Rgb<T> where
V: Into<Rgb<T>>,
T: Mul<T, Output = T>,
type Output = Self
The resulting type after applying the *
operator.
fn mul(self, rhs: V) -> Self::Output | [src] |
impl<'a, T> Mul<&'a Rgb<T>> for Rgb<T> where
T: Mul<&'a T, Output = T>,
[src]
impl<'a, T> Mul<&'a Rgb<T>> for Rgb<T> where
T: Mul<&'a T, Output = T>,
type Output = Rgb<T>
The resulting type after applying the *
operator.
fn mul(self, rhs: &'a Rgb<T>) -> Self::Output | [src] |
impl<'a, T> Mul<Rgb<T>> for &'a Rgb<T> where
&'a T: Mul<T, Output = T>,
[src]
impl<'a, T> Mul<Rgb<T>> for &'a Rgb<T> where
&'a T: Mul<T, Output = T>,
type Output = Rgb<T>
The resulting type after applying the *
operator.
fn mul(self, rhs: Rgb<T>) -> Self::Output | [src] |
impl<'a, 'b, T> Mul<&'a Rgb<T>> for &'b Rgb<T> where
&'b T: Mul<&'a T, Output = T>,
[src]
impl<'a, 'b, T> Mul<&'a Rgb<T>> for &'b Rgb<T> where
&'b T: Mul<&'a T, Output = T>,
type Output = Rgb<T>
The resulting type after applying the *
operator.
fn mul(self, rhs: &'a Rgb<T>) -> Self::Output | [src] |
impl<'a, T> Mul<T> for &'a Rgb<T> where
&'a T: Mul<T, Output = T>,
T: Copy,
[src]
impl<'a, T> Mul<T> for &'a Rgb<T> where
&'a T: Mul<T, Output = T>,
T: Copy,
type Output = Rgb<T>
The resulting type after applying the *
operator.
fn mul(self, rhs: T) -> Self::Output | [src] |
impl<'a, 'b, T> Mul<&'a T> for &'b Rgb<T> where
&'b T: Mul<&'a T, Output = T>,
[src]
impl<'a, 'b, T> Mul<&'a T> for &'b Rgb<T> where
&'b T: Mul<&'a T, Output = T>,
type Output = Rgb<T>
The resulting type after applying the *
operator.
fn mul(self, rhs: &'a T) -> Self::Output | [src] |
impl<V, T> Div<V> for Rgb<T> where
V: Into<Rgb<T>>,
T: Div<T, Output = T>,
[src]
impl<V, T> Div<V> for Rgb<T> where
V: Into<Rgb<T>>,
T: Div<T, Output = T>,
type Output = Self
The resulting type after applying the /
operator.
fn div(self, rhs: V) -> Self::Output | [src] |
impl<'a, T> Div<&'a Rgb<T>> for Rgb<T> where
T: Div<&'a T, Output = T>,
[src]
impl<'a, T> Div<&'a Rgb<T>> for Rgb<T> where
T: Div<&'a T, Output = T>,
type Output = Rgb<T>
The resulting type after applying the /
operator.
fn div(self, rhs: &'a Rgb<T>) -> Self::Output | [src] |
impl<'a, T> Div<Rgb<T>> for &'a Rgb<T> where
&'a T: Div<T, Output = T>,
[src]
impl<'a, T> Div<Rgb<T>> for &'a Rgb<T> where
&'a T: Div<T, Output = T>,
type Output = Rgb<T>
The resulting type after applying the /
operator.
fn div(self, rhs: Rgb<T>) -> Self::Output | [src] |
impl<'a, 'b, T> Div<&'a Rgb<T>> for &'b Rgb<T> where
&'b T: Div<&'a T, Output = T>,
[src]
impl<'a, 'b, T> Div<&'a Rgb<T>> for &'b Rgb<T> where
&'b T: Div<&'a T, Output = T>,
type Output = Rgb<T>
The resulting type after applying the /
operator.
fn div(self, rhs: &'a Rgb<T>) -> Self::Output | [src] |
impl<'a, T> Div<T> for &'a Rgb<T> where
&'a T: Div<T, Output = T>,
T: Copy,
[src]
impl<'a, T> Div<T> for &'a Rgb<T> where
&'a T: Div<T, Output = T>,
T: Copy,
type Output = Rgb<T>
The resulting type after applying the /
operator.
fn div(self, rhs: T) -> Self::Output | [src] |
impl<'a, 'b, T> Div<&'a T> for &'b Rgb<T> where
&'b T: Div<&'a T, Output = T>,
[src]
impl<'a, 'b, T> Div<&'a T> for &'b Rgb<T> where
&'b T: Div<&'a T, Output = T>,
type Output = Rgb<T>
The resulting type after applying the /
operator.
fn div(self, rhs: &'a T) -> Self::Output | [src] |
impl<V, T> Rem<V> for Rgb<T> where
V: Into<Rgb<T>>,
T: Rem<T, Output = T>,
[src]
impl<V, T> Rem<V> for Rgb<T> where
V: Into<Rgb<T>>,
T: Rem<T, Output = T>,
type Output = Self
The resulting type after applying the %
operator.
fn rem(self, rhs: V) -> Self::Output | [src] |
impl<'a, T> Rem<&'a Rgb<T>> for Rgb<T> where
T: Rem<&'a T, Output = T>,
[src]
impl<'a, T> Rem<&'a Rgb<T>> for Rgb<T> where
T: Rem<&'a T, Output = T>,
type Output = Rgb<T>
The resulting type after applying the %
operator.
fn rem(self, rhs: &'a Rgb<T>) -> Self::Output | [src] |
impl<'a, T> Rem<Rgb<T>> for &'a Rgb<T> where
&'a T: Rem<T, Output = T>,
[src]
impl<'a, T> Rem<Rgb<T>> for &'a Rgb<T> where
&'a T: Rem<T, Output = T>,
type Output = Rgb<T>
The resulting type after applying the %
operator.
fn rem(self, rhs: Rgb<T>) -> Self::Output | [src] |
impl<'a, 'b, T> Rem<&'a Rgb<T>> for &'b Rgb<T> where
&'b T: Rem<&'a T, Output = T>,
[src]
impl<'a, 'b, T> Rem<&'a Rgb<T>> for &'b Rgb<T> where
&'b T: Rem<&'a T, Output = T>,
type Output = Rgb<T>
The resulting type after applying the %
operator.
fn rem(self, rhs: &'a Rgb<T>) -> Self::Output | [src] |
impl<'a, T> Rem<T> for &'a Rgb<T> where
&'a T: Rem<T, Output = T>,
T: Copy,
[src]
impl<'a, T> Rem<T> for &'a Rgb<T> where
&'a T: Rem<T, Output = T>,
T: Copy,
type Output = Rgb<T>
The resulting type after applying the %
operator.
fn rem(self, rhs: T) -> Self::Output | [src] |
impl<'a, 'b, T> Rem<&'a T> for &'b Rgb<T> where
&'b T: Rem<&'a T, Output = T>,
[src]
impl<'a, 'b, T> Rem<&'a T> for &'b Rgb<T> where
&'b T: Rem<&'a T, Output = T>,
type Output = Rgb<T>
The resulting type after applying the %
operator.
fn rem(self, rhs: &'a T) -> Self::Output | [src] |
impl<T> Neg for Rgb<T> where
T: Neg<Output = T>,
[src]
impl<T> Neg for Rgb<T> where
T: Neg<Output = T>,
type Output = Self
The resulting type after applying the -
operator.
fn neg(self) -> Self::Output | [src] |
impl<V, T> AddAssign<V> for Rgb<T> where
V: Into<Rgb<T>>,
T: AddAssign<T>,
[src]
impl<V, T> AddAssign<V> for Rgb<T> where
V: Into<Rgb<T>>,
T: AddAssign<T>,
fn add_assign(&mut self, rhs: V) | [src] |
impl<V, T> SubAssign<V> for Rgb<T> where
V: Into<Rgb<T>>,
T: SubAssign<T>,
[src]
impl<V, T> SubAssign<V> for Rgb<T> where
V: Into<Rgb<T>>,
T: SubAssign<T>,
fn sub_assign(&mut self, rhs: V) | [src] |
impl<V, T> MulAssign<V> for Rgb<T> where
V: Into<Rgb<T>>,
T: MulAssign<T>,
[src]
impl<V, T> MulAssign<V> for Rgb<T> where
V: Into<Rgb<T>>,
T: MulAssign<T>,
fn mul_assign(&mut self, rhs: V) | [src] |
impl<V, T> DivAssign<V> for Rgb<T> where
V: Into<Rgb<T>>,
T: DivAssign<T>,
[src]
impl<V, T> DivAssign<V> for Rgb<T> where
V: Into<Rgb<T>>,
T: DivAssign<T>,
fn div_assign(&mut self, rhs: V) | [src] |
impl<V, T> RemAssign<V> for Rgb<T> where
V: Into<Rgb<T>>,
T: RemAssign<T>,
[src]
impl<V, T> RemAssign<V> for Rgb<T> where
V: Into<Rgb<T>>,
T: RemAssign<T>,
fn rem_assign(&mut self, rhs: V) | [src] |
impl<T> Not for Rgb<T> where
T: Not<Output = T>,
[src]
impl<T> Not for Rgb<T> where
T: Not<Output = T>,
type Output = Self
The resulting type after applying the !
operator.
fn not(self) -> Self::Output | [src] |
impl<V, T> BitAnd<V> for Rgb<T> where
V: Into<Rgb<T>>,
T: BitAnd<T, Output = T>,
[src]
impl<V, T> BitAnd<V> for Rgb<T> where
V: Into<Rgb<T>>,
T: BitAnd<T, Output = T>,
type Output = Self
The resulting type after applying the &
operator.
fn bitand(self, rhs: V) -> Self::Output | [src] |
impl<'a, T> BitAnd<&'a Rgb<T>> for Rgb<T> where
T: BitAnd<&'a T, Output = T>,
[src]
impl<'a, T> BitAnd<&'a Rgb<T>> for Rgb<T> where
T: BitAnd<&'a T, Output = T>,
type Output = Rgb<T>
The resulting type after applying the &
operator.
fn bitand(self, rhs: &'a Rgb<T>) -> Self::Output | [src] |
impl<'a, T> BitAnd<Rgb<T>> for &'a Rgb<T> where
&'a T: BitAnd<T, Output = T>,
[src]
impl<'a, T> BitAnd<Rgb<T>> for &'a Rgb<T> where
&'a T: BitAnd<T, Output = T>,
type Output = Rgb<T>
The resulting type after applying the &
operator.
fn bitand(self, rhs: Rgb<T>) -> Self::Output | [src] |
impl<'a, 'b, T> BitAnd<&'a Rgb<T>> for &'b Rgb<T> where
&'b T: BitAnd<&'a T, Output = T>,
[src]
impl<'a, 'b, T> BitAnd<&'a Rgb<T>> for &'b Rgb<T> where
&'b T: BitAnd<&'a T, Output = T>,
type Output = Rgb<T>
The resulting type after applying the &
operator.
fn bitand(self, rhs: &'a Rgb<T>) -> Self::Output | [src] |
impl<'a, T> BitAnd<T> for &'a Rgb<T> where
&'a T: BitAnd<T, Output = T>,
T: Copy,
[src]
impl<'a, T> BitAnd<T> for &'a Rgb<T> where
&'a T: BitAnd<T, Output = T>,
T: Copy,
type Output = Rgb<T>
The resulting type after applying the &
operator.
fn bitand(self, rhs: T) -> Self::Output | [src] |
impl<'a, 'b, T> BitAnd<&'a T> for &'b Rgb<T> where
&'b T: BitAnd<&'a T, Output = T>,
[src]
impl<'a, 'b, T> BitAnd<&'a T> for &'b Rgb<T> where
&'b T: BitAnd<&'a T, Output = T>,
type Output = Rgb<T>
The resulting type after applying the &
operator.
fn bitand(self, rhs: &'a T) -> Self::Output | [src] |
impl<V, T> BitOr<V> for Rgb<T> where
V: Into<Rgb<T>>,
T: BitOr<T, Output = T>,
[src]
impl<V, T> BitOr<V> for Rgb<T> where
V: Into<Rgb<T>>,
T: BitOr<T, Output = T>,
type Output = Self
The resulting type after applying the |
operator.
fn bitor(self, rhs: V) -> Self::Output | [src] |
impl<'a, T> BitOr<&'a Rgb<T>> for Rgb<T> where
T: BitOr<&'a T, Output = T>,
[src]
impl<'a, T> BitOr<&'a Rgb<T>> for Rgb<T> where
T: BitOr<&'a T, Output = T>,
type Output = Rgb<T>
The resulting type after applying the |
operator.
fn bitor(self, rhs: &'a Rgb<T>) -> Self::Output | [src] |
impl<'a, T> BitOr<Rgb<T>> for &'a Rgb<T> where
&'a T: BitOr<T, Output = T>,
[src]
impl<'a, T> BitOr<Rgb<T>> for &'a Rgb<T> where
&'a T: BitOr<T, Output = T>,
type Output = Rgb<T>
The resulting type after applying the |
operator.
fn bitor(self, rhs: Rgb<T>) -> Self::Output | [src] |
impl<'a, 'b, T> BitOr<&'a Rgb<T>> for &'b Rgb<T> where
&'b T: BitOr<&'a T, Output = T>,
[src]
impl<'a, 'b, T> BitOr<&'a Rgb<T>> for &'b Rgb<T> where
&'b T: BitOr<&'a T, Output = T>,
type Output = Rgb<T>
The resulting type after applying the |
operator.
fn bitor(self, rhs: &'a Rgb<T>) -> Self::Output | [src] |
impl<'a, T> BitOr<T> for &'a Rgb<T> where
&'a T: BitOr<T, Output = T>,
T: Copy,
[src]
impl<'a, T> BitOr<T> for &'a Rgb<T> where
&'a T: BitOr<T, Output = T>,
T: Copy,
type Output = Rgb<T>
The resulting type after applying the |
operator.
fn bitor(self, rhs: T) -> Self::Output | [src] |
impl<'a, 'b, T> BitOr<&'a T> for &'b Rgb<T> where
&'b T: BitOr<&'a T, Output = T>,
[src]
impl<'a, 'b, T> BitOr<&'a T> for &'b Rgb<T> where
&'b T: BitOr<&'a T, Output = T>,
type Output = Rgb<T>
The resulting type after applying the |
operator.
fn bitor(self, rhs: &'a T) -> Self::Output | [src] |
impl<V, T> BitXor<V> for Rgb<T> where
V: Into<Rgb<T>>,
T: BitXor<T, Output = T>,
[src]
impl<V, T> BitXor<V> for Rgb<T> where
V: Into<Rgb<T>>,
T: BitXor<T, Output = T>,
type Output = Self
The resulting type after applying the ^
operator.
fn bitxor(self, rhs: V) -> Self::Output | [src] |
impl<'a, T> BitXor<&'a Rgb<T>> for Rgb<T> where
T: BitXor<&'a T, Output = T>,
[src]
impl<'a, T> BitXor<&'a Rgb<T>> for Rgb<T> where
T: BitXor<&'a T, Output = T>,
type Output = Rgb<T>
The resulting type after applying the ^
operator.
fn bitxor(self, rhs: &'a Rgb<T>) -> Self::Output | [src] |
impl<'a, T> BitXor<Rgb<T>> for &'a Rgb<T> where
&'a T: BitXor<T, Output = T>,
[src]
impl<'a, T> BitXor<Rgb<T>> for &'a Rgb<T> where
&'a T: BitXor<T, Output = T>,
type Output = Rgb<T>
The resulting type after applying the ^
operator.
fn bitxor(self, rhs: Rgb<T>) -> Self::Output | [src] |
impl<'a, 'b, T> BitXor<&'a Rgb<T>> for &'b Rgb<T> where
&'b T: BitXor<&'a T, Output = T>,
[src]
impl<'a, 'b, T> BitXor<&'a Rgb<T>> for &'b Rgb<T> where
&'b T: BitXor<&'a T, Output = T>,
type Output = Rgb<T>
The resulting type after applying the ^
operator.
fn bitxor(self, rhs: &'a Rgb<T>) -> Self::Output | [src] |
impl<'a, T> BitXor<T> for &'a Rgb<T> where
&'a T: BitXor<T, Output = T>,
T: Copy,
[src]
impl<'a, T> BitXor<T> for &'a Rgb<T> where
&'a T: BitXor<T, Output = T>,
T: Copy,
type Output = Rgb<T>
The resulting type after applying the ^
operator.
fn bitxor(self, rhs: T) -> Self::Output | [src] |
impl<'a, 'b, T> BitXor<&'a T> for &'b Rgb<T> where
&'b T: BitXor<&'a T, Output = T>,
[src]
impl<'a, 'b, T> BitXor<&'a T> for &'b Rgb<T> where
&'b T: BitXor<&'a T, Output = T>,
type Output = Rgb<T>
The resulting type after applying the ^
operator.
fn bitxor(self, rhs: &'a T) -> Self::Output | [src] |
impl<V, T> Shl<V> for Rgb<T> where
V: Into<Rgb<T>>,
T: Shl<T, Output = T>,
[src]
impl<V, T> Shl<V> for Rgb<T> where
V: Into<Rgb<T>>,
T: Shl<T, Output = T>,
type Output = Self
The resulting type after applying the <<
operator.
fn shl(self, rhs: V) -> Self::Output | [src] |
impl<'a, T> Shl<&'a Rgb<T>> for Rgb<T> where
T: Shl<&'a T, Output = T>,
[src]
impl<'a, T> Shl<&'a Rgb<T>> for Rgb<T> where
T: Shl<&'a T, Output = T>,
type Output = Rgb<T>
The resulting type after applying the <<
operator.
fn shl(self, rhs: &'a Rgb<T>) -> Self::Output | [src] |
impl<'a, T> Shl<Rgb<T>> for &'a Rgb<T> where
&'a T: Shl<T, Output = T>,
[src]
impl<'a, T> Shl<Rgb<T>> for &'a Rgb<T> where
&'a T: Shl<T, Output = T>,
type Output = Rgb<T>
The resulting type after applying the <<
operator.
fn shl(self, rhs: Rgb<T>) -> Self::Output | [src] |
impl<'a, 'b, T> Shl<&'a Rgb<T>> for &'b Rgb<T> where
&'b T: Shl<&'a T, Output = T>,
[src]
impl<'a, 'b, T> Shl<&'a Rgb<T>> for &'b Rgb<T> where
&'b T: Shl<&'a T, Output = T>,
type Output = Rgb<T>
The resulting type after applying the <<
operator.
fn shl(self, rhs: &'a Rgb<T>) -> Self::Output | [src] |
impl<'a, T> Shl<T> for &'a Rgb<T> where
&'a T: Shl<T, Output = T>,
T: Copy,
[src]
impl<'a, T> Shl<T> for &'a Rgb<T> where
&'a T: Shl<T, Output = T>,
T: Copy,
type Output = Rgb<T>
The resulting type after applying the <<
operator.
fn shl(self, rhs: T) -> Self::Output | [src] |
impl<'a, 'b, T> Shl<&'a T> for &'b Rgb<T> where
&'b T: Shl<&'a T, Output = T>,
[src]
impl<'a, 'b, T> Shl<&'a T> for &'b Rgb<T> where
&'b T: Shl<&'a T, Output = T>,
type Output = Rgb<T>
The resulting type after applying the <<
operator.
fn shl(self, rhs: &'a T) -> Self::Output | [src] |
impl<V, T> Shr<V> for Rgb<T> where
V: Into<Rgb<T>>,
T: Shr<T, Output = T>,
[src]
impl<V, T> Shr<V> for Rgb<T> where
V: Into<Rgb<T>>,
T: Shr<T, Output = T>,
type Output = Self
The resulting type after applying the >>
operator.
fn shr(self, rhs: V) -> Self::Output | [src] |
impl<'a, T> Shr<&'a Rgb<T>> for Rgb<T> where
T: Shr<&'a T, Output = T>,
[src]
impl<'a, T> Shr<&'a Rgb<T>> for Rgb<T> where
T: Shr<&'a T, Output = T>,
type Output = Rgb<T>
The resulting type after applying the >>
operator.
fn shr(self, rhs: &'a Rgb<T>) -> Self::Output | [src] |
impl<'a, T> Shr<Rgb<T>> for &'a Rgb<T> where
&'a T: Shr<T, Output = T>,
[src]
impl<'a, T> Shr<Rgb<T>> for &'a Rgb<T> where
&'a T: Shr<T, Output = T>,
type Output = Rgb<T>
The resulting type after applying the >>
operator.
fn shr(self, rhs: Rgb<T>) -> Self::Output | [src] |
impl<'a, 'b, T> Shr<&'a Rgb<T>> for &'b Rgb<T> where
&'b T: Shr<&'a T, Output = T>,
[src]
impl<'a, 'b, T> Shr<&'a Rgb<T>> for &'b Rgb<T> where
&'b T: Shr<&'a T, Output = T>,
type Output = Rgb<T>
The resulting type after applying the >>
operator.
fn shr(self, rhs: &'a Rgb<T>) -> Self::Output | [src] |
impl<'a, T> Shr<T> for &'a Rgb<T> where
&'a T: Shr<T, Output = T>,
T: Copy,
[src]
impl<'a, T> Shr<T> for &'a Rgb<T> where
&'a T: Shr<T, Output = T>,
T: Copy,
type Output = Rgb<T>
The resulting type after applying the >>
operator.
fn shr(self, rhs: T) -> Self::Output | [src] |
impl<'a, 'b, T> Shr<&'a T> for &'b Rgb<T> where
&'b T: Shr<&'a T, Output = T>,
[src]
impl<'a, 'b, T> Shr<&'a T> for &'b Rgb<T> where
&'b T: Shr<&'a T, Output = T>,
type Output = Rgb<T>
The resulting type after applying the >>
operator.
fn shr(self, rhs: &'a T) -> Self::Output | [src] |
impl<V, T> BitAndAssign<V> for Rgb<T> where
V: Into<Rgb<T>>,
T: BitAndAssign<T>,
[src]
impl<V, T> BitAndAssign<V> for Rgb<T> where
V: Into<Rgb<T>>,
T: BitAndAssign<T>,
fn bitand_assign(&mut self, rhs: V) | [src] |
impl<V, T> BitOrAssign<V> for Rgb<T> where
V: Into<Rgb<T>>,
T: BitOrAssign<T>,
[src]
impl<V, T> BitOrAssign<V> for Rgb<T> where
V: Into<Rgb<T>>,
T: BitOrAssign<T>,
fn bitor_assign(&mut self, rhs: V) | [src] |
impl<V, T> BitXorAssign<V> for Rgb<T> where
V: Into<Rgb<T>>,
T: BitXorAssign<T>,
[src]
impl<V, T> BitXorAssign<V> for Rgb<T> where
V: Into<Rgb<T>>,
T: BitXorAssign<T>,
fn bitxor_assign(&mut self, rhs: V) | [src] |
impl<V, T> ShlAssign<V> for Rgb<T> where
V: Into<Rgb<T>>,
T: ShlAssign<T>,
[src]
impl<V, T> ShlAssign<V> for Rgb<T> where
V: Into<Rgb<T>>,
T: ShlAssign<T>,
fn shl_assign(&mut self, rhs: V) | [src] |
impl<V, T> ShrAssign<V> for Rgb<T> where
V: Into<Rgb<T>>,
T: ShrAssign<T>,
[src]
impl<V, T> ShrAssign<V> for Rgb<T> where
V: Into<Rgb<T>>,
T: ShrAssign<T>,
fn shr_assign(&mut self, rhs: V) | [src] |
impl<T: Default> FromIterator<T> for Rgb<T>
[src]
impl<T: Default> FromIterator<T> for Rgb<T>
fn from_iter<I>(iter: I) -> Self where | [src] |
impl<'a, T> IntoIterator for &'a Rgb<T>
[src]
impl<'a, T> IntoIterator for &'a Rgb<T>
type Item = &'a T
The type of the elements being iterated over.
type IntoIter = Iter<'a, T>
Which kind of iterator are we turning this into?
fn into_iter(self) -> Self::IntoIter | [src] |
impl<'a, T> IntoIterator for &'a mut Rgb<T>
[src]
impl<'a, T> IntoIterator for &'a mut Rgb<T>
type Item = &'a mut T
The type of the elements being iterated over.
type IntoIter = IterMut<'a, T>
Which kind of iterator are we turning this into?
fn into_iter(self) -> Self::IntoIter | [src] |
impl<T> IntoIterator for Rgb<T>
[src]
impl<T> IntoIterator for Rgb<T>
type Item = T
The type of the elements being iterated over.
type IntoIter = IntoIter<T>
Which kind of iterator are we turning this into?
fn into_iter(self) -> Self::IntoIter | [src] |
impl<T: Clone> Clone for Rgb<T>
[src]
impl<T: Clone> Clone for Rgb<T>
fn clone(&self) -> Rgb<T> | [src] |
fn clone_from(&mut self, source: &Self) | 1.0.0 [src] |
Performs copy-assignment from source
. Read more
impl<T: Default> Default for Rgb<T>
[src]
impl<T: Default> Default for Rgb<T>
impl<T> AsRef<[T]> for Rgb<T>
[src]
impl<T> AsRef<[T]> for Rgb<T>
impl<T> AsRef<Rgb<T>> for Rgb<T>
[src]
impl<T> AsRef<Rgb<T>> for Rgb<T>
impl<T> AsMut<[T]> for Rgb<T>
[src]
impl<T> AsMut<[T]> for Rgb<T>
impl<T> AsMut<Rgb<T>> for Rgb<T>
[src]
impl<T> AsMut<Rgb<T>> for Rgb<T>
impl<T> Borrow<[T]> for Rgb<T>
[src]
impl<T> Borrow<[T]> for Rgb<T>
impl<T> BorrowMut<[T]> for Rgb<T>
[src]
impl<T> BorrowMut<[T]> for Rgb<T>
fn borrow_mut(&mut self) -> &mut [T] | [src] |
impl<T: One> One for Rgb<T>
[src]
impl<T: One> One for Rgb<T>
fn one() -> Self | [src] |
fn is_one(&self) -> bool where | [src] |
Returns true
if self
is equal to the multiplicative identity. Read more
impl<T: Zero + PartialEq> Zero for Rgb<T>
[src]
impl<T: Zero + PartialEq> Zero for Rgb<T>
impl<T: ApproxEq> ApproxEq for Rgb<T> where
T::Epsilon: Copy,
[src]
impl<T: ApproxEq> ApproxEq for Rgb<T> where
T::Epsilon: Copy,
type Epsilon = T::Epsilon
Used for specifying relative comparisons.
fn default_epsilon() -> T::Epsilon | [src] |
fn default_max_relative() -> T::Epsilon | [src] |
fn default_max_ulps() -> u32 | [src] |
fn relative_eq( | [src] |
fn ulps_eq(&self, other: &Self, epsilon: T::Epsilon, max_ulps: u32) -> bool | [src] |
fn relative_ne( | [src] |
The inverse of ApproxEq::relative_eq
.
fn ulps_ne(&self, other: &Self, epsilon: Self::Epsilon, max_ulps: u32) -> bool | [src] |
The inverse of ApproxEq::ulps_eq
.
Auto Trait Implementations
Blanket Implementations
impl<T> IsBetween01 for T where
T: IsBetween<T> + Zero + One,
[src]
impl<T> IsBetween01 for T where
T: IsBetween<T> + Zero + One,
impl<T> Clamp01 for T where
T: Clamp<T> + Zero + One,
[src]
impl<T> Clamp01 for T where
T: Clamp<T> + Zero + One,
impl<T, U> TryFrom for T where
T: From<U>,
[src]
impl<T, U> TryFrom for T where
T: From<U>,
type Error = !
try_from
)The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error> | [src] |
impl<T> From for T
[src]
impl<T> From for T
impl<I> IntoIterator for I where
I: Iterator,
[src]
impl<I> IntoIterator for I where
I: Iterator,
type Item = <I as Iterator>::Item
The type of the elements being iterated over.
type IntoIter = I
Which kind of iterator are we turning this into?
fn into_iter(self) -> I | [src] |
impl<T, U> TryInto for T where
U: TryFrom<T>,
[src]
impl<T, U> TryInto for T where
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
try_from
)The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error> | [src] |
impl<T, U> Into for T where
U: From<T>,
[src]
impl<T, U> Into for T where
U: From<T>,
impl<T> Borrow for T where
T: ?Sized,
[src]
impl<T> Borrow for T where
T: ?Sized,
impl<T> BorrowMut for T where
T: ?Sized,
[src]
impl<T> BorrowMut for T where
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T | [src] |
impl<T> Any for T where
T: 'static + ?Sized,
[src]
impl<T> Any for T where
T: 'static + ?Sized,
fn get_type_id(&self) -> TypeId | [src] |
impl<T, Rhs, Output> NumOps for T where
T: Sub<Rhs, Output = Output> + Mul<Rhs, Output = Output> + Div<Rhs, Output = Output> + Add<Rhs, Output = Output> + Rem<Rhs, Output = Output>,
[src]
impl<T, Rhs, Output> NumOps for T where
T: Sub<Rhs, Output = Output> + Mul<Rhs, Output = Output> + Div<Rhs, Output = Output> + Add<Rhs, Output = Output> + Rem<Rhs, Output = Output>,
impl<T, Base> RefNum for T where
T: NumOps<Base, Base> + NumOps<&'r Base, Base>,
[src]
impl<T, Base> RefNum for T where
T: NumOps<Base, Base> + NumOps<&'r Base, Base>,
impl<T> ToOwned for T where
T: Clone,
[src]
impl<T> ToOwned for T where
T: Clone,
impl<T> ToString for T where
T: Display + ?Sized,
[src]
impl<T> ToString for T where
T: Display + ?Sized,
impl<T, Rhs> NumAssignOps for T where
T: AddAssign<Rhs> + SubAssign<Rhs> + MulAssign<Rhs> + DivAssign<Rhs> + RemAssign<Rhs>,
[src]
impl<T, Rhs> NumAssignOps for T where
T: AddAssign<Rhs> + SubAssign<Rhs> + MulAssign<Rhs> + DivAssign<Rhs> + RemAssign<Rhs>,