Package icyllis.arc3d.core.shaders

# Class Gradient1DShader

java.lang.Object
icyllis.arc3d.core.shaders.GradientShader
icyllis.arc3d.core.shaders.Gradient1DShader

All Implemented Interfaces:
  `RefCounted`, `Shader`

Direct Known Subclasses:
  `AngularGradient`, `LinearGradient`, `RadialGradient`

public abstract sealed class Gradient1DShader extends GradientShader permits LinearGradient, RadialGradient, AngularGradient
Base class for gradient colors that can be represented by a 1D function, it generates one parameter for interpolation:

    grad_layout(x,y) -> float

Such as linear gradient, radial gradient, angular gradient.

- ## Nested Class Summary

  Nested Classes
  Modifier and Type
  Class
  Description
  `static class`
  `Gradient1DShader.ColorTransformer`

  ## Nested classes/interfaces inherited from class icyllis.arc3d.core.shaders.GradientShader

  `GradientShader.Interpolation`

- ## Field Summary

  Fields
  Modifier and Type
  Field
  Description
  `protected final Matrix`
  `mPtsToUnit`
  `protected final int`
  `mTileMode`

  ### Fields inherited from class icyllis.arc3d.core.shaders.GradientShader

  `kDegenerateTolerance`

  ### Fields inherited from interface icyllis.arc3d.core.shaders.Shader

  `TILE_MODE_CLAMP, TILE_MODE_DECAL, TILE_MODE_MIRROR, TILE_MODE_REPEAT`

- ## Constructor Summary

  Constructors
  Modifier
  Constructor
  Description
  `protected`
  `Gradient1DShader(float[] inColors, ColorSpace colorSpace, float[] inPositions, int inColorCount, int tileMode, int interpolation, Matrix ptsToUnit)`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `protected static boolean`
  `checkGradient1D(float[] colors, float[] positions, int colorCount, int tileMode)`
  `boolean`
  `colorsAreOpaque()`
  `int`
  `getColorCount()`
  `float[]`
  `getColors()`
  `ColorSpace`
  `getColorSpace()`
  `Matrixc`
  `getGradientMatrix()`
  `int`
  `getInterpolation()`
  `float`
  `getPos(int i)`
  `float[]`
  `getPositions()`
  `int`
  `getTileMode()`
  `protected static @SharedPtr Shader`
  `makeDegenerateGradient(float[] colors, ColorSpace colorSpace, float[] positions, int colorCount, int tileMode)`
  `static void`
  `srgb_to_hsl(int i, float[] colors, BitSet hueIsPowerless)`
  `static void`
  `srgb_to_hwb(int i, float[] colors, BitSet hueIsPowerless)`

  ### Methods inherited from class icyllis.arc3d.core.shaders.GradientShader

  `ref, unref`

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

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

  ### Methods inherited from interface icyllis.arc3d.core.shaders.Shader

  `isOpaque, makeWithLocalMatrix`

- ## Field Details

  - ### mPtsToUnit

    protected final Matrix mPtsToUnit

  - ### mTileMode

    protected final int mTileMode

- ## Constructor Details

  - ### Gradient1DShader

    protected Gradient1DShader(@Nonnull float[] inColors, @Nullable ColorSpace colorSpace, @Nullable float[] inPositions, int inColorCount, int tileMode, int interpolation, @Nonnull Matrix ptsToUnit)

- ## Method Details

  - ### getColors

    @VisibleForTesting public float[] getColors()

  - ### getPositions

    @VisibleForTesting public float[] getPositions()

  - ### getPos

    public float getPos(int i)

  - ### getColorSpace

    @Nonnull public ColorSpace getColorSpace()

  - ### getColorCount

    public int getColorCount()

  - ### getInterpolation

    public int getInterpolation()

  - ### getTileMode

    public int getTileMode()

  - ### getGradientMatrix

    @Nonnull public Matrixc getGradientMatrix()

  - ### colorsAreOpaque

    public boolean colorsAreOpaque()

  - ### checkGradient1D

    protected static boolean checkGradient1D(float[] colors, float[] positions, int colorCount, int tileMode)

  - ### makeDegenerateGradient

    @Nullable @SharedPtr protected static @SharedPtr Shader makeDegenerateGradient(float[] colors, @Nullable ColorSpace colorSpace, float[] positions, int colorCount, int tileMode)

  - ### srgb_to_hsl

    public static void srgb_to_hsl(int i, float[] colors, BitSet hueIsPowerless)

  - ### srgb_to_hwb

    public static void srgb_to_hwb(int i, float[] colors, BitSet hueIsPowerless)