Class PDFShadingPattern

java.lang.Object
com.ribs.pdf.PDFPattern
com.ribs.pdf.patterns.PDFShadingPattern
All Implemented Interfaces:
Paint, PaintContext, Transparency
Direct Known Subclasses:
PDFAxialShading, PDFFunctionShading, PDFRadialShading

public abstract class PDFShadingPattern extends PDFPattern implements PaintContext, Paint
PDFShadingPattern.
  • Field Details

  • Constructor Details

    • PDFShadingPattern

      public PDFShadingPattern(Map patternDict, Map shadingDict, PDFFile srcFile)
      Constructor - patternDict may be null if this object was created from the shading operator (sh).
  • Method Details

    • getInstance

      public static PDFShadingPattern getInstance(Map dict, PDFFile srcFile)
      Create an instance from a shading dictionary or a pattern dictionary.
    • initializeShadingParameters

      public void initializeShadingParameters(Map shadingDict, PDFFile srcFile)
      Read the shading parameters
    • getTransform

      public AffineTransform getTransform()
      Description copied from class: PDFPattern
      Returns the pattern space->default space transform
      Specified by:
      getTransform in class PDFPattern
    • getBounds

      public Rectangle2D getBounds()
    • setColorSpace

      public void setColorSpace(ColorSpace c)
    • getRGBAPixel

      public int getRGBAPixel(float[] sample_values)
    • getPaint

      public Paint getPaint()
      Description copied from class: PDFPattern
      Returns the awt Paint object which will render the pattern
      Specified by:
      getPaint in class PDFPattern
    • createContext

      public PaintContext createContext(ColorModel cm, Rectangle deviceBounds, Rectangle2D userBounds, AffineTransform xform, RenderingHints hints)
      Paint & PaintContext interfaces
      Specified by:
      createContext in interface Paint
    • dispose

      public void dispose()
      Specified by:
      dispose in interface PaintContext
    • getRaster

      public Raster getRaster(int x, int y, int w, int h)
      Specified by:
      getRaster in interface PaintContext
    • getTransparency

      public int getTransparency()
      Alpha & color definitions
      Specified by:
      getTransparency in interface Transparency
    • getColorModel

      public ColorModel getColorModel()
      Specified by:
      getColorModel in interface PaintContext
    • doShading

      public abstract void doShading(int[] samples, int x, int y, int w, int h)
      Subclasses should implement this method to draw the shading. samples is defined to be an array of 8 bit per sample/4 samples per pixel ARGB pixels. There is no padding, so all scanlines are w integers wide.