Class ShadingPattern
- java.lang.Object
- 
- com.inductiveautomation.rm.pdf.reader.PDFPattern
- 
- com.inductiveautomation.rm.pdf.reader.fps.ShadingPattern
 
 
- 
- All Implemented Interfaces:
- java.awt.Paint,- java.awt.PaintContext,- java.awt.Transparency
 - Direct Known Subclasses:
- AxialShading,- FunctionShading,- RadialShading
 
 public abstract class ShadingPattern extends PDFPattern implements java.awt.PaintContext, java.awt.Paint PDFShadingPattern.
- 
- 
Field SummaryFields Modifier and Type Field Description static intArbitraryColorSpaceShadingstatic intDeviceGrayShadingstatic intDeviceRGBShading
 - 
Constructor SummaryConstructors Constructor Description ShadingPattern(java.util.Map patternDict, java.util.Map shadingDict, PDFFile srcFile)Constructor - patternDict may be null if this object was created from the shading operator (sh).
 - 
Method SummaryAll Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description java.awt.PaintContextcreateContext(java.awt.image.ColorModel cm, java.awt.Rectangle deviceBounds, java.awt.geom.Rectangle2D userBounds, java.awt.geom.AffineTransform xform, java.awt.RenderingHints hints)Paint & PaintContext interfacesvoiddispose()abstract voiddoShading(int[] samples, int x, int y, int w, int h)Subclasses should implement this method to draw the shading.java.awt.geom.Rectangle2DgetBounds()java.awt.image.ColorModelgetColorModel()static ShadingPatterngetInstance(java.util.Map dict, PDFFile srcFile)Create an instance from a shading dictionary or a pattern dictionary.java.awt.PaintgetPaint()Returns the awt Paint object which will render the patternjava.awt.image.RastergetRaster(int x, int y, int w, int h)intgetRGBAPixel(float[] sampleValues)This routine will get called for every pixel in the inner loop of the shading.java.awt.geom.AffineTransformgetTransform()Returns the pattern space transformintgetTransparency()Alpha & color definitionsvoidinitializeShadingParameters(java.util.Map shadingDict, PDFFile srcFile)Read the shading parametersvoidsetColorSpace(java.awt.color.ColorSpace c)voidsetDeviceTransform(java.awt.geom.AffineTransform x, java.awt.Rectangle devRect)Sets the transform from user space to device space- 
Methods inherited from class com.inductiveautomation.rm.pdf.reader.PDFPatterngetGState, getInstance
 
- 
 
- 
- 
- 
Field Detail- 
DeviceRGBShadingpublic static final int DeviceRGBShading - See Also:
- Constant Field Values
 
 - 
DeviceGrayShadingpublic static final int DeviceGrayShading - See Also:
- Constant Field Values
 
 - 
ArbitraryColorSpaceShadingpublic static final int ArbitraryColorSpaceShading - See Also:
- Constant Field Values
 
 
- 
 - 
Constructor Detail- 
ShadingPatternpublic ShadingPattern(java.util.Map patternDict, java.util.Map shadingDict, PDFFile srcFile)Constructor - patternDict may be null if this object was created from the shading operator (sh).
 
- 
 - 
Method Detail- 
getInstancepublic static ShadingPattern getInstance(java.util.Map dict, PDFFile srcFile) Create an instance from a shading dictionary or a pattern dictionary.
 - 
initializeShadingParameterspublic void initializeShadingParameters(java.util.Map shadingDict, PDFFile srcFile)Read the shading parameters
 - 
setDeviceTransformpublic void setDeviceTransform(java.awt.geom.AffineTransform x, java.awt.Rectangle devRect)Sets the transform from user space to device space
 - 
getTransformpublic java.awt.geom.AffineTransform getTransform() Returns the pattern space transform- Specified by:
- getTransformin class- PDFPattern
 
 - 
getBoundspublic java.awt.geom.Rectangle2D getBounds() 
 - 
setColorSpacepublic void setColorSpace(java.awt.color.ColorSpace c) 
 - 
getRGBAPixelpublic int getRGBAPixel(float[] sampleValues) This routine will get called for every pixel in the inner loop of the shading. If that gets too slow, you could always try to inline it. sampleValues are assumed to to have the right number of elements in the right range for the colorspace.
 - 
getPaintpublic java.awt.Paint getPaint() Description copied from class:PDFPatternReturns the awt Paint object which will render the pattern- Specified by:
- getPaintin class- PDFPattern
 
 - 
createContextpublic java.awt.PaintContext createContext(java.awt.image.ColorModel cm, java.awt.Rectangle deviceBounds, java.awt.geom.Rectangle2D userBounds, java.awt.geom.AffineTransform xform, java.awt.RenderingHints hints)Paint & PaintContext interfaces- Specified by:
- createContextin interface- java.awt.Paint
 
 - 
disposepublic void dispose() - Specified by:
- disposein interface- java.awt.PaintContext
 
 - 
getRasterpublic java.awt.image.Raster getRaster(int x, int y, int w, int h)- Specified by:
- getRasterin interface- java.awt.PaintContext
 
 - 
getTransparencypublic int getTransparency() Alpha & color definitions- Specified by:
- getTransparencyin interface- java.awt.Transparency
 
 - 
getColorModelpublic java.awt.image.ColorModel getColorModel() - Specified by:
- getColorModelin interface- java.awt.PaintContext
 
 - 
doShadingpublic 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 persample/4 samples per pixel ARGB pixels. There is no padding, so all scanlines are w integers wide.
 
- 
 
-