pub struct ExtractedImage {
pub origin: Vec2,
pub size: Vec2,
pub width: u32,
pub height: u32,
pub rgba: Arc<[u8]>,
pub fit: ImageFit,
pub order: PaintOrder,
pub alpha: f32,
pub background: Option<BackgroundClip>,
}Expand description
One decoded image to render this frame in RGBA8 row-major pixels.
The renderer wraps rgba in a peniko::Blob whose stable identity keys the vello/wgpu upload cache across frames.
Fields§
§origin: Vec2Top-left in window coordinates.
size: Vec2Drawn size (the image is scaled into size according to Self::fit).
width: u32Source pixel width.
height: u32Source pixel height.
rgba: Arc<[u8]>RGBA8 pixels, width * height * 4 bytes.
fit: ImageFitHow the source image fits into the drawn rectangle.
order: PaintOrderGlobal paint order (see PaintOrder).
alpha: f32Alpha multiplier from crate::components::Opacity (1.0 when absent). Applied via push_layer at draw time so the whole image fades together.
background: Option<BackgroundClip>Some when the image is its element’s background (bg: url(...))
rather than an <image>. A background paints over the element’s fill
and under its border, at the element’s own PaintOrder.
Trait Implementations§
Source§impl Clone for ExtractedImage
impl Clone for ExtractedImage
Source§fn clone(&self) -> ExtractedImage
fn clone(&self) -> ExtractedImage
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Component for ExtractedImage
impl Component for ExtractedImage
Source§const STORAGE_TYPE: StorageType = bevy_ecs::component::StorageType::Table
const STORAGE_TYPE: StorageType = bevy_ecs::component::StorageType::Table
Source§type Mutability = Mutable
type Mutability = Mutable
Component<Mutability = Mutable>,
while immutable components will instead have Component<Mutability = Immutable>. Read moreSource§fn register_required_components(
_requiree: ComponentId,
required_components: &mut RequiredComponentsRegistrator<'_, '_>,
)
fn register_required_components( _requiree: ComponentId, required_components: &mut RequiredComponentsRegistrator<'_, '_>, )
Source§fn clone_behavior() -> ComponentCloneBehavior
fn clone_behavior() -> ComponentCloneBehavior
Source§fn relationship_accessor() -> Option<ComponentRelationshipAccessor<Self>>
fn relationship_accessor() -> Option<ComponentRelationshipAccessor<Self>>
ComponentRelationshipAccessor] required for working with relationships in dynamic contexts. Read more§fn on_discard() -> Option<for<'w> fn(DeferredWorld<'w>, HookContext)>
fn on_discard() -> Option<for<'w> fn(DeferredWorld<'w>, HookContext)>
§fn on_despawn() -> Option<for<'w> fn(DeferredWorld<'w>, HookContext)>
fn on_despawn() -> Option<for<'w> fn(DeferredWorld<'w>, HookContext)>
§fn map_entities<E>(_this: &mut Self, _mapper: &mut E)where
E: EntityMapper,
fn map_entities<E>(_this: &mut Self, _mapper: &mut E)where
E: EntityMapper,
EntityMapper. This is used to remap entities in contexts like scenes and entity cloning.
When deriving Component, this is populated by annotating fields containing entities with #[entities] Read more