pub struct TextTexture<'a> {
pub texture: SourceView<'a>,
pub width: u32,
pub height: u32,
pub margin: [u32; 2],
pub cache_key: Option<RenderCacheKey>,
pub background: Option<(SourceView<'a>, Option<RenderCacheKey>)>,
pub shadows: &'a [ShadowPixels],
}Expand description
One prepared text: its texture, pixel size and layout box position.
Fields§
§texture: SourceView<'a>Premultiplied, sRGB-encoded RGBA, as every source texture.
width: u32Width in pixels.
height: u32Height in pixels.
margin: [u32; 2]Per-axis pixel margin around the decorated text for overflowing ink (such as accents). Placement ignores it, so such ink never moves the text.
cache_key: Option<RenderCacheKey>Result cache key for this texture, or None to bypass the cache. Like
crate::FrameProvider::source_key, it promises the pixels depend on nothing else.
background: Option<(SourceView<'a>, Option<RenderCacheKey>)>Background boxes as a separate texture (with its cache key) when the text has both boxes
and shadows, since shadows lie between them. texture then holds no boxes.
shadows: &'a [ShadowPixels]Glyph shadows, first on top, in picture pixels.
Trait Implementations§
Source§impl<'a> Clone for TextTexture<'a>
impl<'a> Clone for TextTexture<'a>
impl<'a> Copy for TextTexture<'a>
Auto Trait Implementations§
impl<'a> !RefUnwindSafe for TextTexture<'a>
impl<'a> !UnwindSafe for TextTexture<'a>
impl<'a> Freeze for TextTexture<'a>
impl<'a> Send for TextTexture<'a>
impl<'a> Sync for TextTexture<'a>
impl<'a> Unpin for TextTexture<'a>
impl<'a> UnsafeUnpin for TextTexture<'a>
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more