[−][src]Struct luminance_glyph::GlyphBrush
Object allowing glyph drawing, containing cache state. Manages glyph positioning cacheing, glyph draw caching & efficient GPU texture cache updating and re-sizing on demand.
Build using a GlyphBrushBuilder
.
Implementations
impl<B, F: Font, H: BuildHasher> GlyphBrush<B, F, H> where
[[f32; 4]; 4]: Uniformable<B>,
TextureBinding<Dim2, NormUnsigned>: Uniformable<B>,
B: Texture<Dim2, NormR8UI> + Shader + Tess<(), u32, Instance, Interleaved>,
[src]
[[f32; 4]; 4]: Uniformable<B>,
TextureBinding<Dim2, NormUnsigned>: Uniformable<B>,
B: Texture<Dim2, NormR8UI> + Shader + Tess<(), u32, Instance, Interleaved>,
pub fn queue<'a, S>(&mut self, section: S) where
S: Into<Cow<'a, Section<'a>>>,
[src]
S: Into<Cow<'a, Section<'a>>>,
Queues a section/layout to be drawn by the next call of
draw_queued
. Can be
called multiple times to queue multiple sections for drawing.
Benefits from caching, see caching behaviour.
pub fn queue_custom_layout<'a, S, G>(&mut self, section: S, custom_layout: &G) where
G: GlyphPositioner,
S: Into<Cow<'a, Section<'a>>>,
[src]
G: GlyphPositioner,
S: Into<Cow<'a, Section<'a>>>,
Queues a section/layout to be drawn by the next call of
draw_queued
. Can be
called multiple times to queue multiple sections for drawing.
Used to provide custom GlyphPositioner
logic, if using built-in
Layout
simply use
queue
Benefits from caching, see caching behaviour.
pub fn queue_pre_positioned(
&mut self,
glyphs: Vec<SectionGlyph>,
extra: Vec<Extra>,
bounds: Rect
)
[src]
&mut self,
glyphs: Vec<SectionGlyph>,
extra: Vec<Extra>,
bounds: Rect
)
Queues pre-positioned glyphs to be processed by the next call of
draw_queued
. Can be
called multiple times.
pub fn keep_cached_custom_layout<'a, S, G>(
&mut self,
section: S,
custom_layout: &G
) where
S: Into<Cow<'a, Section<'a>>>,
G: GlyphPositioner,
[src]
&mut self,
section: S,
custom_layout: &G
) where
S: Into<Cow<'a, Section<'a>>>,
G: GlyphPositioner,
Retains the section in the cache as if it had been used in the last draw-frame.
Should not be necessary unless using multiple draws per frame with distinct transforms, see caching behaviour.
pub fn keep_cached<'a, S>(&mut self, section: S) where
S: Into<Cow<'a, Section<'a>>>,
[src]
S: Into<Cow<'a, Section<'a>>>,
Retains the section in the cache as if it had been used in the last draw-frame.
Should not be necessary unless using multiple draws per frame with distinct transforms, see caching behaviour.
pub fn fonts(&self) -> &[F]
[src]
Returns the available fonts.
The FontId
corresponds to the index of the font data.
pub fn add_font(&mut self, font: F) -> FontId
[src]
Adds an additional font to the one(s) initially added on build.
Returns a new FontId
to reference this font.
impl<B, F: Font + Sync, H: BuildHasher> GlyphBrush<B, F, H> where
[[f32; 4]; 4]: Uniformable<B>,
TextureBinding<Dim2, NormUnsigned>: Uniformable<B>,
B: Texture<Dim2, NormR8UI> + PipelineBase + Tess<(), u32, Instance, Interleaved> + PipelineTexture<Dim2, NormR8UI> + RenderGate + TessGate<(), u32, Instance, Interleaved>,
[src]
[[f32; 4]; 4]: Uniformable<B>,
TextureBinding<Dim2, NormUnsigned>: Uniformable<B>,
B: Texture<Dim2, NormR8UI> + PipelineBase + Tess<(), u32, Instance, Interleaved> + PipelineTexture<Dim2, NormR8UI> + RenderGate + TessGate<(), u32, Instance, Interleaved>,
pub fn draw_queued<'a>(
&mut self,
pipeline: &mut LuminancePipeline<'a, B>,
shading_gate: &mut ShadingGate<'a, B>,
target_width: u32,
target_height: u32
) -> Result<(), PipelineError>
[src]
&mut self,
pipeline: &mut LuminancePipeline<'a, B>,
shading_gate: &mut ShadingGate<'a, B>,
target_width: u32,
target_height: u32
) -> Result<(), PipelineError>
Draws all queued sections onto a render target.
See queue
.
Trims the cache, see caching behaviour.
Panics
Panics if the provided target
has a texture format that does not match
the render_format
provided on creation of the GlyphBrush
.
pub fn draw_queued_with_transform<'a>(
&mut self,
pipeline: &mut LuminancePipeline<'a, B>,
shading_gate: &mut ShadingGate<'a, B>,
transform: [f32; 16]
) -> Result<(), PipelineError>
[src]
&mut self,
pipeline: &mut LuminancePipeline<'a, B>,
shading_gate: &mut ShadingGate<'a, B>,
transform: [f32; 16]
) -> Result<(), PipelineError>
Draws all queued sections onto a render target, applying a position
transform (e.g. a projection).
See queue
.
Trims the cache, see caching behaviour.
Panics
Panics if the provided target
has a texture format that does not match
the render_format
provided on creation of the GlyphBrush
.
pub fn draw_queued_with_transform_and_scissoring<'a>(
&mut self,
pipeline: &mut LuminancePipeline<'a, B>,
shading_gate: &mut ShadingGate<'a, B>,
transform: [f32; 16],
region: Region
) -> Result<(), PipelineError>
[src]
&mut self,
pipeline: &mut LuminancePipeline<'a, B>,
shading_gate: &mut ShadingGate<'a, B>,
transform: [f32; 16],
region: Region
) -> Result<(), PipelineError>
Draws all queued sections onto a render target, applying a position
transform (e.g. a projection) and a scissoring region.
See queue
.
Trims the cache, see caching behaviour.
Panics
Panics if the provided target
has a texture format that does not match
the render_format
provided on creation of the GlyphBrush
.
pub fn process_queued<C>(&mut self, context: &mut C) where
C: GraphicsContext<Backend = B>,
[src]
C: GraphicsContext<Backend = B>,
Trait Implementations
impl<B, F, H> Debug for GlyphBrush<B, F, H> where
[[f32; 4]; 4]: Uniformable<B>,
TextureBinding<Dim2, NormUnsigned>: Uniformable<B>,
B: Texture<Dim2, NormR8UI> + Shader + Tess<(), u32, Instance, Interleaved>,
[src]
[[f32; 4]; 4]: Uniformable<B>,
TextureBinding<Dim2, NormUnsigned>: Uniformable<B>,
B: Texture<Dim2, NormR8UI> + Shader + Tess<(), u32, Instance, Interleaved>,
impl<B, F: Font, H: BuildHasher> GlyphCruncher<F, Extra> for GlyphBrush<B, F, H> where
[[f32; 4]; 4]: Uniformable<B>,
TextureBinding<Dim2, NormUnsigned>: Uniformable<B>,
B: Texture<Dim2, NormR8UI> + Shader + Tess<(), u32, Instance, Interleaved>,
[src]
[[f32; 4]; 4]: Uniformable<B>,
TextureBinding<Dim2, NormUnsigned>: Uniformable<B>,
B: Texture<Dim2, NormR8UI> + Shader + Tess<(), u32, Instance, Interleaved>,
pub fn glyphs_custom_layout<'a, 'b, S, L>(
&'b mut self,
section: S,
custom_layout: &L
) -> SectionGlyphIter<'b> where
L: GlyphPositioner + Hash,
S: Into<Cow<'a, Section<'a>>>,
[src]
&'b mut self,
section: S,
custom_layout: &L
) -> SectionGlyphIter<'b> where
L: GlyphPositioner + Hash,
S: Into<Cow<'a, Section<'a>>>,
pub fn glyph_bounds_custom_layout<'a, S, L>(
&mut self,
section: S,
custom_layout: &L
) -> Option<Rect> where
L: GlyphPositioner + Hash,
S: Into<Cow<'a, Section<'a>>>,
[src]
&mut self,
section: S,
custom_layout: &L
) -> Option<Rect> where
L: GlyphPositioner + Hash,
S: Into<Cow<'a, Section<'a>>>,
pub fn fonts(&self) -> &[F]
[src]
pub fn glyphs<'a, S>(&'b mut self, section: S) -> Iter<'b, SectionGlyph> where
S: Into<Cow<'a, Section<'a, X>>>,
X: 'a,
[src]
S: Into<Cow<'a, Section<'a, X>>>,
X: 'a,
pub fn glyph_bounds<'a, S>(&mut self, section: S) -> Option<Rect> where
S: Into<Cow<'a, Section<'a, X>>>,
X: 'a,
[src]
S: Into<Cow<'a, Section<'a, X>>>,
X: 'a,
Auto Trait Implementations
impl<B: ?Sized, F, H> RefUnwindSafe for GlyphBrush<B, F, H> where
F: RefUnwindSafe,
H: RefUnwindSafe,
<B as Shader>::ProgramRepr: RefUnwindSafe,
<B as Tess<(), u32, Instance, Interleaved>>::TessRepr: RefUnwindSafe,
<B as TextureBase>::TextureRepr: RefUnwindSafe,
F: RefUnwindSafe,
H: RefUnwindSafe,
<B as Shader>::ProgramRepr: RefUnwindSafe,
<B as Tess<(), u32, Instance, Interleaved>>::TessRepr: RefUnwindSafe,
<B as TextureBase>::TextureRepr: RefUnwindSafe,
impl<B, F = FontArc, H = RandomXxHashBuilder64> !Send for GlyphBrush<B, F, H>
impl<B, F = FontArc, H = RandomXxHashBuilder64> !Sync for GlyphBrush<B, F, H>
impl<B: ?Sized, F, H> Unpin for GlyphBrush<B, F, H> where
F: Unpin,
H: Unpin,
<B as Shader>::ProgramRepr: Unpin,
<B as Tess<(), u32, Instance, Interleaved>>::TessRepr: Unpin,
<B as TextureBase>::TextureRepr: Unpin,
F: Unpin,
H: Unpin,
<B as Shader>::ProgramRepr: Unpin,
<B as Tess<(), u32, Instance, Interleaved>>::TessRepr: Unpin,
<B as TextureBase>::TextureRepr: Unpin,
impl<B: ?Sized, F, H> UnwindSafe for GlyphBrush<B, F, H> where
F: UnwindSafe,
H: UnwindSafe,
<B as Shader>::ProgramRepr: UnwindSafe,
<B as Tess<(), u32, Instance, Interleaved>>::TessRepr: UnwindSafe,
<B as TextureBase>::TextureRepr: UnwindSafe,
F: UnwindSafe,
H: UnwindSafe,
<B as Shader>::ProgramRepr: UnwindSafe,
<B as Tess<(), u32, Instance, Interleaved>>::TessRepr: UnwindSafe,
<B as TextureBase>::TextureRepr: UnwindSafe,
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> Pointable for T
pub const ALIGN: usize
type Init = T
The type for initializers.
pub unsafe fn init(init: <T as Pointable>::Init) -> usize
pub unsafe fn deref<'a>(ptr: usize) -> &'a T
pub unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T
pub unsafe fn drop(ptr: usize)
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
pub fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,