Class PngTrnsChunk
java.lang.Object
org.eclipse.swt.internal.image.PngChunk
org.eclipse.swt.internal.image.PngTrnsChunk
-
Field Summary
FieldsModifier and TypeFieldDescription(package private) static final int(package private) static final 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
Constructors -
Method Summary
Modifier and TypeMethodDescription(package private) byte[]getAlphaValues(PngIhdrChunk header, PngPlteChunk paletteChunk) Answer an array of Alpha values that correspond to the colors in the palette.(package private) int(package private) intgetSwtTransparentPixel(PngIhdrChunk header) Answer the transparent pixel RGB value.(package private) intgetTransparencyType(PngIhdrChunk header) (package private) voidvalidate(PngFileReadState readState, PngIhdrChunk headerChunk, PngPlteChunk paletteChunk) Answer whether the chunk is a valid tRNS chunk.(package private) voidvalidateLength(PngIhdrChunk header, PngPlteChunk paletteChunk) Methods inherited from class PngChunk
checkCRC, computeCRC, contributeToString, getCRC, getData, getInt16, getInt32, getLength, getReference, getSize, getTypeBytes, isCritical, readNextFromStream, setCRC, setData, setInt16, setInt32, setLength, setReference, setType, toString, typeMatchesArray, validate
-
Field Details
-
TRANSPARENCY_TYPE_PIXEL
static final int TRANSPARENCY_TYPE_PIXEL- See Also:
-
TRANSPARENCY_TYPE_ALPHAS
static final int TRANSPARENCY_TYPE_ALPHAS- See Also:
-
RGB_DATA_LENGTH
static final int RGB_DATA_LENGTH- See Also:
-
-
Constructor Details
-
PngTrnsChunk
PngTrnsChunk(RGB rgb) -
PngTrnsChunk
PngTrnsChunk(byte[] reference)
-
-
Method Details
-
getChunkType
int getChunkType()- Overrides:
getChunkTypein classPngChunk
-
validateLength
-
validate
Answer whether the chunk is a valid tRNS chunk. -
getTransparencyType
-
getSwtTransparentPixel
Answer the transparent pixel RGB value. This is not valid for palette color types. This is not valid for alpha color types. This will convert a grayscale value into a palette index. It will compress a 6 byte RGB into a 3 byte RGB. -
getAlphaValues
Answer an array of Alpha values that correspond to the colors in the palette. This is only valid for the COLOR_TYPE_PALETTE color type.
-