Package icyllis.arc3d.granite

# Class FragmentHelpers

java.lang.Object
icyllis.arc3d.granite.FragmentHelpers

public class FragmentHelpers extends Object
Build `PaintParamsKey` and collect uniform data and texture sampler desc.

See Also:
  - `ShaderCodeSource`
  - `FragmentStage`

- ## Nested Class Summary

  Nested Classes
  Modifier and Type
  Class
  Description
  `static class`
  `FragmentHelpers.GradientData`

- ## Field Summary

  Fields
  Modifier and Type
  Field
  Description
  `static final int`
  `kCubicClampPremul`
  `static final int`
  `kCubicClampUnpremul`
  `static final ColorSpace.Rgb.TransferParameters`
  `LINEAR_TRANSFER_PARAMETERS`

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `FragmentHelpers()`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `static void`
  `appendAlphaOnlyPaintColorBlock(KeyContext keyContext, KeyBuilder keyBuilder, UniformDataGatherer uniformDataGatherer, TextureDataGatherer textureDataGatherer)`
  `static void`
  `appendBlendMode(KeyContext keyContext, KeyBuilder keyBuilder, UniformDataGatherer uniformDataGatherer, TextureDataGatherer textureDataGatherer, BlendMode bm)`
  `static void`
  `appendColorSpaceUniforms(ColorSpace srcCS, int srcAT, ColorSpace dstCS, int dstAT, UniformDataGatherer uniformDataGatherer)`
  Compute color space transform parameters and add uniforms, see `PixelUtils`.
  `static void`
  `appendDitherShaderBlock(KeyContext keyContext, KeyBuilder keyBuilder, UniformDataGatherer uniformDataGatherer, TextureDataGatherer textureDataGatherer, float range)`
  `static void`
  `appendFixedBlendMode(KeyContext keyContext, KeyBuilder keyBuilder, UniformDataGatherer uniformDataGatherer, TextureDataGatherer textureDataGatherer, BlendMode bm)`
  `static void`
  `appendGradientShaderBlock(KeyContext keyContext, KeyBuilder keyBuilder, UniformDataGatherer uniformDataGatherer, TextureDataGatherer textureDataGatherer, FragmentHelpers.GradientData gradData)`
  `static void`
  `appendImageShaderBlock(KeyContext keyContext, KeyBuilder keyBuilder, UniformDataGatherer uniformDataGatherer, TextureDataGatherer textureDataGatherer, Rect2fc subset, int tileModeX, int tileModeY, SamplingOptions sampling, int imageWidth, int imageHeight, int srcAT, @SharedPtr ImageViewProxy view)`
  `static void`
  `appendLocalMatrixShaderBlock(KeyContext keyContext, KeyBuilder keyBuilder, UniformDataGatherer uniformDataGatherer, TextureDataGatherer textureDataGatherer, Matrixc localMatrix)`
  `static void`
  `appendPrimitiveColorBlock(KeyContext keyContext, KeyBuilder keyBuilder, UniformDataGatherer uniformDataGatherer, TextureDataGatherer textureDataGatherer)`
  `static void`
  `appendRGBOpaquePaintColorBlock(KeyContext keyContext, KeyBuilder keyBuilder, UniformDataGatherer uniformDataGatherer, TextureDataGatherer textureDataGatherer)`
  `static void`
  `appendSolidColorShaderBlock(KeyContext keyContext, KeyBuilder keyBuilder, UniformDataGatherer uniformDataGatherer, TextureDataGatherer textureDataGatherer, float r, float g, float b, float a)`
  `static void`
  `appendToKey(KeyContext keyContext, KeyBuilder keyBuilder, UniformDataGatherer uniformDataGatherer, TextureDataGatherer textureDataGatherer, @RawPtr Blender blender)`
  `static void`
  `appendToKey(KeyContext keyContext, KeyBuilder keyBuilder, UniformDataGatherer uniformDataGatherer, TextureDataGatherer textureDataGatherer, @RawPtr ColorFilter colorFilter)`
  `static void`
  `appendToKey(KeyContext keyContext, KeyBuilder keyBuilder, UniformDataGatherer uniformDataGatherer, TextureDataGatherer textureDataGatherer, @RawPtr Shader shader)`
  Add implementation details, for the specified backend, of this Shader to the provided key.

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

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

- ## Field Details

  - ### LINEAR_TRANSFER_PARAMETERS

    public static final ColorSpace.Rgb.TransferParameters LINEAR_TRANSFER_PARAMETERS

  - ### kCubicClampUnpremul

    public static final int kCubicClampUnpremul
    See Also:
      - Constant Field Values

  - ### kCubicClampPremul

    public static final int kCubicClampPremul
    See Also:
      - Constant Field Values

- ## Constructor Details

  - ### FragmentHelpers

    public FragmentHelpers()

- ## Method Details

  - ### appendColorSpaceUniforms

    public static void appendColorSpaceUniforms(@Nullable ColorSpace srcCS, int srcAT, @Nullable ColorSpace dstCS, int dstAT, UniformDataGatherer uniformDataGatherer)
    Compute color space transform parameters and add uniforms, see `PixelUtils`.

  - ### appendSolidColorShaderBlock

    public static void appendSolidColorShaderBlock(KeyContext keyContext, KeyBuilder keyBuilder, UniformDataGatherer uniformDataGatherer, TextureDataGatherer textureDataGatherer, float r, float g, float b, float a)

  - ### appendRGBOpaquePaintColorBlock

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

  - ### appendAlphaOnlyPaintColorBlock

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

  - ### appendDitherShaderBlock

    public static void appendDitherShaderBlock(KeyContext keyContext, KeyBuilder keyBuilder, UniformDataGatherer uniformDataGatherer, TextureDataGatherer textureDataGatherer, float range)

  - ### appendLocalMatrixShaderBlock

    public static void appendLocalMatrixShaderBlock(KeyContext keyContext, KeyBuilder keyBuilder, UniformDataGatherer uniformDataGatherer, TextureDataGatherer textureDataGatherer, Matrixc localMatrix)

  - ### appendImageShaderBlock

    public static void appendImageShaderBlock(KeyContext keyContext, KeyBuilder keyBuilder, UniformDataGatherer uniformDataGatherer, TextureDataGatherer textureDataGatherer, Rect2fc subset, int tileModeX, int tileModeY, SamplingOptions sampling, int imageWidth, int imageHeight, int srcAT, @SharedPtr @SharedPtr ImageViewProxy view)

  - ### appendGradientShaderBlock

    public static void appendGradientShaderBlock(KeyContext keyContext, KeyBuilder keyBuilder, UniformDataGatherer uniformDataGatherer, TextureDataGatherer textureDataGatherer, FragmentHelpers.GradientData gradData)

  - ### appendBlendMode

    public static void appendBlendMode(KeyContext keyContext, KeyBuilder keyBuilder, UniformDataGatherer uniformDataGatherer, TextureDataGatherer textureDataGatherer, BlendMode bm)

  - ### appendFixedBlendMode

    public static void appendFixedBlendMode(KeyContext keyContext, KeyBuilder keyBuilder, UniformDataGatherer uniformDataGatherer, TextureDataGatherer textureDataGatherer, BlendMode bm)

  - ### appendPrimitiveColorBlock

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

  - ### appendToKey

    public static void appendToKey(KeyContext keyContext, KeyBuilder keyBuilder, UniformDataGatherer uniformDataGatherer, TextureDataGatherer textureDataGatherer, @RawPtr @RawPtr Shader shader)
    Add implementation details, for the specified backend, of this Shader to the provided key.
    Parameters:
      `keyContext` - backend context for key creation
      `keyBuilder` - builder for creating the key for this SkShader
      `shader` - This function is a no-op if shader is null.

  - ### appendToKey

    public static void appendToKey(KeyContext keyContext, KeyBuilder keyBuilder, UniformDataGatherer uniformDataGatherer, TextureDataGatherer textureDataGatherer, @RawPtr @RawPtr ColorFilter colorFilter)

  - ### appendToKey

    public static void appendToKey(KeyContext keyContext, KeyBuilder keyBuilder, UniformDataGatherer uniformDataGatherer, TextureDataGatherer textureDataGatherer, @RawPtr @RawPtr Blender blender)