Class PngIhdrChunk
java.lang.Object
org.eclipse.swt.internal.image.PngChunk
org.eclipse.swt.internal.image.PngIhdrChunk
-
Field Summary
FieldsModifier and TypeFieldDescription(package private) static final int(package private) byte(package private) static final byte(package private) static final byte(package private) static final int(package private) static final byte(package private) static final byte(package private) static final byte(package private) byte(package private) static final int(package private) byte(package private) static final int(package private) static final int(package private) static final int(package private) static final int(package private) static final int(package private) static final int(package private) byte(package private) int(package private) static final int(package private) static final int(package private) static final int(package private) static final int(package private) static final int(package private) byte(package private) static final byte[](package private) static final byte[](package private) int(package private) static final intFields inherited from class PngChunk
CHUNK_IDAT, CHUNK_IEND, CHUNK_IHDR, CHUNK_PLTE, CHUNK_tRNS, CHUNK_UNKNOWN, CRC_TABLE, DATA_OFFSET, length, LENGTH_FIELD_LENGTH, LENGTH_OFFSET, MIN_LENGTH, reference, TYPE_FIELD_LENGTH, TYPE_IDAT, TYPE_IEND, TYPE_IHDR, TYPE_OFFSET, TYPE_PLTE, TYPE_tRNS -
Constructor Summary
ConstructorsConstructorDescriptionPngIhdrChunk(byte[] reference) Construct a PNGChunk using the reference bytes given.PngIhdrChunk(int width, int height, byte bitDepth, byte colorType, byte compressionMethod, byte filterMethod, byte interlaceMethod) -
Method Summary
Modifier and TypeMethodDescription(package private) voidcontributeToString(StringBuilder buffer) Provided so that subclasses can override and add data to the toString() call.(package private) PaletteData(package private) byteGet the image's bit depth.(package private) intAnswer the pixel size in bits based on the color type and bit depth.(package private) boolean(package private) int(package private) byteGet the image's color type.(package private) String(package private) byteGet the image's compression method.(package private) int(package private) byteGet the image's filter method.(package private) String(package private) intGet the image's height in pixels.(package private) byteGet the image's interlace method.(package private) String(package private) boolean(package private) PaletteData(package private) intAnswer the pixel size in bits based on the color type and bit depth.(package private) intgetWidth()Get the image's width in pixels.(package private) voidsetBitDepth(byte value) Set the image's bit depth.(package private) voidsetColorType(byte value) Set the image's color type.(package private) voidsetCompressionMethod(byte value) Set the image's compression method.(package private) voidsetFilterMethod(byte value) Set the image's filter method.(package private) voidsetHeight(int value) Set the image's height in pixels.(package private) voidsetInterlaceMethod(byte value) Set the image's interlace method.(package private) voidsetWidth(int value) Set the image's width in pixels.(package private) boolean(package private) voidvalidate(PngFileReadState readState, PngIhdrChunk headerChunk) Answer whether the chunk is a valid IHDR chunk.Methods inherited from class PngChunk
checkCRC, computeCRC, getCRC, getData, getInt16, getInt32, getLength, getReference, getSize, getTypeBytes, isCritical, readNextFromStream, setCRC, setData, setInt16, setInt32, setLength, setReference, setType, toString, typeMatchesArray
-
Field Details
-
IHDR_DATA_LENGTH
static final int IHDR_DATA_LENGTH- See Also:
-
WIDTH_DATA_OFFSET
static final int WIDTH_DATA_OFFSET- See Also:
-
HEIGHT_DATA_OFFSET
static final int HEIGHT_DATA_OFFSET- See Also:
-
BIT_DEPTH_OFFSET
static final int BIT_DEPTH_OFFSET- See Also:
-
COLOR_TYPE_OFFSET
static final int COLOR_TYPE_OFFSET- See Also:
-
COMPRESSION_METHOD_OFFSET
static final int COMPRESSION_METHOD_OFFSET- See Also:
-
FILTER_METHOD_OFFSET
static final int FILTER_METHOD_OFFSET- See Also:
-
INTERLACE_METHOD_OFFSET
static final int INTERLACE_METHOD_OFFSET- See Also:
-
COLOR_TYPE_GRAYSCALE
static final byte COLOR_TYPE_GRAYSCALE- See Also:
-
COLOR_TYPE_RGB
static final byte COLOR_TYPE_RGB- See Also:
-
COLOR_TYPE_PALETTE
static final byte COLOR_TYPE_PALETTE- See Also:
-
COLOR_TYPE_GRAYSCALE_WITH_ALPHA
static final byte COLOR_TYPE_GRAYSCALE_WITH_ALPHA- See Also:
-
COLOR_TYPE_RGB_WITH_ALPHA
static final byte COLOR_TYPE_RGB_WITH_ALPHA- See Also:
-
INTERLACE_METHOD_NONE
static final int INTERLACE_METHOD_NONE- See Also:
-
INTERLACE_METHOD_ADAM7
static final int INTERLACE_METHOD_ADAM7- See Also:
-
FILTER_NONE
static final int FILTER_NONE- See Also:
-
FILTER_SUB
static final int FILTER_SUB- See Also:
-
FILTER_UP
static final int FILTER_UP- See Also:
-
FILTER_AVERAGE
static final int FILTER_AVERAGE- See Also:
-
FILTER_PAETH
static final int FILTER_PAETH- See Also:
-
ValidBitDepths
static final byte[] ValidBitDepths -
ValidColorTypes
static final byte[] ValidColorTypes -
width
int width -
height
int height -
bitDepth
byte bitDepth -
colorType
byte colorType -
compressionMethod
byte compressionMethod -
filterMethod
byte filterMethod -
interlaceMethod
byte interlaceMethod
-
-
Constructor Details
-
PngIhdrChunk
PngIhdrChunk(int width, int height, byte bitDepth, byte colorType, byte compressionMethod, byte filterMethod, byte interlaceMethod) -
PngIhdrChunk
PngIhdrChunk(byte[] reference) Construct a PNGChunk using the reference bytes given.
-
-
Method Details
-
getChunkType
int getChunkType()- Overrides:
getChunkTypein classPngChunk
-
getWidth
int getWidth()Get the image's width in pixels. -
setWidth
void setWidth(int value) Set the image's width in pixels. -
getHeight
int getHeight()Get the image's height in pixels. -
setHeight
void setHeight(int value) Set the image's height in pixels. -
getBitDepth
byte getBitDepth()Get the image's bit depth. This is limited to the values 1, 2, 4, 8, or 16. -
setBitDepth
void setBitDepth(byte value) Set the image's bit depth. This is limited to the values 1, 2, 4, 8, or 16. -
getColorType
byte getColorType()Get the image's color type. This is limited to the values: 0 - Grayscale image. 2 - RGB triple. 3 - Palette. 4 - Grayscale with Alpha channel. 6 - RGB with Alpha channel. -
setColorType
void setColorType(byte value) Set the image's color type. This is limited to the values: 0 - Grayscale image. 2 - RGB triple. 3 - Palette. 4 - Grayscale with Alpha channel. 6 - RGB with Alpha channel. -
getCompressionMethod
byte getCompressionMethod()Get the image's compression method. This value must be 0. -
setCompressionMethod
void setCompressionMethod(byte value) Set the image's compression method. This value must be 0. -
getFilterMethod
byte getFilterMethod()Get the image's filter method. This value must be 0. -
setFilterMethod
void setFilterMethod(byte value) Set the image's filter method. This value must be 0. -
getInterlaceMethod
byte getInterlaceMethod()Get the image's interlace method. This value is limited to: 0 - No interlacing used. 1 - Adam7 interlacing used. -
setInterlaceMethod
void setInterlaceMethod(byte value) Set the image's interlace method. This value is limited to: 0 - No interlacing used. 1 - Adam7 interlacing used. -
validate
Answer whether the chunk is a valid IHDR chunk. -
getColorTypeString
String getColorTypeString() -
getFilterMethodString
String getFilterMethodString() -
getInterlaceMethodString
String getInterlaceMethodString() -
contributeToString
Description copied from class:PngChunkProvided so that subclasses can override and add data to the toString() call.- Overrides:
contributeToStringin classPngChunk
-
getMustHavePalette
boolean getMustHavePalette() -
getCanHavePalette
boolean getCanHavePalette() -
getBitsPerPixel
int getBitsPerPixel()Answer the pixel size in bits based on the color type and bit depth. -
getSwtBitsPerPixel
int getSwtBitsPerPixel()Answer the pixel size in bits based on the color type and bit depth. -
getFilterByteOffset
int getFilterByteOffset() -
usesDirectColor
boolean usesDirectColor() -
createGrayscalePalette
PaletteData createGrayscalePalette() -
getPaletteData
PaletteData getPaletteData()
-