Package icyllis.arc3d.core

# Class ScalerContext

java.lang.Object
icyllis.arc3d.core.ScalerContext

Direct Known Subclasses:
  `ScalerContext_JDK`

public abstract class ScalerContext extends Object
The ScalerContext controls the rasterization with a specified typeface and rasterization options.

This class is not thread safe, even it is stateless.

- ## Nested Class Summary

  Nested Classes
  Modifier and Type
  Class
  Description
  `static class`
  `ScalerContext.GlyphMetrics`

- ## Field Summary

  Fields
  Modifier and Type
  Field
  Description
  `protected final StrikeDesc`
  `mDesc`

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `ScalerContext(Typeface typeface, StrikeDesc desc)`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `protected abstract void`
  `generateImage(Glyph glyph, Object imageBase, long imageAddress)`
  Generates the contents of glyph.fImage.
  `protected abstract ScalerContext.GlyphMetrics`
  `generateMetrics(Glyph glyph)`
  `protected abstract boolean`
  `generatePath(Glyph glyph, Path dst)`
  Sets the passed path to the glyph outline.
  `final void`
  `getImage(Glyph glyph)`
  `final byte`
  `getMaskFormat()`
  `final void`
  `getPath(Glyph glyph)`
  `final Typeface`
  `getTypeface()`
  `final boolean`
  `isLinearMetrics()`
  `final Glyph`
  `makeGlyph(int glyphID)`

  ### Methods inherited from class java.lang.Object

  `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- ## Field Details

  - ### mDesc

    protected final StrikeDesc mDesc

- ## Constructor Details

  - ### ScalerContext

    public ScalerContext(Typeface typeface, StrikeDesc desc)

- ## Method Details

  - ### getTypeface

    public final Typeface getTypeface()

  - ### getMaskFormat

    public final byte getMaskFormat()

  - ### isLinearMetrics

    public final boolean isLinearMetrics()

  - ### makeGlyph

    @Nonnull public final Glyph makeGlyph(int glyphID)

  - ### getImage

    public final void getImage(Glyph glyph)

  - ### getPath

    public final void getPath(@Nonnull Glyph glyph)

  - ### generateMetrics

    protected abstract ScalerContext.GlyphMetrics generateMetrics(Glyph glyph)

  - ### generateImage

    protected abstract void generateImage(Glyph glyph, Object imageBase, long imageAddress)
    Generates the contents of glyph.fImage. When called, glyph.fImage will be pointing to a pre-allocated, uninitialized region of memory of size glyph.imageSize(). This method may not change glyph.fMaskFormat.

    Because glyph.imageSize() will determine the size of fImage, generateMetrics will be called before generateImage.

  - ### generatePath

    protected abstract boolean generatePath(Glyph glyph, Path dst)
    Sets the passed path to the glyph outline. If this cannot be done the path is set to empty; Does not apply subpixel positioning to the path.
    Returns:
      false if this glyph does not have any path.