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.void
setImage
(byte[] data) Sets the image data.void
setImage
(BufferedImage img) Sets the image data.Methods inherited from class org.deltava.util.tile.AbstractTile
compareTo, getAddress, getName, hashCode
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface java.lang.Comparable
compareTo
Methods 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:
getData
in interfaceCompressedTile
- Returns:
- the binary image data
-