Class PdfFunctionBasedShading
- java.lang.Object
-
- com.itextpdf.kernel.pdf.PdfObjectWrapper<PdfDictionary>
-
- com.itextpdf.kernel.pdf.colorspace.shading.AbstractPdfShading
-
- com.itextpdf.kernel.pdf.colorspace.shading.PdfFunctionBasedShading
-
public class PdfFunctionBasedShading extends AbstractPdfShading
The class that extendsAbstractPdfShadingclass and is in charge of Shading Dictionary with function-based type, that defines color at every point in the domain by a specified mathematical function.
-
-
Constructor Summary
Constructors Constructor Description PdfFunctionBasedShading(PdfColorSpace colorSpace, IPdfFunction function)Creates the new instance of the class.PdfFunctionBasedShading(PdfDictionary pdfDictionary)Creates the new instance of the class from the existingPdfDictionary.PdfFunctionBasedShading(PdfObject colorSpace, IPdfFunction function)Creates the new instance of the class.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description PdfArraygetDomain()Gets thePdfArraydomain rectangle object that establishes an internal coordinate space for the shading that is independent of the target coordinate space in which it shall be painted.PdfArraygetMatrix()Gets thePdfArrayof floats that represents the transformation matrix that maps the domain rectangle into a corresponding figure in the target coordinate space.voidsetDomain(float xmin, float xmax, float ymin, float ymax)Sets thePdfArraydomain rectangle object that establishes an internal coordinate space for the shading that is independent of the target coordinate space in which it shall be painted.voidsetDomain(PdfArray domain)Sets thePdfArraydomain rectangle object that establishes an internal coordinate space for the shading that is independent of the target coordinate space in which it shall be painted.voidsetMatrix(float[] matrix)Sets the array of floats that represents the transformation matrix that maps the domain rectangle into a corresponding figure in the target coordinate space.voidsetMatrix(PdfArray matrix)Sets the array of floats that represents the transformation matrix that maps the domain rectangle into a corresponding figure in the target coordinate space.-
Methods inherited from class com.itextpdf.kernel.pdf.colorspace.shading.AbstractPdfShading
flush, getColorSpace, getFunction, getShadingType, isWrappedObjectMustBeIndirect, makeShading, setFunction, setFunction
-
Methods inherited from class com.itextpdf.kernel.pdf.PdfObjectWrapper
ensureObjectIsAddedToDocument, ensureUnderlyingObjectHasIndirectReference, getPdfObject, isFlushed, makeIndirect, makeIndirect, markObjectAsIndirect, setForbidRelease, setModified, setPdfObject, unsetForbidRelease
-
-
-
-
Constructor Detail
-
PdfFunctionBasedShading
public PdfFunctionBasedShading(PdfDictionary pdfDictionary)
Creates the new instance of the class from the existingPdfDictionary.- Parameters:
pdfDictionary- from which thisPdfFunctionBasedShadingwill be created
-
PdfFunctionBasedShading
public PdfFunctionBasedShading(PdfColorSpace colorSpace, IPdfFunction function)
Creates the new instance of the class.- Parameters:
colorSpace- thePdfColorSpaceobject in which colour values shall be expressedfunction- theIPdfFunction, that is used to calculate color transitions
-
PdfFunctionBasedShading
public PdfFunctionBasedShading(PdfObject colorSpace, IPdfFunction function)
Creates the new instance of the class.- Parameters:
colorSpace- thePdfObject, that represents color space in which colour values shall be expressedfunction- theIPdfFunction, that is used to calculate color transitions
-
-
Method Detail
-
getDomain
public PdfArray getDomain()
Gets thePdfArraydomain rectangle object that establishes an internal coordinate space for the shading that is independent of the target coordinate space in which it shall be painted.- Returns:
PdfArraydomain rectangle
-
setDomain
public void setDomain(float xmin, float xmax, float ymin, float ymax)Sets thePdfArraydomain rectangle object that establishes an internal coordinate space for the shading that is independent of the target coordinate space in which it shall be painted.- Parameters:
xmin- the Xmin coordinate of rectanglexmax- the Xmax coordinate of rectangleymin- the Ymin coordinate of rectangleymax- the Ymax coordinate of rectangle
-
setDomain
public void setDomain(PdfArray domain)
Sets thePdfArraydomain rectangle object that establishes an internal coordinate space for the shading that is independent of the target coordinate space in which it shall be painted.- Parameters:
domain- thePdfArraydomain rectangle object to be set
-
getMatrix
public PdfArray getMatrix()
Gets thePdfArrayof floats that represents the transformation matrix that maps the domain rectangle into a corresponding figure in the target coordinate space.- Returns:
- the
PdfArrayof transformation matrix (identical matrix by default)
-
setMatrix
public void setMatrix(float[] matrix)
Sets the array of floats that represents the transformation matrix that maps the domain rectangle into a corresponding figure in the target coordinate space.- Parameters:
matrix- thefloat[]of transformation matrix to be set
-
-