#[repr(transparent)]pub struct Bit(pub bool);Tuple Fields§
§0: boolTrait Implementations§
Source§impl AddAssign for Bit
impl AddAssign for Bit
Source§fn add_assign(&mut self, rhs: Self)
fn add_assign(&mut self, rhs: Self)
Performs the
+= operation. Read moreSource§impl BitAndAssign for Bit
impl BitAndAssign for Bit
Source§fn bitand_assign(&mut self, rhs: Bit)
fn bitand_assign(&mut self, rhs: Bit)
Performs the
&= operation. Read moreSource§impl BitOrAssign for Bit
impl BitOrAssign for Bit
Source§fn bitor_assign(&mut self, rhs: Bit)
fn bitor_assign(&mut self, rhs: Bit)
Performs the
|= operation. Read moreSource§impl BitXorAssign for Bit
impl BitXorAssign for Bit
Source§fn bitxor_assign(&mut self, rhs: Bit)
fn bitxor_assign(&mut self, rhs: Bit)
Performs the
^= operation. Read moreSource§impl DivAssign for Bit
impl DivAssign for Bit
Source§fn div_assign(&mut self, rhs: Self)
fn div_assign(&mut self, rhs: Self)
Performs the
/= operation. Read moreSource§impl MulAssign for Bit
impl MulAssign for Bit
Source§fn mul_assign(&mut self, rhs: Self)
fn mul_assign(&mut self, rhs: Self)
Performs the
*= operation. Read moreSource§impl Num for Bit
impl Num for Bit
type FromStrRadixErr = ()
Source§fn from_str_radix(str: &str, radix: u32) -> Result<Self, Self::FromStrRadixErr>
fn from_str_radix(str: &str, radix: u32) -> Result<Self, Self::FromStrRadixErr>
Convert from a string and radix (typically
2..=36). Read moreSource§impl Ord for Bit
impl Ord for Bit
Source§impl PartialOrd for Bit
impl PartialOrd for Bit
Source§impl Pixel for Bit
impl Pixel for Bit
Source§const CHANNEL_COUNT: u8 = 1u8
const CHANNEL_COUNT: u8 = 1u8
The number of channels of this pixel type.
Source§const COLOR_MODEL: &'static str = "BLACKANDWHITE"
const COLOR_MODEL: &'static str = "BLACKANDWHITE"
A string that can help to interpret the meaning each channel
See gimp babl.
Source§fn channels_mut(&mut self) -> &mut [Self]
fn channels_mut(&mut self) -> &mut [Self]
Returns the components as a mutable slice
Source§fn from_slice(slice: &[Self]) -> &Self
fn from_slice(slice: &[Self]) -> &Self
Returns a view into a slice. Read more
Source§fn from_slice_mut(slice: &mut [Self]) -> &mut Self
fn from_slice_mut(slice: &mut [Self]) -> &mut Self
Returns mutable view into a mutable slice. Read more
Source§fn to_luma_alpha(&self) -> LumaA<Self>
fn to_luma_alpha(&self) -> LumaA<Self>
Convert this pixel to luma with an alpha channel
Source§fn map<F>(&self, f: F) -> Selfwhere
F: FnMut(Self) -> Self,
fn map<F>(&self, f: F) -> Selfwhere
F: FnMut(Self) -> Self,
Apply the function
f to each channel of this pixel.Source§fn map_with_alpha<F, G>(&self, f: F, _: G) -> Self
fn map_with_alpha<F, G>(&self, f: F, _: G) -> Self
Apply the function
f to each channel except the alpha channel.
Apply the function g to the alpha channel.Source§fn apply<F>(&mut self, f: F)where
F: FnMut(Self) -> Self,
fn apply<F>(&mut self, f: F)where
F: FnMut(Self) -> Self,
Apply the function
f to each channel of this pixel.Source§fn apply_with_alpha<F, G>(&mut self, f: F, _: G)
fn apply_with_alpha<F, G>(&mut self, f: F, _: G)
Apply the function
f to each channel except the alpha channel.
Apply the function g to the alpha channel. Works in-place.Source§fn map2<F>(&self, other: &Self, f: F) -> Selfwhere
F: FnMut(Self, Self) -> Self,
fn map2<F>(&self, other: &Self, f: F) -> Selfwhere
F: FnMut(Self, Self) -> Self,
Apply the function
f to each channel of this pixel and
other pairwise.Source§fn apply2<F>(&mut self, other: &Self, f: F)where
F: FnMut(Self, Self) -> Self,
fn apply2<F>(&mut self, other: &Self, f: F)where
F: FnMut(Self, Self) -> Self,
Apply the function
f to each channel of this pixel and
other pairwise. Works in-place.Source§fn blend(&mut self, other: &Self)
fn blend(&mut self, other: &Self)
Blend the color of a given pixel into ourself, taking into account alpha channels
Source§fn channels4(&self) -> (Self, Self, Self, Self)
fn channels4(&self) -> (Self, Self, Self, Self)
👎Deprecated since 0.24.0: Use
channels() or channels_mut()Returns the channels of this pixel as a 4 tuple. If the pixel
has less than 4 channels the remainder is filled with the maximum value
Source§fn map_without_alpha<F>(&self, f: F) -> Selfwhere
F: FnMut(Self) -> Self,
fn map_without_alpha<F>(&self, f: F) -> Selfwhere
F: FnMut(Self) -> Self,
Apply the function
f to each channel except the alpha channel.Source§fn apply_without_alpha<F>(&mut self, f: F)where
F: FnMut(Self) -> Self,
fn apply_without_alpha<F>(&mut self, f: F)where
F: FnMut(Self) -> Self,
Apply the function
f to each channel except the alpha channel.
Works in place.Source§fn from_channels(a: Self, b: Self, c: Self, d: Self) -> Self
fn from_channels(a: Self, b: Self, c: Self, d: Self) -> Self
👎Deprecated since 0.24.0: Use the constructor of the pixel, for example
Rgba([r,g,b,a]) or Pixel::from_sliceConstruct a pixel from the 4 channels a, b, c and d.
If the pixel does not contain 4 channels the extra are ignored.
Source§impl Primitive for Bit
impl Primitive for Bit
Source§const DEFAULT_MAX_VALUE: Self
const DEFAULT_MAX_VALUE: Self
The maximum value for this type of primitive within the context of color.
For floats, the maximum is
1.0, whereas the integer types inherit their usual maximum values.Source§const DEFAULT_MIN_VALUE: Self
const DEFAULT_MIN_VALUE: Self
The minimum value for this type of primitive within the context of color.
For floats, the minimum is
0.0, whereas the integer types inherit their usual minimum values.Source§impl<__RhsT> ShlAssign<__RhsT> for Bit
impl<__RhsT> ShlAssign<__RhsT> for Bit
Source§fn shl_assign(&mut self, rhs: __RhsT)
fn shl_assign(&mut self, rhs: __RhsT)
Performs the
<<= operation. Read moreSource§impl<__RhsT> ShrAssign<__RhsT> for Bit
impl<__RhsT> ShrAssign<__RhsT> for Bit
Source§fn shr_assign(&mut self, rhs: __RhsT)
fn shr_assign(&mut self, rhs: __RhsT)
Performs the
>>= operation. Read moreSource§impl SubAssign for Bit
impl SubAssign for Bit
Source§fn sub_assign(&mut self, rhs: Self)
fn sub_assign(&mut self, rhs: Self)
Performs the
-= operation. Read moreSource§impl ToPrimitive for Bit
impl ToPrimitive for Bit
Source§fn to_i64(&self) -> Option<i64>
fn to_i64(&self) -> Option<i64>
Converts the value of
self to an i64. If the value cannot be
represented by an i64, then None is returned.Source§fn to_u64(&self) -> Option<u64>
fn to_u64(&self) -> Option<u64>
Converts the value of
self to a u64. If the value cannot be
represented by a u64, then None is returned.Source§fn to_isize(&self) -> Option<isize>
fn to_isize(&self) -> Option<isize>
Converts the value of
self to an isize. If the value cannot be
represented by an isize, then None is returned.Source§fn to_i8(&self) -> Option<i8>
fn to_i8(&self) -> Option<i8>
Converts the value of
self to an i8. If the value cannot be
represented by an i8, then None is returned.Source§fn to_i16(&self) -> Option<i16>
fn to_i16(&self) -> Option<i16>
Converts the value of
self to an i16. If the value cannot be
represented by an i16, then None is returned.Source§fn to_i32(&self) -> Option<i32>
fn to_i32(&self) -> Option<i32>
Converts the value of
self to an i32. If the value cannot be
represented by an i32, then None is returned.Source§fn to_i128(&self) -> Option<i128>
fn to_i128(&self) -> Option<i128>
Converts the value of
self to an i128. If the value cannot be
represented by an i128 (i64 under the default implementation), then
None is returned. Read moreSource§fn to_usize(&self) -> Option<usize>
fn to_usize(&self) -> Option<usize>
Converts the value of
self to a usize. If the value cannot be
represented by a usize, then None is returned.Source§fn to_u8(&self) -> Option<u8>
fn to_u8(&self) -> Option<u8>
Converts the value of
self to a u8. If the value cannot be
represented by a u8, then None is returned.Source§fn to_u16(&self) -> Option<u16>
fn to_u16(&self) -> Option<u16>
Converts the value of
self to a u16. If the value cannot be
represented by a u16, then None is returned.Source§fn to_u32(&self) -> Option<u32>
fn to_u32(&self) -> Option<u32>
Converts the value of
self to a u32. If the value cannot be
represented by a u32, then None is returned.Source§fn to_u128(&self) -> Option<u128>
fn to_u128(&self) -> Option<u128>
Converts the value of
self to a u128. If the value cannot be
represented by a u128 (u64 under the default implementation), then
None is returned. Read moreimpl Copy for Bit
impl Eq for Bit
impl StructuralPartialEq for Bit
Auto Trait Implementations§
impl Freeze for Bit
impl RefUnwindSafe for Bit
impl Send for Bit
impl Sync for Bit
impl Unpin for Bit
impl UnwindSafe for Bit
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more