Class PdfShading.Axial
java.lang.Object
com.itextpdf.kernel.pdf.PdfObjectWrapper<PdfDictionary>
com.itextpdf.kernel.pdf.colorspace.PdfShading
com.itextpdf.kernel.pdf.colorspace.PdfShading.Axial
- Enclosing class:
- PdfShading
The class that extends
PdfShading
class and is in charge of Shading Dictionary with axial type, that define a colour blend that varies along a linear axis between two endpoints and extends indefinitely perpendicular to that axis.
-
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
ModifierConstructorDescriptionAxial
(PdfColorSpace cs, float x0, float y0, float[] color0, float x1, float y1, float[] color1) Creates the new instance of the class.Axial
(PdfColorSpace cs, float x0, float y0, float[] color0, float x1, float y1, float[] color1, boolean[] extend) Creates the new instance of the class.Axial
(PdfColorSpace cs, PdfArray coords, PdfFunction function) Creates the new instance of the class.Axial
(PdfColorSpace cs, PdfArray coords, PdfArray domain, PdfFunction function) Creates the new instance of the class.protected
Axial
(PdfDictionary pdfDictionary) Creates the new instance of the class from the existingPdfDictionary
. -
Method Summary
Modifier and TypeMethodDescriptionGets the Coords object - aPdfArray
of four numbers [x0 y0 x1 y1] that specified the starting and the endings coordinates of thew axis, expressed in the shading's target coordinate space.Gets thePdfArray
of twofloat
[t0, t1] that represent the limiting values of a parametric variable t, that becomes an input of color function(s).Gets thePdfArray
of twoboolean
that specified whether to extend the shading beyond the starting and ending points of the axis, respectively.void
setCoords
(float x0, float y0, float x1, float y1) Sets the Choords object with the four params expressed in the shading's target coordinate space.void
Sets the Choords object with thePdfArray
of four numbers [x0 y0 x1 y1], that specified the starting and the endings coordinates of thew axis, expressed in the shading's target coordinate space.void
setDomain
(float t0, float t1) Sets the Domain with the array of twofloat
[t0, t1] that represent the limiting values of a parametric variable t, that becomes an input of color function(s).void
Sets the Domain with thePdfArray
of twofloat
[t0, t1] that represent the limiting values of a parametric variable t, that becomes an input of color function(s).void
setExtend
(boolean extendStart, boolean extendEnd) Sets the Extend object with the twoboolean
value.void
Sets the Extend object with thePdfArray
of twoboolean
.Methods inherited from class com.itextpdf.kernel.pdf.colorspace.PdfShading
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 Details
-
Axial
Creates the new instance of the class from the existingPdfDictionary
.- Parameters:
-
pdfDictionary
- from which thisPdfShading.Axial
will be created
-
Axial
public Axial(PdfColorSpace cs, float x0, float y0, float[] color0, float x1, float y1, float[] color1) Creates the new instance of the class.- Parameters:
-
cs
- thePdfColorSpace
object in which colour values shall be expressed. The special Pattern space isn't excepted. -
x0
- the start coordinate of X axis expressed in the shading's target coordinate space. -
y0
- the start coordinate of Y axis expressed in the shading's target coordinate space. -
color0
- thefloat[]
that represents the color in the start point. -
x1
- the end coordinate of X axis expressed in the shading's target coordinate space. -
y1
- the end coordinate of Y axis expressed in the shading's target coordinate space. -
color1
- thefloat[]
that represents the color in the end point.
-
Axial
public Axial(PdfColorSpace cs, float x0, float y0, float[] color0, float x1, float y1, float[] color1, boolean[] extend) Creates the new instance of the class.- Parameters:
-
cs
- thePdfColorSpace
object in which colour values shall be expressed. The special Pattern space isn't excepted. -
x0
- the start coordinate of X axis expressed in the shading's target coordinate space. -
y0
- the start coordinate of Y axis expressed in the shading's target coordinate space. -
color0
- thefloat[]
that represents the color in the start point. -
x1
- the end coordinate of X axis expressed in the shading's target coordinate space. -
y1
- the end coordinate of Y axis expressed in the shading's target coordinate space. -
color1
- thefloat[]
that represents the color in the end point. -
extend
- the array of two booleans that specified whether to extend the shading beyond the starting and ending points of the axis, respectively.
-
Axial
Creates the new instance of the class.- Parameters:
-
cs
- thePdfColorSpace
object in which colour values shall be expressed. The special Pattern space isn't excepted. -
coords
- thePdfArray
of four numbers [x0 y0 x1 y1] that specified the starting and the endings coordinates of thew axis, expressed in the shading's target coordinate space. -
function
- thePdfFunction
object, that is used to calculate color transitions.
-
Axial
Creates the new instance of the class.- Parameters:
-
cs
- thePdfColorSpace
object in which colour values shall be expressed. The special Pattern space isn't excepted. -
coords
- thePdfArray
of four numbers [x0 y0 x1 y1] that specified the starting and the endings coordinates of thew axis, expressed in the shading's target coordinate space. -
domain
- thePdfArray
of two numbers [t0 t1] specifying the limiting values of a parametric variable t which is considered to vary linearly between these two values and becomes the input argument to the colour function. -
function
- thePdfFunction
object, that is used to calculate color transitions.
-
-
Method Details
-
getCoords
Gets the Coords object - aPdfArray
of four numbers [x0 y0 x1 y1] that specified the starting and the endings coordinates of thew axis, expressed in the shading's target coordinate space.- Returns:
-
the
PdfArray
Coords object.
-
setCoords
public void setCoords(float x0, float y0, float x1, float y1) Sets the Choords object with the four params expressed in the shading's target coordinate space.- Parameters:
-
x0
- the start coordinate of X axis to be set. -
y0
- the start coordinate of Y axis to be set. -
x1
- the end coordinate of X axis to be set. -
y1
- the end coordinate of Y axis to be set.
-
setCoords
Sets the Choords object with thePdfArray
of four numbers [x0 y0 x1 y1], that specified the starting and the endings coordinates of thew axis, expressed in the shading's target coordinate space.- Parameters:
-
coords
- the ChordsPdfArray
to be set.
-
getDomain
Gets thePdfArray
of twofloat
[t0, t1] that represent the limiting values of a parametric variable t, that becomes an input of color function(s).- Returns:
-
the
PdfArray
of Domain object ([0.0 1.0] by default)
-
setDomain
public void setDomain(float t0, float t1) Sets the Domain with the array of twofloat
[t0, t1] that represent the limiting values of a parametric variable t, that becomes an input of color function(s).- Parameters:
-
t0
- first limit of variable t -
t1
- second limit of variable t
-
setDomain
Sets the Domain with thePdfArray
of twofloat
[t0, t1] that represent the limiting values of a parametric variable t, that becomes an input of color function(s).- Parameters:
-
domain
- thePdfArray
that represents domain
-
getExtend
Gets thePdfArray
of twoboolean
that specified whether to extend the shading beyond the starting and ending points of the axis, respectively.- Returns:
-
the
PdfArray
of Extended object ([false false] by default)
-
setExtend
public void setExtend(boolean extendStart, boolean extendEnd) Sets the Extend object with the twoboolean
value.- Parameters:
-
extendStart
- if true will extend shading beyond the starting point of Coords -
extendEnd
- if true will extend shading beyond the ending point of Coords
-
setExtend
Sets the Extend object with thePdfArray
of twoboolean
. If first is true shading will extend beyond the starting point of Coords. If second is true shading will extend beyond the ending point of Coords.- Parameters:
-
extend
- thePdfArray
representing Extend object
-