Package com.ribs.pdf
Class PDFImageColorModel
java.lang.Object
java.awt.image.ColorModel
com.ribs.pdf.PDFImageColorModel
- All Implemented Interfaces:
Transparency
-
Field Summary
Fields inherited from class java.awt.image.ColorModel
pixel_bits, transferTypeFields inherited from interface java.awt.Transparency
BITMASK, OPAQUE, TRANSLUCENT -
Constructor Summary
ConstructorsConstructorDescriptionPDFImageColorModel(ColorSpace space, int bits, int[] significantBits, boolean hasalpha, int transferType) -
Method Summary
Modifier and TypeMethodDescriptioncoerceData(WritableRaster r, boolean premultipliedAlpha) static PDFImageColorModelcreatePDFModel(ColorSpace space, int bps, float[] decodemins, float[] decodemaxs, boolean hasalpha) static WritableRastercreatePDFRaster(byte[] packedbytes, com.ribs.pdf.SoftMask mask, ColorSpace space, int bps, int w, int h) static WritableRastercreatePDFRaster(byte[] packedbytes, ColorSpace space, int bps, int w, int h) intgetAlpha(int pixel) intgetBlue(int pixel) intgetGreen(int pixel) intReturns the number of color components present in the input pixelsintgetRed(int pixel) intgetRGB(int pixel) intconvert an array of elements, whose size is defined by the transfertype, into sRGB+alpha.voidinit(int bps, float[] decodemins, float[] decodemaxs) booleanvoidsetSoftMask(com.ribs.pdf.SoftMask m) Specify softmask (alpha) information for this imageMethods inherited from class java.awt.image.ColorModel
createCompatibleSampleModel, createCompatibleWritableRaster, equals, finalize, getAlpha, getAlphaRaster, getBlue, getColorSpace, getComponents, getComponents, getComponentSize, getComponentSize, getDataElement, getDataElement, getDataElements, getDataElements, getDataElements, getGreen, getNormalizedComponents, getNormalizedComponents, getNumColorComponents, getNumComponents, getPixelSize, getRed, getRGBdefault, getTransferType, getTransparency, getUnnormalizedComponents, hasAlpha, hashCode, isAlphaPremultiplied, isCompatibleSampleModel, toString
-
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
- Overrides:
coerceDatain classColorModel
-
isCompatibleRaster
- Overrides:
isCompatibleRasterin classColorModel
-
getRGB
public int getRGB(int pixel) - Overrides:
getRGBin classColorModel
-
getRed
public int getRed(int pixel) - Specified by:
getRedin classColorModel
-
getGreen
public int getGreen(int pixel) - Specified by:
getGreenin classColorModel
-
getBlue
public int getBlue(int pixel) - Specified by:
getBluein classColorModel
-
getAlpha
public int getAlpha(int pixel) - Specified by:
getAlphain classColorModel
-
getRGB
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:
getRGBin classColorModel
-