Class ShadingPattern
java.lang.Object
com.inductiveautomation.rm.pdf.reader.PDFPattern
com.inductiveautomation.rm.pdf.reader.fps.ShadingPattern
- All Implemented Interfaces:
Paint
,PaintContext
,Transparency
- Direct Known Subclasses:
AxialShading
,FunctionShading
,RadialShading
PDFShadingPattern.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final int
static final int
static final int
Fields inherited from interface java.awt.Transparency
BITMASK, OPAQUE, TRANSLUCENT
-
Constructor Summary
ConstructorsConstructorDescriptionShadingPattern
(Map patternDict, Map shadingDict, PDFFile srcFile) Constructor - patternDict may be null if this object was created from the shading operator (sh). -
Method Summary
Modifier and TypeMethodDescriptioncreateContext
(ColorModel cm, Rectangle deviceBounds, Rectangle2D userBounds, AffineTransform xform, RenderingHints hints) Paint & PaintContext interfacesvoid
dispose()
abstract void
doShading
(int[] samples, int x, int y, int w, int h) Subclasses should implement this method to draw the shading.static ShadingPattern
getInstance
(Map dict, PDFFile srcFile) Create an instance from a shading dictionary or a pattern dictionary.getPaint()
Returns the awt Paint object which will render the patterngetRaster
(int x, int y, int w, int h) int
getRGBAPixel
(float[] sampleValues) This routine will get called for every pixel in the inner loop of the shading.Returns the pattern space transformint
Alpha & color definitionsvoid
initializeShadingParameters
(Map shadingDict, PDFFile srcFile) Read the shading parametersvoid
void
setDeviceTransform
(AffineTransform x, Rectangle devRect) Sets the transform from user space to device spaceMethods inherited from class com.inductiveautomation.rm.pdf.reader.PDFPattern
getGState, getInstance
-
Field Details
-
DeviceRGBShading
public static final int DeviceRGBShading- See Also:
-
DeviceGrayShading
public static final int DeviceGrayShading- See Also:
-
ArbitraryColorSpaceShading
public static final int ArbitraryColorSpaceShading- See Also:
-
-
Constructor Details
-
ShadingPattern
Constructor - patternDict may be null if this object was created from the shading operator (sh).
-
-
Method Details
-
getInstance
Create an instance from a shading dictionary or a pattern dictionary. -
initializeShadingParameters
Read the shading parameters -
setDeviceTransform
Sets the transform from user space to device space -
getTransform
Returns the pattern space transform- Specified by:
getTransform
in classPDFPattern
-
getBounds
-
setColorSpace
-
getRGBAPixel
public 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. -
getPaint
Description copied from class:PDFPattern
Returns the awt Paint object which will render the pattern- Specified by:
getPaint
in classPDFPattern
-
createContext
public PaintContext createContext(ColorModel cm, Rectangle deviceBounds, Rectangle2D userBounds, AffineTransform xform, RenderingHints hints) Paint & PaintContext interfaces- Specified by:
createContext
in interfacePaint
-
dispose
public void dispose()- Specified by:
dispose
in interfacePaintContext
-
getRaster
- Specified by:
getRaster
in interfacePaintContext
-
getTransparency
public int getTransparency()Alpha & color definitions- Specified by:
getTransparency
in interfaceTransparency
-
getColorModel
- Specified by:
getColorModel
in interfacePaintContext
-
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 persample/4 samples per pixel ARGB pixels. There is no padding, so all scanlines are w integers wide.
-