Struct dotrix_egui::Texture [−]
pub struct Texture {
pub version: u64,
pub width: usize,
pub height: usize,
pub pixels: Vec<u8, Global>,
}
Expand description
An 8-bit texture containing font data.
Fields
version: u64
e.g. a hash of the data. Use this to detect changes! If the texture changes, this too will change.
width: usize
height: usize
pixels: Vec<u8, Global>
White color with the given alpha (linear space 0-255).
Implementations
impl Texture
impl Texture
pub fn srgba_pixels(&self, gamma: f32) -> impl Iterator<Item = Color32>
pub fn srgba_pixels(&self, gamma: f32) -> impl Iterator<Item = Color32>
Returns the textures as sRGBA
premultiplied pixels, row by row, top to bottom.
gamma
should normally be set to 1.0.
If you are having problems with egui text looking skinny and pixelated, try
setting a lower gamma, e.g. 0.5
.
Trait Implementations
Auto Trait Implementations
impl RefUnwindSafe for Texture
impl UnwindSafe for Texture
Blanket Implementations
Mutably borrows from an owned value. Read more
Instruments this type with the provided Span
, returning an
Instrumented
wrapper. Read more