Class PdfRadialShading
java.lang.Object
com.itextpdf.kernel.pdf.PdfObjectWrapper<PdfDictionary>
com.itextpdf.kernel.pdf.colorspace.shading.AbstractPdfShading
com.itextpdf.kernel.pdf.colorspace.shading.AbstractPdfShadingBlend
com.itextpdf.kernel.pdf.colorspace.shading.PdfRadialShading
The class that extends
AbstractPdfShading
and AbstractPdfShadingBlend
classes
and is in charge of Shading Dictionary with radial type, that defines a colour blend that varies between two circles.
This type of shading shall not be used with an Indexed colour space
-
Constructor Summary
ConstructorsConstructorDescriptionPdfRadialShading
(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.PdfRadialShading
(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.PdfRadialShading
(PdfColorSpace cs, PdfArray coords, IPdfFunction function) Creates the new instance of the class.PdfRadialShading
(PdfDictionary pdfDictionary) Creates the new instance of the class from the existingPdfDictionary
. -
Method Summary
Modifier and TypeMethodDescriptionfinal void
setCoords
(float x0, float y0, float r0, float x1, float y1, float r1) Sets the coords object.Methods inherited from class com.itextpdf.kernel.pdf.colorspace.shading.AbstractPdfShadingBlend
getCoords, getDomain, getExtend, setCoords, setDomain, setDomain, setExtend, setExtend
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 Details
-
PdfRadialShading
Creates the new instance of the class from the existingPdfDictionary
.- Parameters:
pdfDictionary
- from which thisPdfRadialShading
will be created
-
PdfRadialShading
public PdfRadialShading(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 exceptedx0
- the X coordinate of starting circle's centre, expressed in in the shading’s target coordinate spacey0
- the Y coordinate of starting circle's centre, expressed in in the shading’s target coordinate spacer0
- 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 paintedcolor0
- thefloat[]
that represents the color in the start circlex1
- the X coordinate of ending circle's centre, expressed in in the shading’s target coordinate spacey1
- the Y coordinate of ending circle's centre, expressed in in the shading’s target coordinate spacer1
- 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 paintedcolor1
- thefloat[]
that represents the color in the end circle
-
PdfRadialShading
public PdfRadialShading(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 exceptedx0
- the X coordinate of starting circle's centre, expressed in in the shading’s target coordinate spacey0
- the Y coordinate of starting circle's centre, expressed in in the shading’s target coordinate spacer0
- 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 paintedcolor0
- thefloat[]
that represents the color in the start circlex1
- the X coordinate of ending circle's centre, expressed in in the shading’s target coordinate spacey1
- the Y coordinate of ending circle's centre, expressed in in the shading’s target coordinate spacer1
- 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 paintedcolor1
- thefloat[]
that represents the color in the end circleextend
- the array of twoboolean
that specified whether to extend the shading beyond the starting and ending points of the axis, respectively
-
PdfRadialShading
Creates the new instance of the class.- Parameters:
cs
- thePdfColorSpace
object in which colour values shall be expressed. The Indexed color space isn't exceptedcoords
- 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 paintedfunction
- theIPdfFunction
object, that is used to calculate color transitions
-
-
Method Details
-
setCoords
public final 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 spacey0
- the Y coordinate of starting circle's centre, expressed in in the shading’s target coordinate spacer0
- 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 paintedx1
- the X coordinate of ending circle's centre, expressed in in the shading’s target coordinate spacey1
- the Y coordinate of ending circle's centre, expressed in in the shading’s target coordinate spacer1
- 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
-