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
ConstructorsConstructorDescriptionTLcdRenderedImageTile(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.voiddispose()Disposes of this tile and its contained RenderedImage.intFinds 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.intReturns the index of a color that are made transparent.intReturns the height of the tile, expressed in pixels.intReturns the pixel size of the tile values, expressed in bits.Returns the RenderedImage of this tile.intReturns the height of a subtile in pixels.intReturns the width of a subtile in pixels.intgetType()Returns the internal storage type of the tile values.intgetWidth()Returns the width of the tile, expressed in pixels.booleanReturns whether all values in the tile are equal to a default value.booleanDeprecated.This method has been deprecated.intretrieveValue(int aX, int aY) Retrieves the tile value at the specified location.voidsetAllDefault(boolean aAllDefault) static voidsetClassTraceOn(boolean aClassTraceOn) Deprecated.This method has been deprecated.voidsetColorModel(ColorModel aColorModel) voidsetForcedTransparentColorIndex(int aForcedTransparentColorIndex) Sets the index of a color that should be made transparent.voidsetTraceOn(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, waitMethods 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 istruethen 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 eithertrueorfalseas argument automatically turns off tracing for all other class instances for whichsetTraceOnhas not been called. If the argument isfalsethen 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.Returnstrueif 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:
disposein interfaceILcdDisposable
-
getWidth
public int getWidth()Description copied from interface:ILcdTileReturns the width of the tile, expressed in pixels. -
getHeight
public int getHeight()Description copied from interface:ILcdTileReturns the height of the tile, expressed in pixels. -
getSubTileWidth
public int getSubTileWidth()Description copied from interface:ILcdSubtiledTileReturns 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:
getSubTileWidthin interfaceILcdSubtiledTile
-
getSubTileHeight
public int getSubTileHeight()Description copied from interface:ILcdSubtiledTileReturns 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:
getSubTileHeightin interfaceILcdSubtiledTile
-
getType
public int getType()Description copied from interface:ILcdTileReturns the internal storage type of the tile values. -
getPixelSize
public int getPixelSize()Description copied from interface:ILcdTileReturns the pixel size of the tile values, expressed in bits.- Specified by:
getPixelSizein interfaceILcdTile
-
setColorModel
-
getColorModel
Description copied from interface:ILcdTileReturns the optional color model of the tile.- Specified by:
getColorModelin interfaceILcdTile- Returns:
- the color model, or
nullif the raster doesn't have an explicit color model.
-
retrieveValue
public int retrieveValue(int aX, int aY) Description copied from interface:ILcdTileRetrieves the tile value at the specified location.- Specified by:
retrieveValuein 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:ILcdTileReturns whether all values in the tile are equal to a default value.- Specified by:
isAllDefaultin interfaceILcdTile
-
setAllDefault
public void setAllDefault(boolean aAllDefault) -
createImage
Description copied from interface:ILcdTileCreates an image of the entire tile, using the tile's own color model.- Specified by:
createImagein interfaceILcdTile
-
createImage
Description copied from interface:ILcdTileCreates an image of the entire tile, using the given color model.- Specified by:
createImagein 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:ILcdTileCreates an image of the specified rectangular area of the tile, using the tile's own color model.- Specified by:
createImagein 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:ILcdTileCreates an image of the specified rectangular area of the tile, using the given color model.- Specified by:
createImagein 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.
-