Package com.ribs.pdf.patterns
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
PDFShadingPattern.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intstatic final intstatic final intFields inherited from interface java.awt.Transparency
BITMASK, OPAQUE, TRANSLUCENT -
Constructor Summary
ConstructorsConstructorDescriptionPDFShadingPattern(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 interfacesvoiddispose()abstract voiddoShading(int[] samples, int x, int y, int w, int h) Subclasses should implement this method to draw the shading.static PDFShadingPatterngetInstance(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) intgetRGBAPixel(float[] sample_values) Returns the pattern space->default space transformintAlpha & color definitionsvoidinitializeShadingParameters(Map shadingDict, PDFFile srcFile) Read the shading parametersvoidMethods inherited from class com.ribs.pdf.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
-
PDFShadingPattern
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 -
getTransform
Description copied from class:PDFPatternReturns the pattern space->default space transform- Specified by:
getTransformin classPDFPattern
-
getBounds
-
setColorSpace
-
getRGBAPixel
public int getRGBAPixel(float[] sample_values) -
getPaint
Description copied from class:PDFPatternReturns the awt Paint object which will render the pattern- Specified by:
getPaintin classPDFPattern
-
createContext
public PaintContext createContext(ColorModel cm, Rectangle deviceBounds, Rectangle2D userBounds, AffineTransform xform, RenderingHints hints) Paint & PaintContext interfaces- Specified by:
createContextin interfacePaint
-
dispose
public void dispose()- Specified by:
disposein interfacePaintContext
-
getRaster
- Specified by:
getRasterin interfacePaintContext
-
getTransparency
public int getTransparency()Alpha & color definitions- Specified by:
getTransparencyin interfaceTransparency
-
getColorModel
- Specified by:
getColorModelin 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 per sample/4 samples per pixel ARGB pixels. There is no padding, so all scanlines are w integers wide.
-