de.yaina.trackrenderer
Class TileRaster

java.lang.Object
  extended by de.yaina.trackrenderer.TileRaster

public class TileRaster
extends java.lang.Object

Implements a raster image for tiles. Points are stored in a byte array of indexed coulors


Constructor Summary
TileRaster(int dimensionX, int dimensionY, int tileX, int tileY)
          Create a new image raster
 
Method Summary
 java.awt.image.BufferedImage getImage()
          Convert the raster to an ARGB image, suitable to be processed by AWT
 byte getPoint(int x, int y)
          Read a point from the image map
 int getTileX()
          Get the horizontal tile number
 int getTileY()
          Get the vertical tile number
 void setPoint(int x, int y, byte value)
          Set a point on the image map
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TileRaster

public TileRaster(int dimensionX,
                  int dimensionY,
                  int tileX,
                  int tileY)
Create a new image raster

Parameters:
dimensionX - horizontal size of the pixmap
dimensionY - vertical size of the pixmap
tileX - number of the X tile (only for stats)
tileY - number of the Y tile (only for stats)
Method Detail

setPoint

public void setPoint(int x,
                     int y,
                     byte value)
Set a point on the image map

Parameters:
x - x coordinate
y - y coordinate
value - colour

getPoint

public byte getPoint(int x,
                     int y)
Read a point from the image map

Parameters:
x - x coordinate
y - y coordinate
Returns:

getTileX

public int getTileX()
Get the horizontal tile number

Returns:
number of the horizontal tile

getTileY

public int getTileY()
Get the vertical tile number

Returns:
number of the vertical tile

getImage

public java.awt.image.BufferedImage getImage()
Convert the raster to an ARGB image, suitable to be processed by AWT

Returns:
the image