Struct bevy_retrograde::core::image::Rgb [−]
Expand description
RGB colors
Trait Implementations
type Subpixel = T
type Subpixel = T
The underlying subpixel type.
pub const CHANNEL_COUNT: u8
pub const CHANNEL_COUNT: u8
The number of channels of this pixel type.
pub const COLOR_MODEL: &'static str
pub const COLOR_MODEL: &'static str
pub const COLOR_TYPE: ColorType
pub const COLOR_TYPE: ColorType
ColorType for this pixel format
Returns the components as a slice.
Returns the components as a mutable slice
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 Read more
pub fn from_channels(a: T, b: T, c: T, d: T) -> Rgb<T>
pub fn from_channels(a: T, b: T, c: T, d: T) -> Rgb<T>
Construct a pixel from the 4 channels a, b, c and d. If the pixel does not contain 4 channels the extra are ignored. Read more
pub fn from_slice(slice: &[T]) -> &Rgb<T>
pub fn from_slice(slice: &[T]) -> &Rgb<T>
Returns a view into a slice. Read more
pub fn from_slice_mut(slice: &mut [T]) -> &mut Rgb<T>
pub fn from_slice_mut(slice: &mut [T]) -> &mut Rgb<T>
Returns mutable view into a mutable slice. Read more
pub fn to_luma_alpha(&self) -> LumaA<T>
pub fn to_luma_alpha(&self) -> LumaA<T>
Convert this pixel to luma with an alpha channel
Apply the function f
to each channel of this pixel.
Apply the function f
to each channel of this pixel.
pub fn map_with_alpha<F, G>(&self, f: F, g: G) -> Rgb<T> where
F: FnMut(T) -> T,
G: FnMut(T) -> T,
pub fn map_with_alpha<F, G>(&self, f: F, g: G) -> Rgb<T> where
F: FnMut(T) -> T,
G: FnMut(T) -> T,
Apply the function f
to each channel except the alpha channel.
Apply the function g
to the alpha channel. Read more
pub fn apply_with_alpha<F, G>(&mut self, f: F, g: G) where
F: FnMut(T) -> T,
G: FnMut(T) -> T,
pub fn apply_with_alpha<F, G>(&mut self, f: F, g: G) where
F: FnMut(T) -> T,
G: FnMut(T) -> T,
Apply the function f
to each channel except the alpha channel.
Apply the function g
to the alpha channel. Works in-place. Read more
Apply the function f
to each channel of this pixel and
other
pairwise. Read more
Apply the function f
to each channel of this pixel and
other
pairwise. Works in-place. Read more
pub fn invert(&mut self)
pub fn invert(&mut self)
Invert this pixel
Blend the color of a given pixel into ourself, taking into account alpha channels
fn channel_count() -> u8
fn channel_count() -> u8
please use CHANNEL_COUNT associated constant
Returns the number of channels of this pixel type.
fn color_model() -> &'static str
fn color_model() -> &'static str
please use COLOR_MODEL associated constant
fn color_type() -> ColorType
fn color_type() -> ColorType
please use COLOR_TYPE associated constant
Returns the ColorType for this pixel format
fn map_without_alpha<F>(&self, f: F) -> Self where
F: FnMut(Self::Subpixel) -> Self::Subpixel,
fn map_without_alpha<F>(&self, f: F) -> Self where
F: FnMut(Self::Subpixel) -> Self::Subpixel,
Apply the function f
to each channel except the alpha channel.
fn apply_without_alpha<F>(&mut self, f: F) where
F: FnMut(Self::Subpixel) -> Self::Subpixel,
fn apply_without_alpha<F>(&mut self, f: F) where
F: FnMut(Self::Subpixel) -> Self::Subpixel,
Apply the function f
to each channel except the alpha channel.
Works in place. Read more
impl<T> StructuralEq for Rgb<T> where
T: Primitive,
impl<T> StructuralPartialEq for Rgb<T> where
T: Primitive,
Auto Trait Implementations
impl<T> RefUnwindSafe for Rgb<T> where
T: RefUnwindSafe,
impl<T> UnwindSafe for Rgb<T> where
T: UnwindSafe,
Blanket Implementations
Mutably borrows from an owned value. Read more
impl<T> Downcast for T where
T: Any,
impl<T> Downcast for T where
T: Any,
Convert Box<dyn Trait>
(where Trait: Downcast
) to Box<dyn Any>
. Box<dyn Any>
can
then be further downcast
into Box<ConcreteType>
where ConcreteType
implements Trait
. Read more
pub fn into_any_rc(self: Rc<T>) -> Rc<dyn Any + 'static>
pub fn into_any_rc(self: Rc<T>) -> Rc<dyn Any + 'static>
Convert Rc<Trait>
(where Trait: Downcast
) to Rc<Any>
. Rc<Any>
can then be
further downcast
into Rc<ConcreteType>
where ConcreteType
implements Trait
. Read more
Convert &Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &Any
’s vtable from &Trait
’s. Read more
pub fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
pub fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Convert &mut Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &mut Any
’s vtable from &mut Trait
’s. Read more
impl<T> DynHash for T where
T: DynEq + Hash,
impl<T> DynHash for T where
T: DynEq + Hash,
Compare self to key
and return true
if they are equal.
Instruments this type with the provided Span
, returning an
Instrumented
wrapper. Read more
pub fn clone_type_data(&self) -> Box<dyn TypeData + 'static, Global>
pub fn vzip(self) -> V