Class PNGRed
java.lang.Object
org.apache.batik.ext.awt.image.rendered.AbstractRed
org.apache.batik.ext.awt.image.codec.png.PNGRed
- All Implemented Interfaces:
RenderedImage, CachableRed
- Version:
- $Id$
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate byte[]private int[][]private intprivate intprivate intprivate intprivate byte[]private intprivate Rectangleprivate intprivate float[]private intprivate static final ComponentColorModelprivate static final ComponentColorModelprivate static final ComponentColorModelprivate static final ComponentColorModelprivate static final ComponentColorModelprivate static final ComponentColorModelprivate static final ComponentColorModelprivate static final ComponentColorModelprivate static final ComponentColorModelprivate static final ComponentColorModelprivate static final ComponentColorModelprivate static final ComponentColorModelprivate intprivate static final String[]private intprivate DataInputStreamprivate PNGDecodeParamprivate floatprivate booleanprivate PNGEncodeParamprivate final byte[][]private booleanprivate booleanprivate floatprivate intprivate int[]private booleanprivate static final int[]private static final int[]private static final int[]private static final int[]private static final int[]private static final int[]private int[]private intprivate byte[]private intprivate intprivate intprivate intprivate booleanprivate intprivate booleanprivate intprivate booleanstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intprivate static final intprivate static final intprivate static final intprivate static final intprivate static final intprivate static final intprivate static final intprivate static final intprivate static final intprivate static final intprivate static final intprivate static final intprivate static final intprivate static final intprivate static final intprivate intprivate MapA Hashtable containing the image properties.private byte[]private intprivate static final int[]private static final int[]private static final int[]private static final int[]private static final int[]private static final int[]private int[]private intprivate Listprivate booleanprivate Listprivate Listprivate WritableRasterprivate floatprivate Listprivate ListFields inherited from class AbstractRed
cm, minTileX, minTileY, numXTiles, numYTiles, props, sm, srcs, tileGridXOff, tileGridYOff, tileHeight, tileWidth -
Constructor Summary
ConstructorsConstructorDescriptionPNGRed(InputStream stream) PNGRed(InputStream stream, PNGDecodeParam decodeParam) -
Method Summary
Modifier and TypeMethodDescriptionstatic ColorModelA convenience method to create an instance ofComponentColorModelsuitable for use with the givenSampleModel.private WritableRastercreateRaster(int width, int height, int bands, int scanlineStride, int bitDepth) private static voiddecodeAverageFilter(byte[] curr, byte[] prev, int count, int bpp) private voiddecodeImage(boolean useInterlacing) private static voiddecodePaethFilter(byte[] curr, byte[] prev, int count, int bpp) private voiddecodePass(WritableRaster imRas, int xOffset, int yOffset, int xStep, int yStep, int passWidth, int passHeight) Reads in an image of a given size and returns it as a WritableRaster.private static voiddecodeSubFilter(byte[] curr, int count, int bpp) private static voiddecodeUpFilter(byte[] curr, byte[] prev, int count) private static StringgetChunkType(DataInputStream distream) getTile(int tileX, int tileY) private voidinitGammaLut(int bits) private voidinitGrayLut(int bits) private static intpaethPredictor(int a, int b, int c) private voidparse_bKGD_chunk(PNGRed.PNGChunk chunk) private voidparse_cHRM_chunk(PNGRed.PNGChunk chunk) private voidparse_gAMA_chunk(PNGRed.PNGChunk chunk) private voidparse_hIST_chunk(PNGRed.PNGChunk chunk) private voidparse_iCCP_chunk(PNGRed.PNGChunk chunk) private voidparse_IEND_chunk(PNGRed.PNGChunk chunk) private voidparse_IHDR_chunk(PNGRed.PNGChunk chunk) private voidparse_pHYs_chunk(PNGRed.PNGChunk chunk) private voidparse_PLTE_chunk(PNGRed.PNGChunk chunk) private voidparse_sBIT_chunk(PNGRed.PNGChunk chunk) private voidparse_sRGB_chunk(PNGRed.PNGChunk chunk) private voidparse_tEXt_chunk(PNGRed.PNGChunk chunk) private voidparse_tIME_chunk(PNGRed.PNGChunk chunk) private voidparse_tRNS_chunk(PNGRed.PNGChunk chunk) private voidparse_zTXt_chunk(PNGRed.PNGChunk chunk) private voidprocessPixels(int process, Raster src, WritableRaster dst, int xOffset, int step, int y, int width) private static PNGRed.PNGChunkreadChunk(DataInputStream distream) Methods inherited from class AbstractRed
copyBand, copyToRaster, getBounds, getColorModel, getData, getData, getDependencyRegion, getDirtyRegion, getHeight, getMinTileX, getMinTileY, getMinX, getMinY, getNumXTiles, getNumYTiles, getProperty, getPropertyNames, getSampleModel, getSources, getTileGridXOffset, getTileGridYOffset, getTileHeight, getTileWidth, getWidth, getXTile, getYTile, init, init, makeTile, updateTileGridInfo
-
Field Details
-
PNG_COLOR_GRAY
public static final int PNG_COLOR_GRAY- See Also:
-
PNG_COLOR_RGB
public static final int PNG_COLOR_RGB- See Also:
-
PNG_COLOR_PALETTE
public static final int PNG_COLOR_PALETTE- See Also:
-
PNG_COLOR_GRAY_ALPHA
public static final int PNG_COLOR_GRAY_ALPHA- See Also:
-
PNG_COLOR_RGB_ALPHA
public static final int PNG_COLOR_RGB_ALPHA- See Also:
-
colorTypeNames
-
PNG_FILTER_NONE
public static final int PNG_FILTER_NONE- See Also:
-
PNG_FILTER_SUB
public static final int PNG_FILTER_SUB- See Also:
-
PNG_FILTER_UP
public static final int PNG_FILTER_UP- See Also:
-
PNG_FILTER_AVERAGE
public static final int PNG_FILTER_AVERAGE- See Also:
-
PNG_FILTER_PAETH
public static final int PNG_FILTER_PAETH- See Also:
-
bandOffsets
private int[][] bandOffsets -
bitDepth
private int bitDepth -
colorType
private int colorType -
compressionMethod
private int compressionMethod -
filterMethod
private int filterMethod -
interlaceMethod
private int interlaceMethod -
paletteEntries
private int paletteEntries -
redPalette
private byte[] redPalette -
greenPalette
private byte[] greenPalette -
bluePalette
private byte[] bluePalette -
alphaPalette
private byte[] alphaPalette -
bkgdRed
private int bkgdRed -
bkgdGreen
private int bkgdGreen -
bkgdBlue
private int bkgdBlue -
grayTransparentAlpha
private int grayTransparentAlpha -
redTransparentAlpha
private int redTransparentAlpha -
greenTransparentAlpha
private int greenTransparentAlpha -
blueTransparentAlpha
private int blueTransparentAlpha -
maxOpacity
private int maxOpacity -
significantBits
private int[] significantBits -
suppressAlpha
private boolean suppressAlpha -
expandPalette
private boolean expandPalette -
output8BitGray
private boolean output8BitGray -
outputHasAlphaPalette
private boolean outputHasAlphaPalette -
performGammaCorrection
private boolean performGammaCorrection -
expandGrayAlpha
private boolean expandGrayAlpha -
generateEncodeParam
private boolean generateEncodeParam -
decodeParam
-
encodeParam
-
emitProperties
private boolean emitProperties -
fileGamma
private float fileGamma -
userExponent
private float userExponent -
displayExponent
private float displayExponent -
chromaticity
private float[] chromaticity -
sRGBRenderingIntent
private int sRGBRenderingIntent -
postProcess
private int postProcess -
POST_NONE
private static final int POST_NONE- See Also:
-
POST_GAMMA
private static final int POST_GAMMA- See Also:
-
POST_GRAY_LUT
private static final int POST_GRAY_LUT- See Also:
-
POST_GRAY_LUT_ADD_TRANS
private static final int POST_GRAY_LUT_ADD_TRANS- See Also:
-
POST_PALETTE_TO_RGB
private static final int POST_PALETTE_TO_RGB- See Also:
-
POST_PALETTE_TO_RGBA
private static final int POST_PALETTE_TO_RGBA- See Also:
-
POST_ADD_GRAY_TRANS
private static final int POST_ADD_GRAY_TRANS- See Also:
-
POST_ADD_RGB_TRANS
private static final int POST_ADD_RGB_TRANS- See Also:
-
POST_REMOVE_GRAY_TRANS
private static final int POST_REMOVE_GRAY_TRANS- See Also:
-
POST_REMOVE_RGB_TRANS
private static final int POST_REMOVE_RGB_TRANS- See Also:
-
POST_EXP_MASK
private static final int POST_EXP_MASK- See Also:
-
POST_GRAY_ALPHA_EXP
private static final int POST_GRAY_ALPHA_EXP- See Also:
-
POST_GAMMA_EXP
private static final int POST_GAMMA_EXP- See Also:
-
POST_GRAY_LUT_ADD_TRANS_EXP
private static final int POST_GRAY_LUT_ADD_TRANS_EXP- See Also:
-
POST_ADD_GRAY_TRANS_EXP
private static final int POST_ADD_GRAY_TRANS_EXP- See Also:
-
streamVec
-
dataStream
-
bytesPerPixel
private int bytesPerPixel -
inputBands
private int inputBands -
outputBands
private int outputBands -
chunkIndex
private int chunkIndex -
textKeys
-
textStrings
-
ztextKeys
-
ztextStrings
-
theTile
-
bounds
-
properties
A Hashtable containing the image properties. -
gammaLut
private int[] gammaLut -
expandBits
private final byte[][] expandBits -
grayLut
private int[] grayLut -
GrayBits8
private static final int[] GrayBits8 -
colorModelGray8
-
GrayAlphaBits8
private static final int[] GrayAlphaBits8 -
colorModelGrayAlpha8
-
GrayBits16
private static final int[] GrayBits16 -
colorModelGray16
-
GrayAlphaBits16
private static final int[] GrayAlphaBits16 -
colorModelGrayAlpha16
-
GrayBits32
private static final int[] GrayBits32 -
colorModelGray32
-
GrayAlphaBits32
private static final int[] GrayAlphaBits32 -
colorModelGrayAlpha32
-
RGBBits8
private static final int[] RGBBits8 -
colorModelRGB8
-
RGBABits8
private static final int[] RGBABits8 -
colorModelRGBA8
-
RGBBits16
private static final int[] RGBBits16 -
colorModelRGB16
-
RGBABits16
private static final int[] RGBABits16 -
colorModelRGBA16
-
RGBBits32
private static final int[] RGBBits32 -
colorModelRGB32
-
RGBABits32
private static final int[] RGBABits32 -
colorModelRGBA32
-
-
Constructor Details
-
PNGRed
- Throws:
IOException
-
PNGRed
- Throws:
IOException
-
-
Method Details
-
initGammaLut
private void initGammaLut(int bits) -
initGrayLut
private void initGrayLut(int bits) -
getChunkType
-
readChunk
-
parse_IHDR_chunk
-
parse_IEND_chunk
- Throws:
Exception
-
createComponentColorModel
A convenience method to create an instance ofComponentColorModelsuitable for use with the givenSampleModel. TheSampleModelshould have a data type ofDataBuffer.TYPE_BYTE,TYPE_USHORT, orTYPE_INTand between 1 and 4 bands. Depending on the number of bands of theSampleModel, either a gray, gray+alpha, rgb, or rgb+alphaColorModelis returned. -
parse_PLTE_chunk
-
parse_bKGD_chunk
-
parse_cHRM_chunk
-
parse_gAMA_chunk
-
parse_hIST_chunk
-
parse_iCCP_chunk
-
parse_pHYs_chunk
-
parse_sBIT_chunk
-
parse_sRGB_chunk
-
parse_tEXt_chunk
-
parse_tIME_chunk
-
parse_tRNS_chunk
-
parse_zTXt_chunk
-
createRaster
private WritableRaster createRaster(int width, int height, int bands, int scanlineStride, int bitDepth) -
decodeSubFilter
private static void decodeSubFilter(byte[] curr, int count, int bpp) -
decodeUpFilter
private static void decodeUpFilter(byte[] curr, byte[] prev, int count) -
decodeAverageFilter
private static void decodeAverageFilter(byte[] curr, byte[] prev, int count, int bpp) -
paethPredictor
private static int paethPredictor(int a, int b, int c) -
decodePaethFilter
private static void decodePaethFilter(byte[] curr, byte[] prev, int count, int bpp) -
processPixels
private void processPixels(int process, Raster src, WritableRaster dst, int xOffset, int step, int y, int width) -
decodePass
private void decodePass(WritableRaster imRas, int xOffset, int yOffset, int xStep, int yStep, int passWidth, int passHeight) Reads in an image of a given size and returns it as a WritableRaster. -
decodeImage
private void decodeImage(boolean useInterlacing) -
copyData
-
getTile
- Specified by:
getTilein interfaceRenderedImage- Overrides:
getTilein classAbstractRed
-