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 org.deltava.util.tile.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 org.deltava.util.tile.AbstractTile
compareTo, getAddress, getName, hashCodeMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface java.lang.Comparable
compareToMethods inherited from interface org.deltava.util.tile.Tile
getAddress, getName
-
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
-