| java.lang.Object org.eclipse.swt.internal.image.FileFormat org.eclipse.swt.internal.image.PNGFileFormat
Method Summary | |
static void | compress16BitDepthTo8BitDepth(byte[] source, int sourceOffset, byte[] destination, int destinationOffset, int numberOfValues) SWT does not support 16-bit depth color formats. | static int | compress16BitDepthTo8BitDepth(int value) SWT does not support 16-bit depth color formats. | void | filterRow(byte[] row, byte[] previousRow, int filterType) PNG supports four filtering types. | void | fireInterlacedFrameEvent(int frameCount) Fire an event to let listeners know that an interlaced
frame has been loaded. | int | getAlignedBytesPerRow() Answer the number of bytes in a word-aligned row of pixel data. | int | getBytesPerPixel() Answer the number of bytes needed to represent a pixel.
This value depends on the image's color type and bit
depth. | int | getBytesPerRow() Answer the number of bytes in each row of the image
data. | int | getBytesPerRow(int rowWidthInPixels) Answer the number of bytes in a row of the given pixel
width. | boolean | isFileFormat(LEDataInputStream stream) | ImageData[] | loadFromByteStream() Load the PNG image from the byte stream. | void | readInterlaceFrame(InputStream inputStream, int rowInterval, int columnInterval, int startRow, int startColumn, int frameCount) 1. | void | readInterlacedImage(InputStream inputStream) Read the pixel data for an interlaced image from the
data stream. | void | readNextChunk(PngChunkReader chunkReader) Read and handle the next chunk of data from the
PNG file. | void | readNonInterlacedImage(InputStream inputStream) Read the pixel data for a non-interlaced image from the
data stream. | void | readPixelData(PngIdatChunk chunk, PngChunkReader chunkReader) Read the image data from the data stream. | void | readSignature() Skip over signature data. | void | setImageDataValues(byte[] data, ImageData imageData) PNG supports some color types and bit depths that are
unsupported by SWT. | void | setPixelData(byte[] data, ImageData imageData) SWT does not support greyscale as a color type. | void | unloadIntoByteStream(ImageLoader loader) | byte[] | validateBitDepth(byte[] data) SWT does not support 16-bit depths. |
PRIME | final static int PRIME(Code) | | |
SIGNATURE_LENGTH | final static int SIGNATURE_LENGTH(Code) | | |
alphaPalette | byte[] alphaPalette(Code) | | |
headerByte1 | byte headerByte1(Code) | | |
headerByte2 | byte headerByte2(Code) | | |
compress16BitDepthTo8BitDepth | static void compress16BitDepthTo8BitDepth(byte[] source, int sourceOffset, byte[] destination, int destinationOffset, int numberOfValues)(Code) | | 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 | static int compress16BitDepthTo8BitDepth(int value)(Code) | | 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 | void filterRow(byte[] row, byte[] previousRow, int filterType)(Code) | | 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 | void fireInterlacedFrameEvent(int frameCount)(Code) | | 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 | int getAlignedBytesPerRow()(Code) | | Answer the number of bytes in a word-aligned row of pixel data.
|
getBytesPerPixel | int getBytesPerPixel()(Code) | | 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 | int getBytesPerRow()(Code) | | 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 | int getBytesPerRow(int rowWidthInPixels)(Code) | | 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.
|
loadFromByteStream | ImageData[] loadFromByteStream()(Code) | | Load the PNG image from the byte stream.
|
readInterlaceFrame | void readInterlaceFrame(InputStream inputStream, int rowInterval, int columnInterval, int startRow, int startColumn, int frameCount) throws IOException(Code) | | 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.
|
readInterlacedImage | void readInterlacedImage(InputStream inputStream) throws IOException(Code) | | Read the pixel data for an interlaced image from the
data stream.
|
readNonInterlacedImage | void readNonInterlacedImage(InputStream inputStream) throws IOException(Code) | | Read the pixel data for a non-interlaced image from the
data stream.
Update the imageData to reflect the new data.
|
readSignature | void readSignature() throws IOException(Code) | | Skip over signature data. This has already been
verified in isFileFormat().
|
setImageDataValues | void setImageDataValues(byte[] data, ImageData imageData)(Code) | | 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 | void setPixelData(byte[] data, ImageData imageData)(Code) | | 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.
|
validateBitDepth | byte[] validateBitDepth(byte[] data)(Code) | | SWT does not support 16-bit depths. If this image uses
16-bit depths, convert the data to an 8-bit depth.
|
|
|