Class RadialShading
- java.lang.Object
-
- com.inductiveautomation.rm.pdf.reader.PDFPattern
-
- com.inductiveautomation.rm.pdf.reader.fps.ShadingPattern
-
- com.inductiveautomation.rm.pdf.reader.fps.RadialShading
-
- All Implemented Interfaces:
java.awt.Paint
,java.awt.PaintContext
,java.awt.Transparency
public class RadialShading extends ShadingPattern
A concrete subclass of PDFShadingPattern which implements pdf radial (type 3) shadings.PDF radial shadings are defined by two circles and a function. The circles need not be centered at the same location. The shading works by interpolating the centers and radii of the two circles. The distance along the line defined by the two centers or radii is then mapped into the domain of the function, which returns the final color values. TODO: currently ignores transform and background color
-
-
Field Summary
-
Fields inherited from class com.inductiveautomation.rm.pdf.reader.fps.ShadingPattern
ArbitraryColorSpaceShading, DeviceGrayShading, DeviceRGBShading
-
-
Constructor Summary
Constructors Constructor Description RadialShading(java.util.Map patternDict, java.util.Map shadingDict, PDFFile srcFile)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
doShading(int[] samples, int x, int y, int w, int h)
Subclasses should implement this method to draw the shading.void
doShadingWithTransform(int[] samples, int x, int y, int w, int h)
void
initializeShadingParameters(java.util.Map shadingDict, PDFFile srcFile)
Read the shading parametersvoid
setDeviceTransform(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.fps.ShadingPattern
createContext, dispose, getBounds, getColorModel, getInstance, getPaint, getRaster, getRGBAPixel, getTransform, getTransparency, setColorSpace
-
Methods inherited from class com.inductiveautomation.rm.pdf.reader.PDFPattern
getGState, getInstance
-
-
-
-
Constructor Detail
-
RadialShading
public RadialShading(java.util.Map patternDict, java.util.Map shadingDict, PDFFile srcFile)
-
-
Method Detail
-
initializeShadingParameters
public void initializeShadingParameters(java.util.Map shadingDict, PDFFile srcFile)
Read the shading parameters- Overrides:
initializeShadingParameters
in classShadingPattern
-
setDeviceTransform
public void setDeviceTransform(java.awt.geom.AffineTransform x, java.awt.Rectangle devRect)
Sets the transform from user space to device space- Overrides:
setDeviceTransform
in classShadingPattern
-
doShading
public void doShading(int[] samples, int x, int y, int w, int h)
Description copied from class:ShadingPattern
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.- Specified by:
doShading
in classShadingPattern
-
doShadingWithTransform
public void doShadingWithTransform(int[] samples, int x, int y, int w, int h)
-
-