Package com.luciad.format.raster
Class TLcdRenderedImageTile
java.lang.Object
com.luciad.format.raster.TLcdRenderedImageTile
- All Implemented Interfaces:
ILcdSubtiledTile
,ILcdTile
,ILcdDisposable
,AutoCloseable
This
ILcdTile
provides a simple wrapper for a RenderedImage
.
This class is thread-safe for concurrent read-only access of its contents.-
Field Summary
-
Constructor Summary
ConstructorDescriptionTLcdRenderedImageTile
(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. -
Method Summary
Modifier and TypeMethodDescriptionCreates an image of the entire tile, using the tile's own color model.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.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.createImage
(ColorModel aColorModel) Creates an image of the entire tile, using the given color model.void
dispose()
Disposes of this tile and its contained RenderedImage.int
Finds the index of a color that is transparent or that can be made transparent because it is a duplicate.Returns the optional color model of the tile.int
Returns the index of a color that are made transparent.int
Returns the height of the tile, expressed in pixels.int
Returns the pixel size of the tile values, expressed in bits.Returns the RenderedImage of this tile.int
Returns the height of a subtile in pixels.int
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
Returns whether all values in the tile are equal to a default value.boolean
Deprecated.This method has been deprecated.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.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.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface com.luciad.util.ILcdDisposable
close
-
Constructor Details
-
TLcdRenderedImageTile
Creates a new TLcdRenderedImageTile that wraps the given RenderedImage. -
TLcdRenderedImageTile
Creates a new TLcdRenderedImageTile that wraps the given RenderedImage, overriding its ColorModel with the given ColorModel.
-
-
Method Details
-
setClassTraceOn
public static void setClassTraceOn(boolean aClassTraceOn) Deprecated.This method has been deprecated. It is recommended to use the standard Java logging framework directly.Enables tracing for all instances of this class. If the argument istrue
then all log messages are recorded, otherwise only the informative, warning and error messages are recorded.- Parameters:
aClassTraceOn
- if true then all log messages are recorded, otherwise only the informative, warning and error messages are recorded.
-
setTraceOn
public void setTraceOn(boolean aTraceOn) Deprecated.This method has been deprecated. It is recommended to use the standard Java logging framework directly.Enables tracing for this class instance. Calling this method with eithertrue
orfalse
as argument automatically turns off tracing for all other class instances for whichsetTraceOn
has not been called. If the argument isfalse
then only the informative, warning and error log messages are recorded.- Parameters:
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.
-
isTraceOn
public boolean isTraceOn()Deprecated.This method has been deprecated. It is recommended to use the standard Java logging framework directly.Returnstrue
if tracing is enabled for this class.- Returns:
- true if tracing is enabled for this class, false otherwise.
-
getRenderedImage
Returns the RenderedImage of this tile. -
findSuitableTransparentColorIndex
public int findSuitableTransparentColorIndex()Finds the index of a color that is transparent or that can be made transparent because it is a duplicate. This can be useful if the RenderedImage has an IndexColorModel that doesn't have a transparent color of its own. The index can then be used to force the corresponding color to be transparent, assuming that the index is not actually used in the image anyway.- See Also:
-
setForcedTransparentColorIndex
public void setForcedTransparentColorIndex(int aForcedTransparentColorIndex) Sets the index of a color that should be made transparent. This can be useful if the RenderedImage has an IndexColorModel that doesn't have a transparent color of its own. -
getForcedTransparentColorIndex
public int getForcedTransparentColorIndex()Returns the index of a color that are made transparent. -
dispose
public void dispose()Disposes of this tile and its contained RenderedImage. It also closes the referenced InputStream, if any.- Specified by:
dispose
in interfaceILcdDisposable
-
getWidth
public int getWidth()Description copied from interface:ILcdTile
Returns the width of the tile, expressed in pixels. -
getHeight
public int getHeight()Description copied from interface:ILcdTile
Returns the height of the tile, expressed in pixels. -
getSubTileWidth
public int getSubTileWidth()Description copied from interface:ILcdSubtiledTile
Returns the width of a subtile in pixels. May be equal to the width of the parent tile (as returned by the getWidth() method), in which case the tile is not subdivided.- Specified by:
getSubTileWidth
in interfaceILcdSubtiledTile
-
getSubTileHeight
public int getSubTileHeight()Description copied from interface:ILcdSubtiledTile
Returns the height of a subtile in pixels. May be equal to the height of the parent tile (as returned by the getHeight() method), in which case the tile is not subdivided.- Specified by:
getSubTileHeight
in interfaceILcdSubtiledTile
-
getType
public int getType()Description copied from interface:ILcdTile
Returns the internal storage type of the tile values. -
getPixelSize
public int getPixelSize()Description copied from interface:ILcdTile
Returns the pixel size of the tile values, expressed in bits.- Specified by:
getPixelSize
in interfaceILcdTile
-
setColorModel
-
getColorModel
Description copied from interface:ILcdTile
Returns the optional color model of the tile.- Specified by:
getColorModel
in interfaceILcdTile
- Returns:
- the color model, or
null
if the raster doesn't have an explicit color model.
-
retrieveValue
public int retrieveValue(int aX, int aY) Description copied from interface:ILcdTile
Retrieves the tile value at the specified location.- Specified by:
retrieveValue
in interfaceILcdTile
- Parameters:
aX
- the x ordinate of the value, expressed in tile coordinates.aY
- the y ordinate of the value, expressed in tile coordinates.- Returns:
- the integer tile value at the specified location.
-
isAllDefault
public boolean isAllDefault()Description copied from interface:ILcdTile
Returns whether all values in the tile are equal to a default value.- Specified by:
isAllDefault
in interfaceILcdTile
-
setAllDefault
public void setAllDefault(boolean aAllDefault) -
createImage
Description copied from interface:ILcdTile
Creates an image of the entire tile, using the tile's own color model.- Specified by:
createImage
in interfaceILcdTile
-
createImage
Description copied from interface:ILcdTile
Creates an image of the entire tile, using the given color model.- Specified by:
createImage
in interfaceILcdTile
- Parameters:
aColorModel
- the color model to be used for the image. The color model should be compatible with the pixel values of the tile.
-
createImage
Description copied from interface:ILcdTile
Creates an image of the specified rectangular area of the tile, using the tile's own color model.- Specified by:
createImage
in interfaceILcdTile
- Parameters:
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.
-
createImage
Description copied from interface:ILcdTile
Creates an image of the specified rectangular area of the tile, using the given color model.- Specified by:
createImage
in interfaceILcdTile
- Parameters:
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.
-