public class TLcdRenderedImageTile extends Object implements ILcdSubtiledTile, ILcdDisposable
ILcdTile
provides a simple wrapper for a RenderedImage
.
This class is thread-safe for concurrent read-only access of its contents.Constructor and Description |
---|
TLcdRenderedImageTile(RenderedImage aRenderedImage)
Creates a new TLcdRenderedImageTile that wraps the given RenderedImage.
|
TLcdRenderedImageTile(RenderedImage aRenderedImage,
ColorModel aColorModel)
Creates a new TLcdRenderedImageTile that wraps the given RenderedImage,
overriding its ColorModel with the given ColorModel.
|
Modifier and Type | Method and Description |
---|---|
Image |
createImage()
Creates an image of the entire tile, using the tile's own color model.
|
Image |
createImage(ColorModel aColorModel)
Creates an image of the entire tile, using the given color model.
|
Image |
createImage(int aX,
int aY,
int aWidth,
int aHeight)
Creates an image of the specified rectangular area of the tile, using the
tile's own color model.
|
Image |
createImage(int aX,
int aY,
int aWidth,
int aHeight,
ColorModel aColorModel)
Creates an image of the specified rectangular area of the tile, using the
given color model.
|
void |
dispose()
Disposes of this tile and its contained RenderedImage.
|
int |
findSuitableTransparentColorIndex()
Finds the index of a color that is transparent or that can be made
transparent because it is a duplicate.
|
ColorModel |
getColorModel()
Returns the optional color model of the tile.
|
int |
getForcedTransparentColorIndex()
Returns the index of a color that are made transparent.
|
int |
getHeight()
Returns the height of the tile, expressed in pixels.
|
int |
getPixelSize()
Returns the pixel size of the tile values, expressed in bits.
|
RenderedImage |
getRenderedImage()
Returns the RenderedImage of this tile.
|
int |
getSubTileHeight()
Returns the height of a subtile in pixels.
|
int |
getSubTileWidth()
Returns the width of a subtile in pixels.
|
int |
getType()
Returns the internal storage type of the tile values.
|
int |
getWidth()
Returns the width of the tile, expressed in pixels.
|
boolean |
isAllDefault()
Returns whether all values in the tile are equal to a default value.
|
boolean |
isTraceOn()
Deprecated.
This method has been deprecated. It is recommended to use the
standard Java logging framework directly.
|
int |
retrieveValue(int aX,
int aY)
Retrieves the tile value at the specified location.
|
void |
setAllDefault(boolean aAllDefault) |
static void |
setClassTraceOn(boolean aClassTraceOn)
Deprecated.
This method has been deprecated. It is recommended to use the
standard Java logging framework directly.
|
void |
setColorModel(ColorModel aColorModel) |
void |
setForcedTransparentColorIndex(int aForcedTransparentColorIndex)
Sets the index of a color that should be made transparent.
|
void |
setTraceOn(boolean aTraceOn)
Deprecated.
This method has been deprecated. It is recommended to use the
standard Java logging framework directly.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
close
public TLcdRenderedImageTile(RenderedImage aRenderedImage)
public TLcdRenderedImageTile(RenderedImage aRenderedImage, ColorModel aColorModel)
public static void setClassTraceOn(boolean aClassTraceOn)
true
then all log messages are recorded, otherwise only
the informative, warning and error messages are recorded.aClassTraceOn
- if true then all log messages are recorded,
otherwise only the informative, warning and error messages are recorded.public void setTraceOn(boolean aTraceOn)
true
or false
as argument automatically turns
off tracing for all other class instances for which
setTraceOn
has not been called.
If the argument is false
then only the informative, warning
and error log messages are recorded.aTraceOn
- if true then all log messages are recorded for this
instance. If false, then only the informative, warning and
error log messages are recorded.public boolean isTraceOn()
true
if tracing is enabled for this class.public RenderedImage getRenderedImage()
public int findSuitableTransparentColorIndex()
setForcedTransparentColorIndex(int)
public void setForcedTransparentColorIndex(int aForcedTransparentColorIndex)
public int getForcedTransparentColorIndex()
public void dispose()
dispose
in interface ILcdDisposable
public int getWidth()
ILcdTile
public int getHeight()
ILcdTile
public int getSubTileWidth()
ILcdSubtiledTile
getSubTileWidth
in interface ILcdSubtiledTile
public int getSubTileHeight()
ILcdSubtiledTile
getSubTileHeight
in interface ILcdSubtiledTile
public int getType()
ILcdTile
public int getPixelSize()
ILcdTile
getPixelSize
in interface ILcdTile
public void setColorModel(ColorModel aColorModel)
public ColorModel getColorModel()
ILcdTile
getColorModel
in interface ILcdTile
null
if the raster doesn't have
an explicit color model.public int retrieveValue(int aX, int aY)
ILcdTile
retrieveValue
in interface ILcdTile
aX
- the x ordinate of the value, expressed in tile coordinates.aY
- the y ordinate of the value, expressed in tile coordinates.public boolean isAllDefault()
ILcdTile
isAllDefault
in interface ILcdTile
public void setAllDefault(boolean aAllDefault)
public Image createImage()
ILcdTile
createImage
in interface ILcdTile
public Image createImage(ColorModel aColorModel)
ILcdTile
createImage
in interface ILcdTile
aColorModel
- the color model to be used for the image. The color
model should be compatible with the pixel values of
the tile.public Image createImage(int aX, int aY, int aWidth, int aHeight)
ILcdTile
createImage
in interface ILcdTile
aX
- the x ordinate of the area, expressed in tile coordinates.aY
- the y ordinate of the area, expressed in tile coordinates.aWidth
- the width of the area, expressed in tile coordinates.aHeight
- the height of the area, expressed in tile coordinates.public Image createImage(int aX, int aY, int aWidth, int aHeight, ColorModel aColorModel)
ILcdTile
createImage
in interface ILcdTile
aX
- the x ordinate of the area, expressed in tile coordinates.aY
- the y ordinate of the area, expressed in tile coordinates.aWidth
- the width of the area, expressed in tile coordinates.aHeight
- the height of the area, expressed in tile coordinates.aColorModel
- the color model to be used for the image. The color
model should be compatible with the pixel values of
the tile.