Class PdfShading.Radial
- java.lang.Object
-
- com.itextpdf.kernel.pdf.PdfObjectWrapper<PdfDictionary>
-
- com.itextpdf.kernel.pdf.colorspace.PdfShading
-
- com.itextpdf.kernel.pdf.colorspace.PdfShading.Radial
-
- Enclosing class:
- PdfShading
public static class PdfShading.Radial extends PdfShading
The class that extendsPdfShading
class and is in charge of Shading Dictionary with radial type, that define a colour blend that varies between two circles. This type of shading shall not be used with an Indexed colour space
-
-
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.ShadingType, PdfShading.TensorProductPatchMesh
-
-
Constructor Summary
Constructors Modifier Constructor Description Radial(PdfColorSpace cs, float x0, float y0, float r0, float[] color0, float x1, float y1, float r1, float[] color1)
Creates the new instance of the class.Radial(PdfColorSpace cs, float x0, float y0, float r0, float[] color0, float x1, float y1, float r1, float[] color1, boolean[] extend)
Creates the new instance of the class.Radial(PdfColorSpace cs, PdfArray coords, IPdfFunction function)
Creates the new instance of the class.protected
Radial(PdfDictionary pdfDictionary)
Creates the new instance of the class from the existingPdfDictionary
.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description PdfArray
getCoords()
Gets the coordsPdfArray
object - an array of six numbers [x0 y0 r0 x1 y1 r1], specifying the centres and radii of the starting and ending circles, expressed in the shading’s target coordinate space.PdfArray
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).PdfArray
getExtend()
Gets thePdfArray
of twoboolean
that specified whether to extend the shading beyond the starting and ending circles of the axis, respectively.void
setCoords(float x0, float y0, float r0, float x1, float y1, float r1)
Sets the coords object.void
setCoords(PdfArray coords)
Sets the coordsPdfArray
object - an array of six numbers [x0 y0 r0 x1 y1 r1], specifying the centres and radii of the starting and ending circles, 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
setDomain(PdfArray domain)
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
setExtend(PdfArray extend)
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 Detail
-
Radial
protected Radial(PdfDictionary pdfDictionary)
Creates the new instance of the class from the existingPdfDictionary
.- Parameters:
pdfDictionary
- from which thisPdfShading.Radial
will be created
-
Radial
public Radial(PdfColorSpace cs, float x0, float y0, float r0, float[] color0, float x1, float y1, float r1, float[] color1)
Creates the new instance of the class.- Parameters:
cs
- thePdfColorSpace
object in which colour values shall be expressed. The Indexed color space isn't excepted.x0
- the X coordinate of starting circle's centre, expressed in in the shading’s target coordinate space.y0
- the Y coordinate of starting circle's centre, expressed in in the shading’s target coordinate space.r0
- the radius of starting circle's centre, should be greater or equal to 0. If 0 then starting circle is treated as point. If both radii are 0, nothing shall be painted.color0
- thefloat[]
that represents the color in the start circle.x1
- the X coordinate of ending circle's centre, expressed in in the shading’s target coordinate space.y1
- the Y coordinate of ending circle's centre, expressed in in the shading’s target coordinate space.r1
- the radius of ending circle's centre, should be greater or equal to 0. If 0 then ending circle is treated as point. If both radii are 0, nothing shall be painted.color1
- thefloat[]
that represents the color in the end circle.
-
Radial
public Radial(PdfColorSpace cs, float x0, float y0, float r0, float[] color0, float x1, float y1, float r1, float[] color1, boolean[] extend)
Creates the new instance of the class.- Parameters:
cs
- thePdfColorSpace
object in which colour values shall be expressed. The Indexed color space isn't excepted.x0
- the X coordinate of starting circle's centre, expressed in in the shading’s target coordinate space.y0
- the Y coordinate of starting circle's centre, expressed in in the shading’s target coordinate space.r0
- the radius of starting circle's centre, should be greater or equal to 0. If 0 then starting circle is treated as point. If both radii are 0, nothing shall be painted.color0
- thefloat[]
that represents the color in the start circle.x1
- the X coordinate of ending circle's centre, expressed in in the shading’s target coordinate space.y1
- the Y coordinate of ending circle's centre, expressed in in the shading’s target coordinate space.r1
- the radius of ending circle's centre, should be greater or equal to 0. If 0 then ending circle is treated as point. If both radii are 0, nothing shall be painted.color1
- thefloat[]
that represents the color in the end circle.extend
- the array of twoboolean
that specified whether to extend the shading beyond the starting and ending points of the axis, respectively.
-
Radial
public Radial(PdfColorSpace cs, PdfArray coords, IPdfFunction function)
Creates the new instance of the class.- Parameters:
cs
- thePdfColorSpace
object in which colour values shall be expressed. The Indexed color space isn't excepted.coords
- thePdfArray
of of six numbers [x0 y0 r0 x1 y1 r1], specifying the centres and radii of the starting and ending circles, expressed in the shading’s target coordinate space. The radii r0 and r1 shall both be greater than or equal to 0. If one radius is 0, the corresponding circle shall be treated as a point; if both are 0, nothing shall be painted.function
- theIPdfFunction
object, that is used to calculate color transitions.
-
-
Method Detail
-
getCoords
public PdfArray getCoords()
Gets the coordsPdfArray
object - an array of six numbers [x0 y0 r0 x1 y1 r1], specifying the centres and radii of the starting and ending circles, expressed in the shading’s target coordinate space. The radii r0 and r1 shall both be greater than or equal to 0. If one radius is 0, the corresponding circle shall be treated as a point; if both are 0, nothing shall be painted.- Returns:
- the
PdfArray
coords object.
-
setCoords
public void setCoords(float x0, float y0, float r0, float x1, float y1, float r1)
Sets the coords object.- Parameters:
x0
- the X coordinate of starting circle's centre, expressed in in the shading’s target coordinate space.y0
- the Y coordinate of starting circle's centre, expressed in in the shading’s target coordinate space.r0
- the radius of starting circle's centre, should be greater or equal to 0. If 0 then starting circle is treated as point. If both radii are 0, nothing shall be painted.x1
- the X coordinate of ending circle's centre, expressed in in the shading’s target coordinate space.y1
- the Y coordinate of ending circle's centre, expressed in in the shading’s target coordinate space.r1
- the radius of ending circle's centre, should be greater or equal to 0. If 0 then ending circle is treated as point. If both radii are 0, nothing shall be painted.
-
setCoords
public void setCoords(PdfArray coords)
Sets the coordsPdfArray
object - an array of six numbers [x0 y0 r0 x1 y1 r1], specifying the centres and radii of the starting and ending circles, expressed in the shading’s target coordinate space. The radii r0 and r1 shall both be greater than or equal to 0. If one radius is 0, the corresponding circle shall be treated as a point; if both are 0, nothing shall be painted.- Parameters:
coords
- -PdfArray
choords object to be set.
-
getDomain
public PdfArray 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 tt1
- second limit of variable t
-
setDomain
public void setDomain(PdfArray domain)
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
public PdfArray getExtend()
Gets thePdfArray
of twoboolean
that specified whether to extend the shading beyond the starting and ending circles 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 circle of Coords.extendEnd
- if true will extend shading beyond the ending circle of Coords.
-
setExtend
public void setExtend(PdfArray extend)
Sets the Extend object with thePdfArray
of twoboolean
. If first is true shading will extend beyond the starting circle of Coords. If second is true shading will extend beyond the ending circle of Coords.- Parameters:
extend
- thePdfArray
representing Extend object
-
-