iText 8.0.5 API
iText.Kernel.Colors.Gradients.LinearGradientBuilder Class Reference

The linear gradient builder implementation with direct target gradient vector and shading transformation ( more info ) More...

Inheritance diagram for iText.Kernel.Colors.Gradients.LinearGradientBuilder:
iText.Kernel.Colors.Gradients.AbstractLinearGradientBuilder

Public Member Functions

  LinearGradientBuilder ()
  Constructs the builder instance More...
 
virtual iText.Kernel.Colors.Gradients.LinearGradientBuilder  SetGradientVector (double x0, double y0, double x1, double y1)
  Set coordinates for gradient vector ( more info ) More...
 
virtual iText.Kernel.Colors.Gradients.LinearGradientBuilder  SetCurrentSpaceToGradientVectorSpaceTransformation (AffineTransform transformation)
  Set the linear gradient space transformation which specifies the transformation from the current coordinates space to gradient vector space More...
 
- Public Member Functions inherited from iText.Kernel.Colors.Gradients.AbstractLinearGradientBuilder
virtual AbstractLinearGradientBuilder  AddColorStop (GradientColorStop gradientColorStop)
  Adds the new color stop to the end ( more info ). More...
 
virtual AbstractLinearGradientBuilder  SetSpreadMethod (GradientSpreadMethod gradientSpreadMethod)
  Set the spread method to use for the gradient More...
 
virtual IList< GradientColorStop GetColorStops ()
  Get the copy of current color stops list. More...
 
virtual GradientSpreadMethod  GetSpreadMethod ()
  Get the current spread method More...
 
virtual Color  BuildColor (Rectangle targetBoundingBox, AffineTransform contextTransform, PdfDocument document)
  Builds the iText.Kernel.Colors.Color object representing the linear gradient with specified configuration that fills the target bounding box. More...
 

Package Functions

override Point[]  GetGradientVector (Rectangle targetBoundingBox, AffineTransform contextTransform)
  Returns the base gradient vector in gradient vector space. More...
 
override AffineTransform  GetCurrentSpaceToGradientVectorSpaceTransformation (Rectangle targetBoundingBox, AffineTransform contextTransform)
  Returns the current space to gradient vector space transformations that should be applied to the shading color. More...
 

Additional Inherited Members

- Static Package Functions inherited from iText.Kernel.Colors.Gradients.AbstractLinearGradientBuilder
static double[]  EvaluateCoveringDomain (Point[] coords, Rectangle toCover)
  Evaluates the minimal domain that covers the box with vector normals. More...
 
static Point[]  CreateCoordinatesForNewDomain (double[] newDomain, Point[] baseVector)
  Expand the base vector to cover the new domain More...
 
- Static Package Attributes inherited from iText.Kernel.Colors.Gradients.AbstractLinearGradientBuilder
const double  ZERO_EPSILON = 1E-10
  The epsilon value used for data creation More...
 

Detailed Description

The linear gradient builder implementation with direct target gradient vector and shading transformation ( more info )

Constructor & Destructor Documentation

◆ LinearGradientBuilder()

iText.Kernel.Colors.Gradients.LinearGradientBuilder.LinearGradientBuilder ( )
inline

Constructs the builder instance

Member Function Documentation

◆ GetCurrentSpaceToGradientVectorSpaceTransformation()

override AffineTransform iText.Kernel.Colors.Gradients.LinearGradientBuilder.GetCurrentSpaceToGradientVectorSpaceTransformation ( Rectangle  targetBoundingBox,
AffineTransform  contextTransform 
)
inlinepackagevirtual

Returns the current space to gradient vector space transformations that should be applied to the shading color.

Returns the current space to gradient vector space transformations that should be applied to the shading color. The transformation should be invertible as the current target bounding box coordinates should be transformed into the resulted shading space coordinates.

Parameters
targetBoundingBox the rectangle to be covered by constructed color in current space
contextTransform the current canvas transformation
Returns
the additional transformation to be concatenated to the current for resulted shading or null if no additional transformation is specified

Reimplemented from iText.Kernel.Colors.Gradients.AbstractLinearGradientBuilder.

◆ GetGradientVector()

override Point [] iText.Kernel.Colors.Gradients.LinearGradientBuilder.GetGradientVector ( Rectangle  targetBoundingBox,
AffineTransform  contextTransform 
)
inlinepackagevirtual

Returns the base gradient vector in gradient vector space.

Returns the base gradient vector in gradient vector space. This vector would be set as shading coordinates vector and its length would be used to translate all color stops absolute offsets into the relatives.

Parameters
targetBoundingBox the rectangle to be covered by constructed color in current space
contextTransform the current canvas transformation
Returns
the array of exactly two elements specifying the gradient coordinates vector

Implements iText.Kernel.Colors.Gradients.AbstractLinearGradientBuilder.

◆ SetCurrentSpaceToGradientVectorSpaceTransformation()

virtual iText.Kernel.Colors.Gradients.LinearGradientBuilder iText.Kernel.Colors.Gradients.LinearGradientBuilder.SetCurrentSpaceToGradientVectorSpaceTransformation ( AffineTransform  transformation )
inlinevirtual

Set the linear gradient space transformation which specifies the transformation from the current coordinates space to gradient vector space

Set the linear gradient space transformation which specifies the transformation from the current coordinates space to gradient vector space

The current space is the one on which linear gradient will be drawn (as a fill or stroke color for shapes on PDF canvas). This transformation mainly used for color lines skewing.

Parameters
transformation the iText.Kernel.Geom.AffineTransform representing the transformation to set
Returns
the current builder instance

◆ SetGradientVector()

virtual iText.Kernel.Colors.Gradients.LinearGradientBuilder iText.Kernel.Colors.Gradients.LinearGradientBuilder.SetGradientVector ( double  x0,
double  y0,
double  x1,
double  y1 
)
inlinevirtual

Set coordinates for gradient vector ( more info )

Parameters
x0 the x coordinate of the vector start
y0 the y coordinate of the vector start
x1 the x coordinate of the vector end
y1 the y coordinate of the vector end
Returns
the current builder instance