Class PDMeshBasedShadingType

    • Field Detail

      • LOG

        private static final org.apache.commons.logging.Log LOG
    • Constructor Detail

      • PDMeshBasedShadingType

        PDMeshBasedShadingType​(COSDictionary shadingDictionary)
    • Method Detail

      • collectPatches

        final java.util.List<Patch> collectPatches​(java.awt.geom.AffineTransform xform,
                                                   Matrix matrix,
                                                   int controlPoints)
                                            throws java.io.IOException
        Create a patch list from a data stream, the returned list contains all the patches contained in the data stream.
        Parameters:
        xform - transformation for user to device space
        matrix - the pattern matrix concatenated with that of the parent content stream
        controlPoints - number of control points, 12 for type 6 shading and 16 for type 7 shading
        Returns:
        the obtained patch list
        Throws:
        java.io.IOException - when something went wrong
      • readPatch

        protected Patch readPatch​(javax.imageio.stream.ImageInputStream input,
                                  boolean isFree,
                                  java.awt.geom.Point2D[] implicitEdge,
                                  float[][] implicitCornerColor,
                                  long maxSrcCoord,
                                  long maxSrcColor,
                                  PDRange rangeX,
                                  PDRange rangeY,
                                  PDRange[] colRange,
                                  Matrix matrix,
                                  java.awt.geom.AffineTransform xform,
                                  int controlPoints)
                           throws java.io.IOException
        Read a single patch from a data stream, a patch contains information of its coordinates and color parameters.
        Parameters:
        input - the image source data stream
        isFree - whether this is a free patch
        implicitEdge - implicit edge when a patch is not free, otherwise it's not used
        implicitCornerColor - implicit colors when a patch is not free, otherwise it's not used
        maxSrcCoord - the maximum coordinate value calculated from source data
        maxSrcColor - the maximum color value calculated from source data
        rangeX - range for coordinate x
        rangeY - range for coordinate y
        colRange - range for color
        matrix - the pattern matrix concatenated with that of the parent content stream
        xform - transformation for user to device space
        controlPoints - number of control points, 12 for type 6 shading and 16 for type 7 shading
        Returns:
        a single patch
        Throws:
        java.io.IOException - when something went wrong
      • generatePatch

        abstract Patch generatePatch​(java.awt.geom.Point2D[] points,
                                     float[][] color)
        Create a patch using control points and 4 corner color values, in Type6ShadingContext, a CoonsPatch is returned; in Type6ShadingContext, a TensorPatch is returned.
        Parameters:
        points - 12 or 16 control points
        color - 4 corner colors
        Returns:
        a patch instance
      • getBounds

        public abstract java.awt.geom.Rectangle2D getBounds​(java.awt.geom.AffineTransform xform,
                                                            Matrix matrix)
                                                     throws java.io.IOException
        Description copied from class: PDShading
        Calculate a bounding rectangle around the areas of this shading context.
        Overrides:
        getBounds in class PDTriangleBasedShadingType
        Returns:
        Bounding rectangle or null, if not supported by this shading type.
        Throws:
        java.io.IOException
      • getBounds

        java.awt.geom.Rectangle2D getBounds​(java.awt.geom.AffineTransform xform,
                                            Matrix matrix,
                                            int controlPoints)
                                     throws java.io.IOException
        Throws:
        java.io.IOException