pub struct PrimaryLayer {
pub image_metadata: ImageMetadata,
pub alpha_mode: AlphaMode,
pub alpha_layer_val: f32,
pub image_source_transformation: CoordinateTransformation,
pub image_source: RectU,
pub display_destination: RectU,
}
Fields§
§image_metadata: ImageMetadata
§alpha_mode: AlphaMode
If alpha_mode
is AlphaMode.DISABLE
, the layer is opaque and
alpha_layer_val
is ignored.
If alpha_mode
is AlphaMode.PREMULTIPLIED
or HW_MULTIPLY
, the
alpha used when blending is determined by the product of
alpha_layer_val
and any per-pixel alpha.
Additionally, if alpha_mode
is AlphaMode.PREMULTIPLIED
, then the
hardware must premultiply the color channel with alpha_layer_val
before blending.
alpha_layer_val
must be in the range [0, 1].
alpha_layer_val: f32
§image_source_transformation: CoordinateTransformation
Applied to the input image pixels specified by image_source
.
display_destination
must account for image dimensions changes caused
by rotations. For example, rotating a 600x300 pixel image by 90 degrees
would specify 300x600 pixel dimensions in display_destination
.
image_source: RectU
The associated image region whose pixels are drawn by the layer.
The rectangle uses the Vulkan coordinate space. The origin is at the image’s top-left corner. The X axis points to the right, and the Y axis points downwards.
A valid layer definition requires a valid non-empty image source rectangle that is entirely contained within the image.
Hardware image cropping is requested implicitly, when the source region’s dimensions differ from the image’s dimensions. Some display hardware may not support cropping.
display_destination: RectU
The display image (composited output) region occupied by the layer.
The rectangle uses the Vulkan coordinate space. The origin is at the display’s top-left corner. The X axis points to the right, and the Y axis points downwards.
A valid layer definition requires a valid non-empty display destination rectangle that is entirely contained within the display.
Hardware image scaling is requested implicitly, when the output region’s
dimensions differ from the dimensions of image_source
. Some display
hardware may not support scaling. All display hardware has limitations
in scaling support.
Trait Implementations§
source§impl Clone for PrimaryLayer
impl Clone for PrimaryLayer
source§fn clone(&self) -> PrimaryLayer
fn clone(&self) -> PrimaryLayer
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresource§impl Debug for PrimaryLayer
impl Debug for PrimaryLayer
source§impl<D: ResourceDialect> Decode<PrimaryLayer, D> for PrimaryLayer
impl<D: ResourceDialect> Decode<PrimaryLayer, D> for PrimaryLayer
source§impl<D: ResourceDialect> Encode<PrimaryLayer, D> for &PrimaryLayer
impl<D: ResourceDialect> Encode<PrimaryLayer, D> for &PrimaryLayer
source§impl<D: ResourceDialect, T0: Encode<ImageMetadata, D>, T1: Encode<AlphaMode, D>, T2: Encode<f32, D>, T3: Encode<CoordinateTransformation, D>, T4: Encode<RectU, D>, T5: Encode<RectU, D>> Encode<PrimaryLayer, D> for (T0, T1, T2, T3, T4, T5)
impl<D: ResourceDialect, T0: Encode<ImageMetadata, D>, T1: Encode<AlphaMode, D>, T2: Encode<f32, D>, T3: Encode<CoordinateTransformation, D>, T4: Encode<RectU, D>, T5: Encode<RectU, D>> Encode<PrimaryLayer, D> for (T0, T1, T2, T3, T4, T5)
source§impl PartialEq for PrimaryLayer
impl PartialEq for PrimaryLayer
source§fn eq(&self, other: &PrimaryLayer) -> bool
fn eq(&self, other: &PrimaryLayer) -> bool
self
and other
values to be equal, and is used
by ==
.source§impl TypeMarker for PrimaryLayer
impl TypeMarker for PrimaryLayer
§type Owned = PrimaryLayer
type Owned = PrimaryLayer
source§fn inline_align(_context: Context) -> usize
fn inline_align(_context: Context) -> usize
source§fn inline_size(_context: Context) -> usize
fn inline_size(_context: Context) -> usize
inline_align
.§fn encode_is_copy() -> bool
fn encode_is_copy() -> bool
Self::Owned
matches the FIDL wire
format and encoding requires no validation. When true, we can optimize
encoding arrays and vectors of Self::Owned
to a single memcpy. Read more§fn decode_is_copy() -> bool
fn decode_is_copy() -> bool
Self::Owned
matches the FIDL wire
format and decoding requires no validation. When true, we can optimize
decoding arrays and vectors of Self::Owned
to a single memcpy.source§impl ValueTypeMarker for PrimaryLayer
impl ValueTypeMarker for PrimaryLayer
§type Borrowed<'a> = &'a PrimaryLayer
type Borrowed<'a> = &'a PrimaryLayer
Encode<Self>
type cheaply obtainable from &Self::Owned
. There are three cases: Read moreimpl Persistable for PrimaryLayer
impl StructuralPartialEq for PrimaryLayer
Auto Trait Implementations§
impl Freeze for PrimaryLayer
impl RefUnwindSafe for PrimaryLayer
impl Send for PrimaryLayer
impl Sync for PrimaryLayer
impl Unpin for PrimaryLayer
impl UnwindSafe for PrimaryLayer
Blanket Implementations§
§impl<T> Body for Twhere
T: Persistable,
impl<T> Body for Twhere
T: Persistable,
§type MarkerAtTopLevel = T
type MarkerAtTopLevel = T
§type MarkerInResultUnion = T
type MarkerInResultUnion = T
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
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§default unsafe fn clone_to_uninit(&self, dst: *mut T)
default unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)