Package icyllis.arc3d.granite

# Class PaintParams

java.lang.Object
icyllis.arc3d.granite.PaintParams

All Implemented Interfaces:
  `AutoCloseable`

public final class PaintParams extends Object implements AutoCloseable
Parameters used for shading.

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `PaintParams(Paint paint, @SharedPtr Blender primitiveBlender)`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `float`
  `a()`
  Returns the value of the alpha component, in sRGB space.
  `void`
  `appendToKey(KeyContext keyContext, KeyBuilder keyBuilder, UniformDataGatherer uniformDataGatherer, TextureDataGatherer textureDataGatherer)`
  `float`
  `b()`
  Returns the value of the blue component, in sRGB space.
  `void`
  `close()`
  `float`
  `g()`
  Returns the value of the green component, in sRGB space.
  `@RawPtr ColorFilter`
  `getColorFilter()`
  `@RawPtr Blender`
  `getFinalBlender()`
  `BlendMode`
  `getFinalBlendMode()`
  `@RawPtr Blender`
  `getPrimitiveBlender()`
  `@RawPtr Shader`
  `getShader()`
  `boolean`
  `getSolidColor(ImageInfo targetInfo, float[] outColor)`
  Returns true if the paint can be simplified to a solid color, and stores the solid color.
  `static boolean`
  `getSolidColor(Paint paint, ImageInfo targetInfo, float[] outColor)`
  Similar to `getSolidColor(ImageInfo, float[])`, without a PaintParams instance.
  `boolean`
  `isSolidColor()`
  Returns true if the paint can be simplified to a solid color, and stores the solid color.
  `static float[]`
  `prepareColorForDst(float[] color, ImageInfo dstInfo, boolean copyOnWrite)`
  Map into destination color space, in color and result color are non-premultiplied.
  `float`
  `r()`
  Returns the value of the red component, in sRGB space.

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

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

- ## Constructor Details

  - ### PaintParams

    public PaintParams(@Nonnull Paint paint, @Nullable @SharedPtr @SharedPtr Blender primitiveBlender)

- ## Method Details

  - ### close

    public void close()
    Specified by:
      `close` in interface `AutoCloseable`

  - ### r

    public float r()
    Returns the value of the red component, in sRGB space.

  - ### g

    public float g()
    Returns the value of the green component, in sRGB space.

  - ### b

    public float b()
    Returns the value of the blue component, in sRGB space.

  - ### a

    public float a()
    Returns the value of the alpha component, in sRGB space.

  - ### getShader

    @RawPtr public @RawPtr Shader getShader()

  - ### getColorFilter

    @RawPtr public @RawPtr ColorFilter getColorFilter()

  - ### getFinalBlender

    @RawPtr public @RawPtr Blender getFinalBlender()

  - ### getPrimitiveBlender

    @RawPtr public @RawPtr Blender getPrimitiveBlender()

  - ### getFinalBlendMode

    @Nonnull public BlendMode getFinalBlendMode()

  - ### prepareColorForDst

    public static float[] prepareColorForDst(float[] color, ImageInfo dstInfo, boolean copyOnWrite)
    Map into destination color space, in color and result color are non-premultiplied.

  - ### isSolidColor

    public boolean isSolidColor()
    Returns true if the paint can be simplified to a solid color, and stores the solid color.

  - ### getSolidColor

    public boolean getSolidColor(ImageInfo targetInfo, @Nullable float[] outColor)
    Returns true if the paint can be simplified to a solid color, and stores the solid color. The color will be transformed to the target's color space and premultiplied.

  - ### getSolidColor

    public static boolean getSolidColor(Paint paint, ImageInfo targetInfo, float[] outColor)
    Similar to `getSolidColor(ImageInfo, float[])`, without a PaintParams instance.

  - ### appendToKey

    public void appendToKey(KeyContext keyContext, KeyBuilder keyBuilder, UniformDataGatherer uniformDataGatherer, TextureDataGatherer textureDataGatherer)