#[repr(C)]pub struct Alpha<ColorTy: ColorType> {
pub color: ColorTy,
pub alpha: ColorTy::ComponentTy,
}
Expand description
A color with an alpha component.
The color components and alpha component are completely separate.
Fields
color: ColorTy
The contained color, which is completely separate from the alpha
value.
alpha: ColorTy::ComponentTy
The alpha component.
Trait Implementations
sourceimpl<BaseColorTy: ColorType> ColorType for Alpha<BaseColorTy>
impl<BaseColorTy: ColorType> ColorType for Alpha<BaseColorTy>
type ComponentTy = <BaseColorTy as ColorType>::ComponentTy
const SPACE: Spaces = BaseColorTy::SPACE
const NUM_COMPONENTS: usize = BaseColorTy::NUM_COMPONENTS + 1
sourceimpl<ComponentTy: Copy> From<Alpha<DciXYZPrime<ComponentTy>>> for DciXYZPrime<ComponentTy>
impl<ComponentTy: Copy> From<Alpha<DciXYZPrime<ComponentTy>>> for DciXYZPrime<ComponentTy>
sourcefn from(col_alpha: Alpha<DciXYZPrime<ComponentTy>>) -> DciXYZPrime<ComponentTy>
fn from(col_alpha: Alpha<DciXYZPrime<ComponentTy>>) -> DciXYZPrime<ComponentTy>
Converts to this type from the input type.
sourceimpl<ComponentTy: Copy> From<Alpha<EncodedBt2020<ComponentTy>>> for EncodedBt2020<ComponentTy>
impl<ComponentTy: Copy> From<Alpha<EncodedBt2020<ComponentTy>>> for EncodedBt2020<ComponentTy>
sourcefn from(
col_alpha: Alpha<EncodedBt2020<ComponentTy>>
) -> EncodedBt2020<ComponentTy>
fn from(
col_alpha: Alpha<EncodedBt2020<ComponentTy>>
) -> EncodedBt2020<ComponentTy>
Converts to this type from the input type.
sourceimpl<ComponentTy: Copy> From<Alpha<EncodedBt2100HLG<ComponentTy>>> for EncodedBt2100HLG<ComponentTy>
impl<ComponentTy: Copy> From<Alpha<EncodedBt2100HLG<ComponentTy>>> for EncodedBt2100HLG<ComponentTy>
sourcefn from(
col_alpha: Alpha<EncodedBt2100HLG<ComponentTy>>
) -> EncodedBt2100HLG<ComponentTy>
fn from(
col_alpha: Alpha<EncodedBt2100HLG<ComponentTy>>
) -> EncodedBt2100HLG<ComponentTy>
Converts to this type from the input type.
sourceimpl<ComponentTy: Copy> From<Alpha<EncodedBt2100PQ<ComponentTy>>> for EncodedBt2100PQ<ComponentTy>
impl<ComponentTy: Copy> From<Alpha<EncodedBt2100PQ<ComponentTy>>> for EncodedBt2100PQ<ComponentTy>
sourcefn from(
col_alpha: Alpha<EncodedBt2100PQ<ComponentTy>>
) -> EncodedBt2100PQ<ComponentTy>
fn from(
col_alpha: Alpha<EncodedBt2100PQ<ComponentTy>>
) -> EncodedBt2100PQ<ComponentTy>
Converts to this type from the input type.
sourceimpl<ComponentTy: Copy> From<Alpha<EncodedDisplayP3<ComponentTy>>> for EncodedDisplayP3<ComponentTy>
impl<ComponentTy: Copy> From<Alpha<EncodedDisplayP3<ComponentTy>>> for EncodedDisplayP3<ComponentTy>
sourcefn from(
col_alpha: Alpha<EncodedDisplayP3<ComponentTy>>
) -> EncodedDisplayP3<ComponentTy>
fn from(
col_alpha: Alpha<EncodedDisplayP3<ComponentTy>>
) -> EncodedDisplayP3<ComponentTy>
Converts to this type from the input type.
sourceimpl<ComponentTy: Copy> From<Alpha<EncodedRec709<ComponentTy>>> for EncodedRec709<ComponentTy>
impl<ComponentTy: Copy> From<Alpha<EncodedRec709<ComponentTy>>> for EncodedRec709<ComponentTy>
sourcefn from(
col_alpha: Alpha<EncodedRec709<ComponentTy>>
) -> EncodedRec709<ComponentTy>
fn from(
col_alpha: Alpha<EncodedRec709<ComponentTy>>
) -> EncodedRec709<ComponentTy>
Converts to this type from the input type.
sourceimpl<ComponentTy: Copy> From<Alpha<EncodedSrgb<ComponentTy>>> for EncodedSrgb<ComponentTy>
impl<ComponentTy: Copy> From<Alpha<EncodedSrgb<ComponentTy>>> for EncodedSrgb<ComponentTy>
sourcefn from(col_alpha: Alpha<EncodedSrgb<ComponentTy>>) -> EncodedSrgb<ComponentTy>
fn from(col_alpha: Alpha<EncodedSrgb<ComponentTy>>) -> EncodedSrgb<ComponentTy>
Converts to this type from the input type.
sourceimpl<ComponentTy: Copy> From<Alpha<GenericColor1<ComponentTy>>> for GenericColor1<ComponentTy>
impl<ComponentTy: Copy> From<Alpha<GenericColor1<ComponentTy>>> for GenericColor1<ComponentTy>
sourcefn from(
col_alpha: Alpha<GenericColor1<ComponentTy>>
) -> GenericColor1<ComponentTy>
fn from(
col_alpha: Alpha<GenericColor1<ComponentTy>>
) -> GenericColor1<ComponentTy>
Converts to this type from the input type.
sourceimpl<ComponentTy: Copy> From<Alpha<GenericColor3<ComponentTy>>> for GenericColor3<ComponentTy>
impl<ComponentTy: Copy> From<Alpha<GenericColor3<ComponentTy>>> for GenericColor3<ComponentTy>
sourcefn from(
col_alpha: Alpha<GenericColor3<ComponentTy>>
) -> GenericColor3<ComponentTy>
fn from(
col_alpha: Alpha<GenericColor3<ComponentTy>>
) -> GenericColor3<ComponentTy>
Converts to this type from the input type.
sourceimpl<ComponentTy: Copy> From<Alpha<LinearSrgb<ComponentTy>>> for LinearSrgb<ComponentTy>
impl<ComponentTy: Copy> From<Alpha<LinearSrgb<ComponentTy>>> for LinearSrgb<ComponentTy>
sourcefn from(col_alpha: Alpha<LinearSrgb<ComponentTy>>) -> LinearSrgb<ComponentTy>
fn from(col_alpha: Alpha<LinearSrgb<ComponentTy>>) -> LinearSrgb<ComponentTy>
Converts to this type from the input type.
sourceimpl<ComponentTy: Copy> From<Alpha<YPrimeCbCr<ComponentTy>>> for YPrimeCbCr<ComponentTy>
impl<ComponentTy: Copy> From<Alpha<YPrimeCbCr<ComponentTy>>> for YPrimeCbCr<ComponentTy>
sourcefn from(col_alpha: Alpha<YPrimeCbCr<ComponentTy>>) -> YPrimeCbCr<ComponentTy>
fn from(col_alpha: Alpha<YPrimeCbCr<ComponentTy>>) -> YPrimeCbCr<ComponentTy>
Converts to this type from the input type.
sourceimpl<ComponentTy: Copy> From<Alpha<YPrimePbPr<ComponentTy>>> for YPrimePbPr<ComponentTy>
impl<ComponentTy: Copy> From<Alpha<YPrimePbPr<ComponentTy>>> for YPrimePbPr<ComponentTy>
sourcefn from(col_alpha: Alpha<YPrimePbPr<ComponentTy>>) -> YPrimePbPr<ComponentTy>
fn from(col_alpha: Alpha<YPrimePbPr<ComponentTy>>) -> YPrimePbPr<ComponentTy>
Converts to this type from the input type.
sourceimpl<ColorTy: PartialEq + ColorType> PartialEq<Alpha<ColorTy>> for Alpha<ColorTy> where
ColorTy::ComponentTy: PartialEq,
impl<ColorTy: PartialEq + ColorType> PartialEq<Alpha<ColorTy>> for Alpha<ColorTy> where
ColorTy::ComponentTy: PartialEq,
impl<ColorTy: Copy + ColorType> Copy for Alpha<ColorTy> where
ColorTy::ComponentTy: Copy,
impl<ColorTy: Eq + ColorType> Eq for Alpha<ColorTy> where
ColorTy::ComponentTy: Eq,
impl<ColorTy: ColorType + Pod> Pod for Alpha<ColorTy>
impl<ColorTy: ColorType> StructuralEq for Alpha<ColorTy>
impl<ColorTy: ColorType> StructuralPartialEq for Alpha<ColorTy>
Auto Trait Implementations
impl<ColorTy> RefUnwindSafe for Alpha<ColorTy> where
ColorTy: RefUnwindSafe,
<ColorTy as ColorType>::ComponentTy: RefUnwindSafe,
impl<ColorTy> Send for Alpha<ColorTy> where
ColorTy: Send,
<ColorTy as ColorType>::ComponentTy: Send,
impl<ColorTy> Sync for Alpha<ColorTy> where
ColorTy: Sync,
<ColorTy as ColorType>::ComponentTy: Sync,
impl<ColorTy> Unpin for Alpha<ColorTy> where
ColorTy: Unpin,
<ColorTy as ColorType>::ComponentTy: Unpin,
impl<ColorTy> UnwindSafe for Alpha<ColorTy> where
ColorTy: UnwindSafe,
<ColorTy as ColorType>::ComponentTy: UnwindSafe,
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> CheckedBitPattern for T where
T: AnyBitPattern,
impl<T> CheckedBitPattern for T where
T: AnyBitPattern,
type Bits = T
type Bits = T
Self
must have the same layout as the specified Bits
except for
the possible invalid bit patterns being checked during is_valid_bit_pattern
. Read more
sourcefn is_valid_bit_pattern(_bits: &T) -> bool
fn is_valid_bit_pattern(_bits: &T) -> bool
If this function returns true, then it must be valid to reinterpret bits
as &Self
.