|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.foray.pdf.object.PDFObject
org.foray.pdf.object.PDFShading
public class PDFShading
class representing a PDF Smooth Shading object. PDF Functions represent parameterized mathematical formulas and sampled representations with arbitrary resolution. Functions are used in two areas: device-dependent rasterization information for halftoning and transfer functions, and color specification for smooth shading (a PDF 1.3 feature). All PDF Functions have a shadingType (0,2,3, or 4), a Domain, and a Range.
Field Summary | |
---|---|
static byte |
TYPE_AXIAL
Constant indicating a shading type of "Axial shading". |
static byte |
TYPE_COONS_PATCH_MESH
Constant indicating a shading type of "Coons patch mesh". |
static byte |
TYPE_FREE_GOURAD_TRIANGLE_MESH
Constant indicating a shading type of "Free-form Gouraud-shaded triangle mesh". |
static byte |
TYPE_FUNCTION_BASED
Constant indicating a shading type of "Function-based shading". |
static byte |
TYPE_LATTICE_GOURAD_TRIANGLE_MESH
Constant indicating a shading type of "Lattice-form Gourad-shaded triangle mesh". |
static byte |
TYPE_RADIAL
Constant indicating a shading type of "Radial shading". |
static byte |
TYPE_TENSOR_PRODUCT_PATCH_MESH
Constant indicating a shading type of "Tensor-product-patch mesh". |
Fields inherited from class org.foray.pdf.object.PDFObject |
---|
EOL, MSG_EOL, XREF_EOL |
Constructor Summary | |
---|---|
PDFShading(PDFDocument doc,
int theShadingType,
ColorSpace theColorSpace,
List<Double> theBackground,
List<Double> theBBox,
boolean theAntiAlias,
int theBitsPerCoordinate,
int theBitsPerComponent,
int theBitsPerFlag,
List<Double> theDecode,
PDFFunction theFunction)
Constructor for Type 4,6, or 7. |
|
PDFShading(PDFDocument doc,
int theShadingType,
ColorSpace theColorSpace,
List<Double> theBackground,
List<Double> theBBox,
boolean theAntiAlias,
int theBitsPerCoordinate,
int theBitsPerComponent,
List<Double> theDecode,
int theVerticesPerRow,
PDFFunction theFunction)
Constructor for type 5. |
|
PDFShading(PDFDocument doc,
int theShadingType,
ColorSpace theColorSpace,
List<Double> theBackground,
List<Double> theBBox,
boolean theAntiAlias,
List<Double> theDomain,
List<Double> theMatrix,
PDFFunction theFunction)
Constructor for type function based shading. |
|
PDFShading(PDFDocument doc,
int theShadingType,
ColorSpace theColorSpace,
List<Double> theBackground,
List<Double> theBBox,
boolean theAntiAlias,
List<Double> theCoords,
List<Double> theDomain,
PDFFunction theFunction,
List<Boolean> theExtend)
Constructor for Type 2 and 3. |
Method Summary | |
---|---|
String |
getName()
Returns the PDF name for this shading. |
String |
toPDF()
represent as PDF. |
Methods inherited from class org.foray.pdf.object.PDFObject |
---|
bufferToByteArray, byteArrayToStream, getCharsPerLine, getGeneration, getLogger, getNumber, getPDFDocument, output, pdfID, pdfReference, setNumber, stringToByteArray |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final byte TYPE_FUNCTION_BASED
public static final byte TYPE_AXIAL
public static final byte TYPE_RADIAL
public static final byte TYPE_FREE_GOURAD_TRIANGLE_MESH
public static final byte TYPE_LATTICE_GOURAD_TRIANGLE_MESH
public static final byte TYPE_COONS_PATCH_MESH
public static final byte TYPE_TENSOR_PRODUCT_PATCH_MESH
Constructor Detail |
---|
public PDFShading(PDFDocument doc, int theShadingType, ColorSpace theColorSpace, List<Double> theBackground, List<Double> theBBox, boolean theAntiAlias, List<Double> theDomain, List<Double> theMatrix, PDFFunction theFunction)
doc
- The parent PDF document.theShadingType
- The type of shading object, which should be 1 for
function based shading.theColorSpace
- The colorspace is 'DeviceRGB' or something similar.theBackground
- An array of color components appropriate to the
colorspace key specifying a single color value.
This key is used by the f operator buy ignored by the sh operator.theBBox
- List of double's representing a rectangle
in the coordinate space that is current at the
time of shading is imaged. Temporary clipping
boundary.theAntiAlias
- Whether or not to anti-alias.theDomain
- Optional List of Doubles specifying the domain.theMatrix
- List of Doubles specifying the matrix.
If it's a pattern, then the matrix maps it to pattern space.
If it's a shading, then it maps it to current user space.
It's optional, the default is the identity matrixtheFunction
- The PDF Function that maps an (x,y) location to a
color.public PDFShading(PDFDocument doc, int theShadingType, ColorSpace theColorSpace, List<Double> theBackground, List<Double> theBBox, boolean theAntiAlias, List<Double> theCoords, List<Double> theDomain, PDFFunction theFunction, List<Boolean> theExtend)
doc
- The parent PDF document.theShadingType
- 2 or 3 for axial or radial shadingtheColorSpace
- "DeviceRGB" or similar.theBackground
- theBackground An array of color components
appropriate to the colorspace key specifying a single color value.
This key is used by the f operator buy ignored by the sh operator.theBBox
- List of double's representing a rectangle
in the coordinate space that is current at the
time of shading is imaged. Temporary clipping
boundary.theAntiAlias
- Default is falsetheCoords
- List of four (type 2) or 6 (type 3) DoubletheDomain
- List of Doubles specifying the domaintheFunction
- the Stitching (PDFfunction type 3) function, even if
it's stitching a single functiontheExtend
- List of Booleans of whether to extend teh start and end
colors past the start and end points.
The default is [false, false]public PDFShading(PDFDocument doc, int theShadingType, ColorSpace theColorSpace, List<Double> theBackground, List<Double> theBBox, boolean theAntiAlias, int theBitsPerCoordinate, int theBitsPerComponent, int theBitsPerFlag, List<Double> theDecode, PDFFunction theFunction)
doc
- The parent PDF document.theShadingType
- 4, 6, or 7 depending on whether it's
Free-form gouraud-shaded triangle meshes, coons patch meshes,
or tensor product patch meshes, respectively.theColorSpace
- "DeviceRGB" or similar.theBackground
- theBackground An array of color components
appropriate to the colorspace key specifying a single color value.
This key is used by the f operator buy ignored by the sh operator.theBBox
- List of double's representing a rectangle
in the coordinate space that is current at the
time of shading is imaged. Temporary clipping
boundary.theAntiAlias
- Default is falsetheBitsPerCoordinate
- 1,2,4,8,12,16,24 or 32.theBitsPerComponent
- 1,2,4,8,12, and 16theBitsPerFlag
- 2,4,8.theDecode
- List of Doubles see PDF 1.3 spec pages 303 to 312.theFunction
- the PDFFunctionpublic PDFShading(PDFDocument doc, int theShadingType, ColorSpace theColorSpace, List<Double> theBackground, List<Double> theBBox, boolean theAntiAlias, int theBitsPerCoordinate, int theBitsPerComponent, List<Double> theDecode, int theVerticesPerRow, PDFFunction theFunction)
theShadingType
- 5 for lattice-Form Gouraud shaded-triangle meshtheColorSpace
- "DeviceRGB" or similar.theBackground
- theBackground An array of color components
appropriate to the colorspace key specifying a single color value.
This key is used by the f operator buy ignored by the sh operator.theBBox
- List of double's representing a rectangle
in the coordinate space that is current at the
time of shading is imaged. Temporary clipping
boundary.theAntiAlias
- Default is falsetheBitsPerCoordinate
- 1,2,4,8,12,16, 24, or 32theBitsPerComponent
- 1,2,4,8,12,24,32theDecode
- List of Doubles. See page 305 in PDF 1.3 spec.theVerticesPerRow
- number of vertices in each "row" of the lattice.theFunction
- The PDFFunction that's mapped on to this shapedoc
- The parent PDF document.Method Detail |
---|
public String getName()
public String toPDF()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |