Class SVGMultipleGradientPaint

java.lang.Object
com.github.weisj.jsvg.renderer.jdk.SVGMultipleGradientPaint
All Implemented Interfaces:
Paint, Transparency
Direct Known Subclasses:
SVGRadialGradientPaint

public abstract class SVGMultipleGradientPaint extends Object implements Paint
This is the superclass for Paints which use a multiple color gradient to fill in their raster. It provides storage for variables and enumerated values common to LinearGradientPaint and RadialGradientPaint.
Since:
1.6
  • Field Details

    • transparency

      final int transparency
      The transparency of this paint object.
    • fractions

      final float @NotNull [] fractions
      Gradient keyframe values in the range 0 to 1.
    • colors

      @NotNull final @NotNull Color @NotNull [] colors
      Gradient colors.
    • gradientTransform

      @NotNull final @NotNull AffineTransform gradientTransform
      Transform to apply to gradient.
    • cycleMethod

      @NotNull final MultipleGradientPaint.CycleMethod cycleMethod
      The method to use when painting outside the gradient bounds.
    • colorSpace

      @NotNull final MultipleGradientPaint.ColorSpaceType colorSpace
      The color space in which to perform the gradient interpolation.
    • model

      ColorModel model
      The following fields are used only by MultipleGradientPaintContext to cache certain values that remain constant and do not need to be recalculated for each context created from this paint instance.
    • normalizedIntervals

      float[] normalizedIntervals
    • isSimpleLookup

      boolean isSimpleLookup
    • gradients

      SoftReference<int[][]> gradients
    • gradient

      SoftReference<int[]> gradient
    • fastGradientArraySize

      int fastGradientArraySize
  • Constructor Details

    • SVGMultipleGradientPaint

      SVGMultipleGradientPaint(float @NotNull [] fractions, @NotNull @NotNull Color @NotNull [] colors, @NotNull MultipleGradientPaint.CycleMethod cycleMethod, @NotNull MultipleGradientPaint.ColorSpaceType colorSpace, @NotNull @NotNull AffineTransform gradientTransform)
      Package-private constructor.
      Parameters:
      fractions - numbers ranging from 0.0 to 1.0 specifying the distribution of colors along the gradient
      colors - array of colors corresponding to each fractional value
      cycleMethod - either NO_CYCLE, REFLECT, or REPEAT
      colorSpace - which color space to use for interpolation, either SRGB or LINEAR_RGB
      gradientTransform - transform to apply to the gradient
      Throws:
      NullPointerException - if fractions array is null, or colors array is null, or gradientTransform is null, or cycleMethod is null, or colorSpace is null
      IllegalArgumentException - if fractions.length != colors.length, or colors is less than 2 in size, or a fractions value is less than 0.0 or greater than 1.0, or the fractions are not provided in strictly increasing order
  • Method Details