Package com.ribs.pdf

Class PDFImageColorModel

java.lang.Object
java.awt.image.ColorModel
com.ribs.pdf.PDFImageColorModel
All Implemented Interfaces:
Transparency

public class PDFImageColorModel extends ColorModel
  • Constructor Details

    • PDFImageColorModel

      public PDFImageColorModel(ColorSpace space, int bits, int[] significantBits, boolean hasalpha, int transferType)
  • Method Details

    • createPDFModel

      public static PDFImageColorModel createPDFModel(ColorSpace space, int bps, float[] decodemins, float[] decodemaxs, boolean hasalpha)
    • createPDFRaster

      public static WritableRaster createPDFRaster(byte[] packedbytes, ColorSpace space, int bps, int w, int h)
    • createPDFRaster

      public static WritableRaster createPDFRaster(byte[] packedbytes, com.ribs.pdf.SoftMask mask, ColorSpace space, int bps, int w, int h)
    • init

      public void init(int bps, float[] decodemins, float[] decodemaxs)
    • setSoftMask

      public void setSoftMask(com.ribs.pdf.SoftMask m)
      Specify softmask (alpha) information for this image
    • getNumSourceComponents

      public int getNumSourceComponents()
      Returns the number of color components present in the input pixels
    • coerceData

      public ColorModel coerceData(WritableRaster r, boolean premultipliedAlpha)
      Overrides:
      coerceData in class ColorModel
    • isCompatibleRaster

      public boolean isCompatibleRaster(Raster r)
      Overrides:
      isCompatibleRaster in class ColorModel
    • getRGB

      public int getRGB(int pixel)
      Overrides:
      getRGB in class ColorModel
    • getRed

      public int getRed(int pixel)
      Specified by:
      getRed in class ColorModel
    • getGreen

      public int getGreen(int pixel)
      Specified by:
      getGreen in class ColorModel
    • getBlue

      public int getBlue(int pixel)
      Specified by:
      getBlue in class ColorModel
    • getAlpha

      public int getAlpha(int pixel)
      Specified by:
      getAlpha in class ColorModel
    • getRGB

      public int getRGB(Object inData)
      convert an array of elements, whose size is defined by the transfertype, into sRGB+alpha. First we normalize the components and then let the saved pdf colorspace convert into sRGB. We then merge in the alpha to get a pixel.
      Overrides:
      getRGB in class ColorModel