class
Tessell::Text::Rasterizer
- Tessell::Text::Rasterizer
- Reference
- Object
Defined in:
tessell/text/rasterizer.crConstructors
Instance Method Summary
- #atlas : GlyphAtlas
- #begin_frame : Nil
-
#coverage(p : GlyphPlacement) : Int32
Alpha coverage of a placement: number of pixels with value > 0 in the atlas slot.
- #end_frame : Nil
- #evict_run_lru(count : Int32 = 1) : Int32
- #hits : Int32
- #in_run_frame? : Bool
- #misses : Int32
- #rasterize(text : String, size_px : Int32) : Array(GlyphPlacement)
-
#rasterize_into(text : String, size_px : Int32, sink : Array(GlyphPlacement)) : Nil
Non-allocating w.r.t.
- #rasters : Int32
- #run_cache_size : Int32
-
#shape_run_into(text : String, size_px : Int32, sink : Array(GlyphPlacement)) : Int32
Zero-allocation entry for shaped run reuse.
- #stats : NamedTuple(hits: Int32, misses: Int32, rasters: Int32)
Constructor Detail
def self.new(measurer : FtMeasurer, atlas : GlyphAtlas, font_id : Int32 = 0, run_cache_capacity : Int32 = 256, color_enabled : Bool = false)
#
Instance Method Detail
def coverage(p : GlyphPlacement) : Int32
#
Alpha coverage of a placement: number of pixels with value > 0 in the atlas slot. Color placements read the RGBA page alpha byte (4B/px); gray placements read the R8 coverage byte (1B/px) as before.
def rasterize_into(text : String, size_px : Int32, sink : Array(GlyphPlacement)) : Nil
#
Non-allocating w.r.t. Array object: reuses sink (clear + push). Caller should pre-size/capacity-reuse sink across calls for zero-allocation steady path. Preserves per-glyph atlas hit/miss/raster stats semantics (HB/FT path each call).
def shape_run_into(text : String, size_px : Int32, sink : Array(GlyphPlacement)) : Int32
#
Zero-allocation entry for shaped run reuse. On hit: copies cached placements into sink (no HB/FT shaping). Returns number of placements written.