Class PngPlteChunk
java.lang.Object
org.eclipse.swt.internal.image.PngChunk
org.eclipse.swt.internal.image.PngPlteChunk
-
Field Summary
FieldsFields 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
Constructors -
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) int(package private) PaletteDataGet a PaletteData object representing the colors stored in this PLTE chunk.(package private) intGet the number of colors in this palette.(package private) voidsetPaletteData(PaletteData palette) Set the data of a PLTE chunk to the colors stored in the specified PaletteData object.(package private) voidvalidate(PngFileReadState readState, PngIhdrChunk headerChunk) Answer whether the chunk is a valid PLTE 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
-
paletteSize
int paletteSize
-
-
Constructor Details
-
PngPlteChunk
PngPlteChunk(PaletteData palette) -
PngPlteChunk
PngPlteChunk(byte[] reference)
-
-
Method Details
-
getChunkType
int getChunkType()- Overrides:
getChunkTypein classPngChunk
-
getPaletteSize
int getPaletteSize()Get the number of colors in this palette. -
getPaletteData
PaletteData getPaletteData()Get a PaletteData object representing the colors stored in this PLTE chunk. The result should be cached as the PLTE chunk does not store the palette data created. -
setPaletteData
Set the data of a PLTE chunk to the colors stored in the specified PaletteData object. -
validate
Answer whether the chunk is a valid PLTE chunk. -
contributeToString
Description copied from class:PngChunkProvided so that subclasses can override and add data to the toString() call.- Overrides:
contributeToStringin classPngChunk
-