Class PNGTile
java.lang.Object
org.deltava.util.tile.AbstractTile
org.deltava.util.tile.PNGTile
- All Implemented Interfaces:
Serializable, Comparable<Tile>, CompressedTile, Tile
A Tile that stores pre-compressed PNG data.
- Since:
- 2.1
- Version:
- 2.1
- Author:
- Luke
- See Also:
-
Field Summary
Fields inherited from class AbstractTile
_addr -
Constructor Summary
ConstructorsConstructorDescriptionPNGTile()Deserialization constructor.PNGTile(TileAddress addr) Creates a new PNG tile.PNGTile(TileAddress addr, BufferedImage img) Creates a new PNG tile from an existing tile. -
Method Summary
Modifier and TypeMethodDescriptionbyte[]getData()Returns the compressed image data.voidsetImage(byte[] data) Sets the image data.voidsetImage(BufferedImage img) Sets the image data.Methods inherited from class AbstractTile
compareTo, getAddress, getName, hashCodeModifier and TypeMethodDescriptionintfinal TileAddressReturns the Tile address.final StringgetName()Returns the Tile nameinthashCode()
-
Constructor Details
-
PNGTile
public PNGTile()Deserialization constructor. -
PNGTile
-
PNGTile
Creates a new PNG tile from an existing tile.- Parameters:
addr- the TileAddressimg- the BufferedImage
-
-
Method Details
-
setImage
Sets the image data. This will convert the rendered image to PNG format. -
setImage
public void setImage(byte[] data) Sets the image data.- Parameters:
data- the image data
-
getData
public byte[] getData()Returns the compressed image data.- Specified by:
getDatain interfaceCompressedTile- Returns:
- the binary image data
-