Class PdfFreeFormGouraudShadedTriangleShading
AbstractPdfShading, AbstractPdfShadingMesh and AbstractPdfShadingMeshWithFlags classes and is in charge of Shading Dictionary with free-form Gouraud-shaded triangle mesh type.
The area to be shaded is defined by a path composed entirely of triangles. The colour at each vertex of the triangles is specified, and a technique known as Gouraud interpolation is used to colour the interiors.
The object shall be represented as stream containing a sequence of vertex data. Each vertex is specified by the following values, in the order shown: f x y c1 ... cn where: f - the vertex's edge flag, that determines the vertex is connected to other vertices of the triangle mesh. For full description, see ISO-320001 Paragraph 8.7.4.5.5 x, y - vertex's horizontal and vertical coordinates, expressed in the shading's target coordinate space. c1...cn - vertex's colour components.
If the shading dictionary includes a Function entry, only a single parametric value, t, shall be specified for each vertex in place of the colour components c1...cn.
-
Constructor Summary
ConstructorsConstructorDescriptionPdfFreeFormGouraudShadedTriangleShading(PdfColorSpace cs, int bitsPerCoordinate, int bitsPerComponent, int bitsPerFlag, float[] decode) Creates the new instance of the class.PdfFreeFormGouraudShadedTriangleShading(PdfColorSpace cs, int bitsPerCoordinate, int bitsPerComponent, int bitsPerFlag, PdfArray decode) Creates the new instance of the class.PdfFreeFormGouraudShadedTriangleShading(PdfStream pdfStream) Creates the new instance of the class from the existingPdfStream. -
Method Summary
Methods inherited from class com.itextpdf.kernel.pdf.colorspace.shading.AbstractPdfShadingMeshWithFlags
getBitsPerFlag, setBitsPerFlagMethods inherited from class com.itextpdf.kernel.pdf.colorspace.shading.AbstractPdfShadingMesh
getBitsPerComponent, getBitsPerCoordinate, getDecode, setBitsPerComponent, setBitsPerCoordinate, setDecode, setDecodeMethods inherited from class com.itextpdf.kernel.pdf.colorspace.shading.AbstractPdfShading
flush, getColorSpace, getFunction, getShadingType, isWrappedObjectMustBeIndirect, makeShading, setFunction, setFunctionMethods inherited from class com.itextpdf.kernel.pdf.PdfObjectWrapper
ensureObjectIsAddedToDocument, ensureUnderlyingObjectHasIndirectReference, getPdfObject, isFlushed, makeIndirect, makeIndirect, markObjectAsIndirect, setForbidRelease, setModified, setPdfObject, unsetForbidRelease
-
Constructor Details
-
PdfFreeFormGouraudShadedTriangleShading
Creates the new instance of the class from the existingPdfStream.- Parameters:
-
pdfStream- from which thisPdfFreeFormGouraudShadedTriangleShadingwill be created
-
PdfFreeFormGouraudShadedTriangleShading
public PdfFreeFormGouraudShadedTriangleShading(PdfColorSpace cs, int bitsPerCoordinate, int bitsPerComponent, int bitsPerFlag, float[] decode) Creates the new instance of the class.- Parameters:
-
cs- thePdfColorSpaceobject in which colour values shall be expressed. The special Pattern space isn't excepted. -
bitsPerCoordinate- the number of bits used to represent each vertex coordinate. The value shall be 1, 2, 4, 8, 12, 16, 24, or 32 -
bitsPerComponent- the number of bits used to represent each colour component. The value shall be 1, 2, 4, 8, 12, or 16 -
bitsPerFlag- the number of bits used to represent the edge flag for each vertex. The value of BitsPerFlag shall be 2, 4, or 8, but only the least significant 2 bits in each flag value shall be used. The value for the edge flag shall be 0, 1, or 2 -
decode- theint[]of numbers specifying how to map vertex coordinates and colour components into the appropriate ranges of values. The ranges shall be specified as follows: [x_min x_max y_min y_max c1_min c1_max … cn_min cn_max]. Only one pair of color values shall be specified if a Function entry is present
-
PdfFreeFormGouraudShadedTriangleShading
public PdfFreeFormGouraudShadedTriangleShading(PdfColorSpace cs, int bitsPerCoordinate, int bitsPerComponent, int bitsPerFlag, PdfArray decode) Creates the new instance of the class.- Parameters:
-
cs- thePdfColorSpaceobject in which colour values shall be expressed. The special Pattern space isn't excepted -
bitsPerCoordinate- the number of bits used to represent each vertex coordinate. The value shall be 1, 2, 4, 8, 12, 16, 24, or 32 -
bitsPerComponent- the number of bits used to represent each colour component. The value shall be 1, 2, 4, 8, 12, or 16 -
bitsPerFlag- the number of bits used to represent the edge flag for each vertex. The value of BitsPerFlag shall be 2, 4, or 8, but only the least significant 2 bits in each flag value shall be used. The value for the edge flag shall be 0, 1, or 2 -
decode- thePdfArrayof numbers specifying how to map vertex coordinates and colour components into the appropriate ranges of values. The ranges shall be specified as follows: [x_min x_max y_min y_max c1_min c1_max … cn_min cn_max]. Only one pair of color values shall be specified if a Function entry is present
-