Class PdfShading.LatticeFormGouraudShadedTriangleMesh
java.lang.Object
com.itextpdf.kernel.pdf.PdfObjectWrapper<PdfDictionary>
com.itextpdf.kernel.pdf.colorspace.PdfShading
com.itextpdf.kernel.pdf.colorspace.PdfShading.LatticeFormGouraudShadedTriangleMesh
- Enclosing class:
- PdfShading
The class that extends
PdfShading class and is in charge of Shading Dictionary with lattice-form Gouraud-shaded triangle mesh type. This type is similar to PdfShading.FreeFormGouraudShadedTriangleMesh but instead of using free-form geometry, the vertices are arranged in a pseudorectangular lattice, which is topologically equivalent to a rectangular grid. The vertices are organized into rows, which need not be geometrically linear. The verticals data in stream is similar to PdfShading.FreeFormGouraudShadedTriangleMesh, except there is no edge flag.
-
Nested Class Summary
Nested classes/interfaces inherited from class com.itextpdf.kernel.pdf.colorspace.PdfShading
PdfShading.Axial, PdfShading.CoonsPatchMesh, PdfShading.FreeFormGouraudShadedTriangleMesh, PdfShading.FunctionBased, PdfShading.LatticeFormGouraudShadedTriangleMesh, PdfShading.Radial, PdfShading.TensorProductPatchMesh -
Constructor Summary
ConstructorsModifierConstructorDescriptionLatticeFormGouraudShadedTriangleMesh(PdfColorSpace cs, int bitsPerCoordinate, int bitsPerComponent, int verticesPerRow, float[] decode) Creates the new instance of the class.LatticeFormGouraudShadedTriangleMesh(PdfColorSpace cs, int bitsPerCoordinate, int bitsPerComponent, int verticesPerRow, PdfArray decode) Creates the new instance of the class.protectedLatticeFormGouraudShadedTriangleMesh(PdfStream pdfStream) Creates the new instance of the class from the existingPdfStream. -
Method Summary
Modifier and TypeMethodDescriptionintGets the number of bits used to represent each colour component.intGets the number of bits used to represent each vertex coordinate.Gets thePdfArrayof numbers specifying how to map vertex coordinates and colour components into the appropriate ranges of values.intGets the number of vertices in each row of the lattice.voidsetBitsPerComponent(int bitsPerComponent) Sets the number of bits used to represent each colour component.voidsetBitsPerCoordinate(int bitsPerCoordinate) Sets the number of bits used to represent each vertex coordinate.voidsetDecode(float[] decode) Sets thefloat[]of numbers specifying how to map vertex coordinates and colour components into the appropriate ranges of values.voidSets thePdfArrayof numbers specifying how to map vertex coordinates and colour components into the appropriate ranges of values.voidsetVerticesPerRow(int verticesPerRow) Sets the number of vertices in each row of the lattice.Methods inherited from class com.itextpdf.kernel.pdf.colorspace.PdfShading
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
-
LatticeFormGouraudShadedTriangleMesh
Creates the new instance of the class from the existingPdfStream.- Parameters:
-
pdfStream- from which thisPdfShading.LatticeFormGouraudShadedTriangleMeshwill be created
-
LatticeFormGouraudShadedTriangleMesh
public LatticeFormGouraudShadedTriangleMesh(PdfColorSpace cs, int bitsPerCoordinate, int bitsPerComponent, int verticesPerRow, 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. -
verticesPerRow- the number of vertices in each row of the lattice (shall be > 1). The number of rows need not be specified. -
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.
-
LatticeFormGouraudShadedTriangleMesh
public LatticeFormGouraudShadedTriangleMesh(PdfColorSpace cs, int bitsPerCoordinate, int bitsPerComponent, int verticesPerRow, 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. -
verticesPerRow- the number of vertices in each row of the lattice (shall be > 1). The number of rows need not be specified. -
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.
-
-
Method Details
-
getBitsPerCoordinate
public int getBitsPerCoordinate()Gets the number of bits used to represent each vertex coordinate.- Returns:
- the number of bits. Can be 1, 2, 4, 8, 12, 16, 24, or 32.
-
setBitsPerCoordinate
public void setBitsPerCoordinate(int bitsPerCoordinate) Sets the number of bits used to represent each vertex coordinate.- Parameters:
-
bitsPerCoordinate- the number of bits to be set. Shall be 1, 2, 4, 8, 12, 16, 24, or 32.
-
getBitsPerComponent
public int getBitsPerComponent()Gets the number of bits used to represent each colour component.- Returns:
- the number of bits. Can be 1, 2, 4, 8, 12, or 16.
-
setBitsPerComponent
public void setBitsPerComponent(int bitsPerComponent) Sets the number of bits used to represent each colour component.- Parameters:
-
bitsPerComponent- the number of bits to be set. Shall be 1, 2, 4, 8, 12, or 16.
-
getVerticesPerRow
public int getVerticesPerRow()Gets the number of vertices in each row of the lattice.- Returns:
- the number of vertices. Can only be greater than 1.
-
setVerticesPerRow
public void setVerticesPerRow(int verticesPerRow) Sets the number of vertices in each row of the lattice. The number of rows need not be specified.- Parameters:
-
verticesPerRow- the number of vertices to be set. Shall be greater than 1.
-
getDecode
Gets 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.- Returns:
-
the
PdfArrayDecode object.
-
setDecode
public void setDecode(float[] decode) Sets thefloat[]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.- Parameters:
-
decode- thefloat[]of Decode object to set.
-
setDecode
Sets 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.- Parameters:
-
decode- thePdfArrayDecode object to set.
-