Class PngImageData


public class PngImageData extends RawImageData
Image data and PNG-specific color information.
  • Constructor Details

    • PngImageData

      protected PngImageData (byte[] bytes)
      Creates PNG image data from encoded bytes.
      Parameters:
      bytes - encoded PNG bytes; the array is retained
    • PngImageData

      protected PngImageData (URL url)
      Creates PNG image data to be loaded from a URL.
      Parameters:
      url - source URL, not null
  • Method Details

    • getColorPalette

      public byte[] getColorPalette()
      Gets the indexed-color palette.
      Returns:
      retained PNG palette bytes, or null
    • setColorPalette

      public void setColorPalette (byte[] colorPalette)
      Sets the indexed-color palette.
      Parameters:
      colorPalette - PNG palette bytes to retain, or null
    • getGamma

      public float getGamma()
      Gets the PNG gamma value.
      Returns:
      gamma value
    • setGamma

      public void setGamma (float gamma)
      Sets the PNG gamma value.
      Parameters:
      gamma - gamma value
    • isHasCHRM

      public boolean isHasCHRM()
      Checks whether PNG chromaticity data is available.
      Returns:
      true when chromaticity data is present
    • getPngChromaticities

      public PngChromaticities getPngChromaticities()
      Gets PNG chromaticity data.
      Returns:
      chromaticity data, or null
    • setPngChromaticities

      public void setPngChromaticities (PngChromaticities pngChromaticities)
      Sets PNG chromaticity data.
      Parameters:
      pngChromaticities - chromaticity data, or null
    • getColorType

      public int getColorType()
      Gets the PNG color type.
      Returns:
      PNG color-type value
    • setColorType

      public void setColorType (int colorType)
      Sets the PNG color type.
      Parameters:
      colorType - PNG color-type value
    • isIndexed

      public boolean isIndexed()
      Checks whether the PNG uses indexed color.
      Returns:
      true for color type 3
    • isGrayscaleImage

      public boolean isGrayscaleImage()
      Checks whether the PNG color type has no color components.
      Returns:
      true for grayscale color types