Class ImageRawPNG

All Implemented Interfaces:
Image

public class ImageRawPNG extends ImageRawStream
  • Constructor Details

    • ImageRawPNG

      public ImageRawPNG(ImageInfo info, InputStream in, ColorModel colorModel, int bitDepth, ICC_Profile iccProfile)
      Main constructor.
      Parameters:
      info - the image info object
      in - the ImageInputStream with the raw content
      colorModel - the color model
      bitDepth - the bit depth
      iccProfile - an ICC color profile or null if no profile is associated
  • Method Details

    • getBitDepth

      public int getBitDepth()
      The bit depth of each color channel.
      Returns:
      the bit depth of one channel (same for all)
    • getICCProfile

      public ICC_Profile getICCProfile()
      Returns the ICC color profile if one is associated with the PNG image.
      Specified by:
      getICCProfile in interface Image
      Overrides:
      getICCProfile in class AbstractImage
      Returns:
      the ICC color profile or null if there's no profile
    • getColorModel

      public ColorModel getColorModel()
      Returns the image's color model.
      Returns:
      the color model
    • getColorSpace

      public ColorSpace getColorSpace()
      Returns the image's color space.
      Specified by:
      getColorSpace in interface Image
      Overrides:
      getColorSpace in class AbstractImage
      Returns:
      the color space
    • setGrayTransparentAlpha

      protected void setGrayTransparentAlpha(int gray)
      Sets the gray transparent pixel value.
      Parameters:
      gray - the transparent pixel gray value (0...255)
    • setRGBTransparentAlpha

      protected void setRGBTransparentAlpha(int red, int green, int blue)
      Sets the RGB transparent pixel values.
      Parameters:
      red - the transparent pixel red value (0...255)
      green - the transparent pixel green value (0...255)
      blue - the transparent pixel blue value (0...255)
    • setTransparent

      protected void setTransparent()
      Used to flag image as transparent when the image is of pallete type.
    • isTransparent

      public boolean isTransparent()
      Whether the image is transparent (meaning there is a transparent pixel)
      Returns:
      true if transparent pixel exists
    • getTransparentColor

      public Color getTransparentColor()
      The color of the transparent pixel.
      Returns:
      the color of the transparent pixel.
    • setRenderingIntent

      public void setRenderingIntent(int intent)
      Used to set the rendering intent when the color space is sRGB.
      Parameters:
      intent - the rendering intent of the sRGB color space
    • getRenderingIntent

      public int getRenderingIntent()
      Returns the rendering intent of the sRGB color space.
      Returns:
      the rendering intent