Interface IAtlasPacker
Packs glyph rectangles into texture atlas pages using a bin-packing algorithm.
public interface IAtlasPacker
Methods
Pack(IReadOnlyList<GlyphRect>, int, int)
Packs glyphs into pages that fit within the given max size.
PackResult Pack(IReadOnlyList<GlyphRect> glyphs, int maxWidth, int maxHeight)
Parameters
glyphsIReadOnlyList<GlyphRect>The glyph sizes to pack.
maxWidthintMax page width in pixels.
maxHeightintMax page height in pixels.
Returns
- PackResult
Where each glyph was placed and how many pages were needed.
PackInto(IReadOnlyList<GlyphRect>, IReadOnlyList<OccupiedRect>, int, int, int)
Packs new glyphs into pages of the given size where the occupied
regions are already taken. Existing regions are never moved; new pages may be added
beyond pageCount if the new glyphs don't fit. The returned
Placements cover only newGlyphs.
PackResult PackInto(IReadOnlyList<GlyphRect> newGlyphs, IReadOnlyList<OccupiedRect> occupied, int pageCount, int maxWidth, int maxHeight)
Parameters
newGlyphsIReadOnlyList<GlyphRect>The new glyph sizes to place.
occupiedIReadOnlyList<OccupiedRect>Regions already taken by existing glyphs.
pageCountintNumber of existing pages.
maxWidthintPage width in pixels.
maxHeightintPage height in pixels.
Returns
- PackResult
Where each new glyph was placed and the total page count after packing.
Exceptions
- NotSupportedException
The packer does not support incremental packing (the default).