| Modifier and Type | Field and Description |
|---|---|
| pack-priv int | |
| pack-priv byte[] | |
| pack-priv byte[] | |
| pack-priv byte | |
| pack-priv byte | |
| pack-priv PngIhdrChunk | |
| pack-priv ImageData | |
| pack-priv PngPlteChunk | |
| pack-priv static final int | |
| pack-priv static final int |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| pack-priv static void | compress16BitDepthTo8BitDepth(byte[] source, int sourceOffset, byte[] destination, int destinationOffset, int numberOfValues)
SWT does not support 16-bit depth color formats. |
| pack-priv static int | |
| pack-priv void | |
| pack-priv void | fireInterlacedFrameEvent(int frameCount)
Fire an event to let listeners know that an interlaced frame has been loaded. |
| pack-priv int | |
| pack-priv int | |
| pack-priv int | |
| pack-priv int | |
| pack-priv boolean | isFileFormat(LEDataInputStream stream)
Implements abstract org. |
| pack-priv ImageData[] | loadFromByteStream()
Implements abstract org. |
| pack-priv void | readInterlacedImage(InputStream inputStream)
Read the pixel data for an interlaced image from the data stream. |
| pack-priv void | readInterlaceFrame(InputStream inputStream, int rowInterval, int columnInterval, int startRow, int startColumn, int frameCount)
1. |
| pack-priv void | |
| pack-priv void | readNonInterlacedImage(InputStream inputStream)
Read the pixel data for a non-interlaced image from the data stream. |
| pack-priv void | readPixelData(PngIdatChunk chunk, PngChunkReader chunkReader)
Read the image data from the data stream. |
| pack-priv void | |
| pack-priv void | setImageDataValues(byte[] data, ImageData imageData)
PNG supports some color types and bit depths that are unsupported by SWT. |
| pack-priv void | |
| pack-priv void | unloadIntoByteStream(ImageLoader loader)
Implements abstract org. |
| pack-priv byte[] |
| adler | back to summary |
|---|---|
| pack-priv int adler | |
| alphaPalette | back to summary |
|---|---|
| pack-priv byte[] alphaPalette | |
| data | back to summary |
|---|---|
| pack-priv byte[] data | |
| headerByte1 | back to summary |
|---|---|
| pack-priv byte headerByte1 | |
| headerByte2 | back to summary |
|---|---|
| pack-priv byte headerByte2 | |
| headerChunk | back to summary |
|---|---|
| pack-priv PngIhdrChunk headerChunk | |
| imageData | back to summary |
|---|---|
| pack-priv ImageData imageData | |
| paletteChunk | back to summary |
|---|---|
| pack-priv PngPlteChunk paletteChunk | |
| PRIME | back to summary |
|---|---|
| pack-priv static final int PRIME | |
| SIGNATURE_LENGTH | back to summary |
|---|---|
| pack-priv static final int SIGNATURE_LENGTH | |
| PNGFileFormat | back to summary |
|---|---|
| public PNGFileFormat() | |
| compress16BitDepthTo8BitDepth | back to summary |
|---|---|
| pack-priv static void compress16BitDepthTo8BitDepth(byte[] source, int sourceOffset, byte[] destination, int destinationOffset, int numberOfValues) SWT does not support 16-bit depth color formats. Convert the 16-bit data to 8-bit data. The correct way to do this is to multiply each 16 bit value by the value: (2^8 - 1) / (2^16 - 1). The fast way to do this is just to drop the low byte of the 16-bit value. | |
| compress16BitDepthTo8BitDepth | back to summary |
|---|---|
| pack-priv static int compress16BitDepthTo8BitDepth(int value) SWT does not support 16-bit depth color formats. Convert the 16-bit data to 8-bit data. The correct way to do this is to multiply each 16 bit value by the value: (2^8 - 1) / (2^16 - 1). The fast way to do this is just to drop the low byte of the 16-bit value. | |
| filterRow | back to summary |
|---|---|
| pack-priv void filterRow(byte[] row, byte[] previousRow, int filterType) PNG supports four filtering types. These types are applied per row of image data. This method unfilters the given row based on the filterType. | |
| fireInterlacedFrameEvent | back to summary |
|---|---|
| pack-priv void fireInterlacedFrameEvent(int frameCount) Fire an event to let listeners know that an interlaced frame has been loaded. finalFrame should be true if the image has finished loading, false if there are more frames to come. | |
| getAlignedBytesPerRow | back to summary |
|---|---|
| pack-priv int getAlignedBytesPerRow() Answer the number of bytes in a word-aligned row of pixel data. | |
| getBytesPerPixel | back to summary |
|---|---|
| pack-priv int getBytesPerPixel() Answer the number of bytes needed to represent a pixel. This value depends on the image's color type and bit depth. Note that this method rounds up if an image's pixel size isn't byte-aligned. | |
| getBytesPerRow | back to summary |
|---|---|
| pack-priv int getBytesPerRow() Answer the number of bytes in each row of the image data. Each PNG row is byte-aligned, so images with bit depths less than a byte may have unused bits at the end of each row. The value of these bits is undefined. | |
| getBytesPerRow | back to summary |
|---|---|
| pack-priv int getBytesPerRow(int rowWidthInPixels) Answer the number of bytes in a row of the given pixel width. Each row is byte-aligned, so images with bit depths less than a byte may have unused bits at the end of each row. The value of these bits is undefined. | |
| isFileFormat | back to summary |
|---|---|
| pack-priv boolean isFileFormat(LEDataInputStream stream) Implements abstract org. Doc from org. Return whether or not the specified input stream represents a supported file format.
| |
| loadFromByteStream | back to summary |
|---|---|
| pack-priv ImageData[] loadFromByteStream() Implements abstract org. Load the PNG image from the byte stream.
| |
| readInterlacedImage | back to summary |
|---|---|
| pack-priv void readInterlacedImage(InputStream inputStream) throws IOException Read the pixel data for an interlaced image from the data stream. | |
| readInterlaceFrame | back to summary |
|---|---|
| pack-priv void readInterlaceFrame(InputStream inputStream, int rowInterval, int columnInterval, int startRow, int startColumn, int frameCount) throws IOException 1. Read one of the seven frames of interlaced data. 2. Update the imageData. 3. Notify the image loader's listeners of the frame load. | |
| readNextChunk | back to summary |
|---|---|
| pack-priv void readNextChunk(PngChunkReader chunkReader) throws IOException Read and handle the next chunk of data from the PNG file. | |
| readNonInterlacedImage | back to summary |
|---|---|
| pack-priv void readNonInterlacedImage(InputStream inputStream) throws IOException Read the pixel data for a non-interlaced image from the data stream. Update the imageData to reflect the new data. | |
| readPixelData | back to summary |
|---|---|
| pack-priv void readPixelData(PngIdatChunk chunk, PngChunkReader chunkReader) throws IOException Read the image data from the data stream. This must handle decoding the data, filtering, and interlacing. | |
| readSignature | back to summary |
|---|---|
| pack-priv void readSignature() throws IOException Skip over signature data. This has already been verified in isFileFormat(). | |
| setImageDataValues | back to summary |
|---|---|
| pack-priv void setImageDataValues(byte[] data, ImageData imageData) PNG supports some color types and bit depths that are unsupported by SWT. If the image uses an unsupported color type (either of the gray scale types) or bit depth (16), convert the data to an SWT-supported format. Then assign the data into the ImageData given. | |
| setPixelData | back to summary |
|---|---|
| pack-priv void setPixelData(byte[] data, ImageData imageData) SWT does not support greyscale as a color type. For plain grayscale, we create a palette. For Grayscale with Alpha, however, we need to convert the pixels to use RGB values. Note This method assumes that the bit depth of the data has already been restricted to 8 or less. | |
| unloadIntoByteStream | back to summary |
|---|---|
| pack-priv void unloadIntoByteStream(ImageLoader loader) Implements abstract org.
| |
| validateBitDepth | back to summary |
|---|---|
| pack-priv byte[] validateBitDepth(byte[] data) SWT does not support 16-bit depths. If this image uses 16-bit depths, convert the data to an 8-bit depth. | |