Class PngIhdrChunk

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

class PngIhdrChunk extends PngChunk
  • Field Details

  • 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:
      getChunkType in class PngChunk
    • 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

      void validate(PngFileReadState readState, PngIhdrChunk headerChunk)
      Answer whether the chunk is a valid IHDR chunk.
      Overrides:
      validate in class PngChunk
    • getColorTypeString

      String getColorTypeString()
    • getFilterMethodString

      String getFilterMethodString()
    • getInterlaceMethodString

      String getInterlaceMethodString()
    • contributeToString

      void contributeToString(StringBuilder buffer)
      Description copied from class: PngChunk
      Provided so that subclasses can override and add data to the toString() call.
      Overrides:
      contributeToString in class PngChunk
    • 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()