Class GouraudShadingContext

    • Field Detail

      • triangleList

        private java.util.List<ShadedTriangle> triangleList
        triangle list.
    • Constructor Detail

      • GouraudShadingContext

        protected GouraudShadingContext​(PDShading shading,
                                        java.awt.image.ColorModel colorModel,
                                        java.awt.geom.AffineTransform xform,
                                        Matrix matrix)
                                 throws java.io.IOException
        Constructor creates an instance to be used for fill operations.
        Parameters:
        shading - the shading type to be used
        colorModel - the color model to be used
        xform - transformation for user to device space
        matrix - the pattern matrix concatenated with that of the parent content stream
        Throws:
        java.io.IOException - if something went wrong
    • Method Detail

      • setTriangleList

        final void setTriangleList​(java.util.List<ShadedTriangle> triangleList)
      • calcPixelTable

        protected java.util.Map<java.awt.Point,​java.lang.Integer> calcPixelTable​(java.awt.Rectangle deviceBounds)
                                                                                throws java.io.IOException
        Description copied from class: TriangleBasedShadingContext
        Calculate every point and its color and store them in a Hash table.
        Specified by:
        calcPixelTable in class TriangleBasedShadingContext
        Returns:
        a Hash table which contains all the points' positions and colors of one image
        Throws:
        java.io.IOException
      • calcPixelTableArray

        protected int[][] calcPixelTableArray​(java.awt.Rectangle deviceBounds)
                                       throws java.io.IOException
        Description copied from class: TriangleBasedShadingContext
        Calculate every point and its color and store them in a two-dimensional array.
        Specified by:
        calcPixelTableArray in class TriangleBasedShadingContext
        Returns:
        an array which contains all the points' positions and colors of one image
        Throws:
        java.io.IOException
      • dispose

        public void dispose()
        Specified by:
        dispose in interface java.awt.PaintContext
        Overrides:
        dispose in class ShadingContext