Class ShadingContext

    • Field Detail

      • background

        private float[] background
      • rgbBackground

        private int rgbBackground
      • outputColorModel

        private java.awt.image.ColorModel outputColorModel
    • Constructor Detail

      • ShadingContext

        public ShadingContext​(PDShading shading,
                              java.awt.image.ColorModel cm,
                              java.awt.geom.AffineTransform xform,
                              Matrix matrix)
                       throws java.io.IOException
        Constructor.
        Parameters:
        shading - the shading type to be used
        cm - 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 there is an error getting the color space or doing background color conversion.
    • Method Detail

      • getBackground

        float[] getBackground()
      • getRgbBackground

        int getRgbBackground()
      • convertToRGB

        final int convertToRGB​(float[] values)
                        throws java.io.IOException
        Convert color values from shading colorspace to RGB color values encoded into an integer.
        Parameters:
        values - color values in shading colorspace.
        Returns:
        RGB values encoded in an integer.
        Throws:
        java.io.IOException - if the color conversion fails.
      • getColorModel

        java.awt.image.ColorModel getColorModel()
      • dispose

        void dispose()