Package icyllis.arc3d.core.shaders

# Class AngularGradient

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

All Implemented Interfaces:
  `RefCounted`, `Shader`

public final class AngularGradient extends Gradient1DShader
The angular gradient, also known as sweep gradient, conic gradient.

- ## Nested Class Summary

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

  `Gradient1DShader.ColorTransformer`

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

  `GradientShader.Interpolation`

- ## Field Summary

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

  `mPtsToUnit, 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
  Constructor
  Description
  `AngularGradient(float centerX, float centerY, float tStart, float tEnd, float[] colors, ColorSpace colorSpace, float[] positions, int colorCount, int tileMode, int interpolation)`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `int`
  `asGradient()`
  `float`
  `getCenterX()`
  `float`
  `getCenterY()`
  `float`
  `getTBias()`
  `float`
  `getTScale()`
  `static @SharedPtr Shader`
  `make(float centerX, float centerY, float startAngle, float endAngle, float[] colors, ColorSpace colorSpace, float[] positions, int colorCount, int tileMode, int interpolation, Matrixc localMatrix)`
  Create an angular gradient shader.

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

  `checkGradient1D, colorsAreOpaque, getColorCount, getColors, getColorSpace, getGradientMatrix, getInterpolation, getPos, getPositions, getTileMode, makeDegenerateGradient, srgb_to_hsl, srgb_to_hwb`

  ### 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`

- ## Constructor Details

  - ### AngularGradient

    @VisibleForTesting public AngularGradient(float centerX, float centerY, float tStart, float tEnd, @Nonnull float[] colors, @Nullable ColorSpace colorSpace, @Nullable float[] positions, int colorCount, int tileMode, int interpolation)

- ## Method Details

  - ### make

    @CheckReturnValue @Nullable @SharedPtr public static @SharedPtr Shader make(float centerX, float centerY, float startAngle, float endAngle, @Nonnull float[] colors, @Nullable ColorSpace colorSpace, @Nullable float[] positions, int colorCount, int tileMode, int interpolation, @Nullable Matrixc localMatrix)
    Create an angular gradient shader.

    The shader accepts negative angles and angles larger than 360, draws between 0 and 360 degrees, similar to the CSS conic-gradient semantics. 0 degrees means horizontal positive x-axis. The start angle must be less than the end angle, otherwise a null pointer is returned. If color stops do not contain 0 and 1 but are within this range, the respective outer color stop is repeated for 0 and 1. Color stops less than 0 are clamped to 0, and greater than 1 are clamped to 1.

    The colors array holds repeated R,G,B,A values of source colors to interpolate, they are un-premultiplied and in the given colorSpace.

    The positions array specifies a number of stops, all values are between 0 and 1 and monotonic increasing. Colors will be linearly interpolated in each stop. Null means that they are uniformly distributed. If the first position is not 0 or the last position is not 1, an implicit stop will be added.

    Only the first colorCount entries in array will be taken, then `colors.length >= colorCount * 4 invalid input: '&'invalid input: '&' positions.length >= colorCount`.

    The tileMode specifies the behavior when local coords are out of bounds.

    The interpolation specifies the color interpolation method, see `GradientShader.Interpolation`.

    The localMatrix specifies an additional local matrix for this gradient, null means identity.

    All given arguments will be simplified and copied into the return shader. Null is returned if there are any illegal arguments (NaN, Inf, non-invertible matrix, etc.).

    Parameters:
      `centerX` - x of center point
      `centerY` - y of center point
      `startAngle` - start angle in degrees
      `endAngle` - end angle in degrees
      `colors` - color array
      `colorSpace` - color space, null will use the default one (sRGB)
      `positions` - position array
      `colorCount` - number of stops
      `tileMode` - tile mode
      `interpolation` - interpolation method
      `localMatrix` - local matrix
    Returns:
      a gradient shader, or degenerate shader, or null

  - ### asGradient

    public int asGradient()

  - ### getCenterX

    public float getCenterX()

  - ### getCenterY

    public float getCenterY()

  - ### getTBias

    public float getTBias()

  - ### getTScale

    public float getTScale()