Class PNGDecoder
java.lang.Object
zombie.core.textures.PNGDecoder
A PNGDecoder. The slick PNG decoder is based on this class :)
-
Nested Class Summary
Nested Classes -
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionComputes the implemented format conversion for the desired format.void
decode
(ByteBuffer byteBuffer, int int5, int int3, PNGDecoder.Format format, int int4) void
decodeFlipped
(ByteBuffer byteBuffer, int int0, int int3, PNGDecoder.Format format, int int4) void
decodeFrame
(ByteBuffer byteBuffer, int int0, PNGDecoder.Format format) void
int
int
int
int
getWidth()
boolean
hasAlpha()
Checks if the image has transparency information either from an alpha channel or from a tRNS chunk.boolean
Checks if the image has a real alpha channel.boolean
boolean
isRGB()
void
overwriteTRNS
(byte r, byte g, byte b) Overwrites the tRNS chunk entry to make a selected color transparent.
-
Field Details
-
IDAT
public static final int IDAT- See Also:
-
fdAT
public static final int fdAT- See Also:
-
maskID
public int maskID -
mask
-
bDoMask
public boolean bDoMask -
readTotal
public long readTotal
-
-
Constructor Details
-
PNGDecoder
- Throws:
IOException
-
-
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
-
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 transparentg
- the green component of the color to make transparentb
- the blue component of the color to make transparent
-
decideTextureFormat
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
- Throws:
IOException
-
decodeFrame
public void decodeFrame(ByteBuffer byteBuffer, int int0, PNGDecoder.Format format) throws IOException - Throws:
IOException
-