Class GradientHelper


  • public class GradientHelper
    extends java.lang.Object
    • Constructor Summary

      Constructors 
      Constructor Description
      GradientHelper()  
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      private static org.apache.pdfbox.cos.COSArray buildType2Functions​(java.util.List<FSLinearGradient.StopPoint> stopPoints, org.apache.pdfbox.cos.COSArray domain, org.apache.pdfbox.cos.COSArray encode)
      This method is used for setting colours to linear gradient.
      private static org.apache.pdfbox.pdmodel.common.function.PDFunctionType3 buildType3Function​(java.util.List<FSLinearGradient.StopPoint> stopPoints, float distance)
      This method is used for setting colour lengths to linear gradient.
      static org.apache.pdfbox.pdmodel.graphics.shading.PDShading createLinearGradient​(PdfBoxFastOutputDevice od, java.awt.geom.AffineTransform transform, FSLinearGradient gradient, java.awt.Shape bounds)
      This method is used for creating linear gradient with its components.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • GradientHelper

        public GradientHelper()
    • Method Detail

      • createLinearGradient

        public static org.apache.pdfbox.pdmodel.graphics.shading.PDShading createLinearGradient​(PdfBoxFastOutputDevice od,
                                                                                                java.awt.geom.AffineTransform transform,
                                                                                                FSLinearGradient gradient,
                                                                                                java.awt.Shape bounds)
        This method is used for creating linear gradient with its components.
        Returns:
        shading for rendering linear gradient in PDF
      • buildType3Function

        private static org.apache.pdfbox.pdmodel.common.function.PDFunctionType3 buildType3Function​(java.util.List<FSLinearGradient.StopPoint> stopPoints,
                                                                                                    float distance)
        This method is used for setting colour lengths to linear gradient.
        Parameters:
        stopPoints - colours and lengths of linear gradient.
        Returns:
        the function, which is an important parameter for setting linear gradient.
      • buildType2Functions

        private static org.apache.pdfbox.cos.COSArray buildType2Functions​(java.util.List<FSLinearGradient.StopPoint> stopPoints,
                                                                          org.apache.pdfbox.cos.COSArray domain,
                                                                          org.apache.pdfbox.cos.COSArray encode)
        This method is used for setting colours to linear gradient.
        Parameters:
        stopPoints - colours to use.
        domain - parameter for setting functiontype2
        encode - encoding COSArray
        Returns:
        the COSArray, which is an important parameter for setting linear gradient.