Class PdfShading.TensorProductPatchMesh
java.lang.Object
com.itextpdf.kernel.pdf.PdfObjectWrapper<PdfDictionary>
com.itextpdf.kernel.pdf.colorspace.PdfShading
com.itextpdf.kernel.pdf.colorspace.PdfShading.TensorProductPatchMesh
- Enclosing class:
- PdfShading
The class that extends
PdfShading class and is in charge of Shading Dictionary with Tensor-Product Patch mesh type. This type of shading is identical to PdfShading.CoonsPatchMesh, except that it's based on a bicubic tensor-product patch defined by 16 control points. For the format of data stream, that defines patches, see ISO-320001 Table 86.
-
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
ConstructorsModifierConstructorDescriptionTensorProductPatchMesh(PdfColorSpace cs, int bitsPerCoordinate, int bitsPerComponent, int bitsPerFlag, float[] decode) Creates the new instance of the class.TensorProductPatchMesh(PdfColorSpace cs, int bitsPerCoordinate, int bitsPerComponent, int bitsPerFlag, PdfArray decode) Creates the new instance of the class.protectedTensorProductPatchMesh(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.intGets the number of bits used to represent the edge flag for each vertex.Gets thePdfArrayof numbers specifying how to map vertex coordinates and colour components into the appropriate ranges of values.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.voidsetBitsPerFlag(int bitsPerFlag) Sets the number of bits used to represent the edge flag for each vertex.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.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
-
TensorProductPatchMesh
Creates the new instance of the class from the existingPdfStream.- Parameters:
-
pdfStream- from which thisPdfShading.TensorProductPatchMeshwill be created
-
TensorProductPatchMesh
public TensorProductPatchMesh(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, 2 or 3. -
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.
-
TensorProductPatchMesh
public TensorProductPatchMesh(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, 2 or 3. -
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.
-
getBitsPerFlag
public int getBitsPerFlag()Gets the number of bits used to represent the edge flag for each vertex. But only the least significant 2 bits in each flag value shall be used. The valid flag values are 0, 1, 2 or 3.- Returns:
- the number of bits. Can be 2, 4 or 8.
-
setBitsPerFlag
public void setBitsPerFlag(int bitsPerFlag) Sets the number of bits used to represent the edge flag for each vertex. But only the least significant 2 bits in each flag value shall be used. The valid flag values are 0, 1, 2 or 3.- Parameters:
-
bitsPerFlag- the number of bits to be set. Shall be 2, 4 or 8.
-
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.
-