Class PngTrnsChunk

java.lang.Object
org.eclipse.swt.internal.image.PngChunk
org.eclipse.swt.internal.image.PngTrnsChunk

public class PngTrnsChunk extends PngChunk
  • Field Details

  • Constructor Details

    • PngTrnsChunk

      PngTrnsChunk(RGB rgb)
    • PngTrnsChunk

      PngTrnsChunk(byte[] reference)
  • Method Details

    • getChunkType

      int getChunkType()
      Overrides:
      getChunkType in class PngChunk
    • validateLength

      void validateLength(PngIhdrChunk header, PngPlteChunk paletteChunk)
    • validate

      void validate(PngFileReadState readState, PngIhdrChunk headerChunk, PngPlteChunk paletteChunk)
      Answer whether the chunk is a valid tRNS chunk.
    • getTransparencyType

      int getTransparencyType(PngIhdrChunk header)
    • getSwtTransparentPixel

      int getSwtTransparentPixel(PngIhdrChunk header)
      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

      byte[] getAlphaValues(PngIhdrChunk header, PngPlteChunk paletteChunk)
      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.