Class PNGDecoder

java.lang.Object
zombie.core.textures.PNGDecoder

public final class PNGDecoder extends Object
A PNGDecoder. The slick PNG decoder is based on this class :)
  • Field Details

  • Constructor Details

  • Method Details

    • getHeight

      public int getHeight()
    • getWidth

      public int getWidth()
    • hasAlphaChannel

      public boolean hasAlphaChannel()
      Checks if the image has a real alpha channel. This method does not check for the presence of a tRNS chunk.
      Returns:
      true if the image has an alpha channel
    • hasAlpha

      public boolean hasAlpha()
      Checks if the image has transparency information either from an alpha channel or from a tRNS chunk.
      Returns:
      true if the image has transparency
    • isRGB

      public boolean isRGB()
    • isAnimated

      public boolean isAnimated()
    • getNumFrames

      public int getNumFrames()
    • getNumPlays

      public int getNumPlays()
    • getCurrentFrame

      public APNGFrame getCurrentFrame()
    • overwriteTRNS

      public void overwriteTRNS(byte r, byte g, byte b)
      Overwrites the tRNS chunk entry to make a selected color transparent.
      Parameters:
      r - the red component of the color to make transparent
      g - the green component of the color to make transparent
      b - the blue component of the color to make transparent
    • decideTextureFormat

      public PNGDecoder.Format decideTextureFormat(PNGDecoder.Format fmt)
      Computes the implemented format conversion for the desired format.
      Parameters:
      fmt - the desired format
      Returns:
      format which best matches the desired format
    • decode

      public void decode(ByteBuffer byteBuffer, int int5, int int3, PNGDecoder.Format format, int int4) throws IOException
      Throws:
      IOException
    • decodeFlipped

      public void decodeFlipped(ByteBuffer byteBuffer, int int0, int int3, PNGDecoder.Format format, int int4) throws IOException
      Throws:
      IOException
    • decodeStartOfNextFrame

      public void decodeStartOfNextFrame() throws IOException
      Throws:
      IOException
    • decodeFrame

      public void decodeFrame(ByteBuffer byteBuffer, int int0, PNGDecoder.Format format) throws IOException
      Throws:
      IOException