Class AbstractRadialGradientBuilder
java.lang.Object
com.itextpdf.kernel.colors.gradients.AbstractGradientBuilder<RadialGradientPoint>
com.itextpdf.kernel.colors.gradients.AbstractRadialGradientBuilder
- All Implemented Interfaces:
-
IGradientBuilder
- Direct Known Subclasses:
-
RadialGradientBuilder,StrategyBasedRadialGradientBuilder
public abstract class AbstractRadialGradientBuilder extends AbstractGradientBuilder<RadialGradientPoint>
Base class for radial gradient builders implementations.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected double[]computeCoveringDomain(RadialGradientPoint[] coords, Rectangle toCover) Computes the minimal domain that covers the box with vector normals.protected PdfArraycreateCoordsDictEntry(RadialGradientPoint[] coordsPoints) Converts gradient vector into pdf coordinates array for shading.protected RadialGradientPoint[]createCoordsForNewDomain(double[] newDomain, RadialGradientPoint[] baseVector) Expand the base vector to cover the new domainprotected RadialGradientPoint[]createCoveringCoordinates(Rectangle targetBoundingBox) Creates some gradient vector which would cover the target bounding box.protected AbstractPdfShadingcreatePdfShading(PdfColorSpace colorSpace, PdfArray coordinates, PdfArray coordinatesDomain, IPdfFunction stopsFunction) Creates the gradient shading object.protected doublegetBaseVectorLength(RadialGradientPoint[] coordinates) Evaluates base vector length for future color stops spreading.Methods inherited from class com.itextpdf.kernel.colors.gradients.AbstractGradientBuilder
addStopColor, buildColor, getGradientVectorWithTransform, getSpread, getStopColors, getToIntervalTransform, isZero, setSpread, setSvgLuminanceMode
-
Constructor Details
-
AbstractRadialGradientBuilder
public AbstractRadialGradientBuilder()
-
-
Method Details
-
createCoordsForNewDomain
protected RadialGradientPoint[] createCoordsForNewDomain(double[] newDomain, RadialGradientPoint[] baseVector) Expand the base vector to cover the new domain- Specified by:
-
createCoordsForNewDomainin classAbstractGradientBuilder<RadialGradientPoint> - Parameters:
-
newDomain- the array of exactly two elements that specifies the domain that should be covered by the created vector -
baseVector- the array of exactly two elements that specifies the base vector which corresponds to [0, 1] domain - Returns:
- the array of two
-
createCoveringCoordinates
Creates some gradient vector which would cover the target bounding box.- Specified by:
-
createCoveringCoordinatesin classAbstractGradientBuilder<RadialGradientPoint> - Parameters:
-
targetBoundingBox- the bounding box to cover - Returns:
- constructed gradient vector
-
getBaseVectorLength
Evaluates base vector length for future color stops spreading.- Specified by:
-
getBaseVectorLengthin classAbstractGradientBuilder<RadialGradientPoint> - Parameters:
-
coordinates- the base vector - Returns:
- base vector length
-
createCoordsDictEntry
Converts gradient vector into pdf coordinates array for shading.- Specified by:
-
createCoordsDictEntryin classAbstractGradientBuilder<RadialGradientPoint> - Parameters:
-
coordsPoints- vector to convert - Returns:
- constructed pdf array
-
createPdfShading
protected AbstractPdfShading createPdfShading(PdfColorSpace colorSpace, PdfArray coordinates, PdfArray coordinatesDomain, IPdfFunction stopsFunction) Creates the gradient shading object.- Specified by:
-
createPdfShadingin classAbstractGradientBuilder<RadialGradientPoint> - Parameters:
-
colorSpace- colorspace to use -
coordinates- gradient coordinates -
coordinatesDomain- gradient coordinates domain -
stopsFunction- color stops function - Returns:
- constructed gradient shading
-
computeCoveringDomain
Computes the minimal domain that covers the box with vector normals. The domain corresponding to the initial vector is [0, 1].- Specified by:
-
computeCoveringDomainin classAbstractGradientBuilder<RadialGradientPoint> - Parameters:
-
coords- the array of exactly two elements that describe the base vector (corresponding to [0,1] domain, that need to be adjusted to cover the box -
toCover- the box that needs to be covered - Returns:
- the array of two elements in ascending order specifying the calculated covering domain
-