Package com.luciad.format.raster
Class TLcdByteArrayTile
java.lang.Object
com.luciad.format.raster.TLcdByteArrayTile
- All Implemented Interfaces:
ILcdSubtiledTile
,ILcdTile
This basic implementation of
ILcdTile
retrieves its pixel
values from a given array of bytes. The pixel values are stored row by
row, starting from the top-left, with one pixel value per array element.- Since:
- 6.2
-
Field Summary
-
Constructor Summary
ConstructorDescriptionTLcdByteArrayTile
(byte[] aPixels, int aWidth, int aHeight) Creates a new TLcdByteArrayTile with the given array and size.TLcdByteArrayTile
(byte[] aPixels, int aWidth, int aHeight, int aSubTileWidth, int aSubTileHeight) Creates a new TLcdByteArrayTile with the given array, size, and subtile size.TLcdByteArrayTile
(byte[] aPixels, int aWidth, int aHeight, int aSubTileWidth, int aSubTileHeight, ColorModel aColorModel) Creates a new TLcdByteArrayTile with the given array, size, subtile size, and color model.TLcdByteArrayTile
(byte[] aPixels, int aWidth, int aHeight, ColorModel aColorModel) Creates a new TLcdByteArrayTile with the given array, size, and color model. -
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.Returns the optional color model of the tile.int
Returns the height of the tile, expressed in pixels.int
Returns the pixel size of the tile values, expressed in bits.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.int
retrieveValue
(int aX, int aY) Retrieves the tile value at the specified location.
-
Constructor Details
-
TLcdByteArrayTile
public TLcdByteArrayTile(byte[] aPixels, int aWidth, int aHeight) Creates a new TLcdByteArrayTile with the given array and size. The color model isnull
.- Parameters:
aPixels
- the pixel values.aWidth
- the tile width.aHeight
- the tile height.
-
TLcdByteArrayTile
Creates a new TLcdByteArrayTile with the given array, size, and color model.- Parameters:
aPixels
- the pixel values.aWidth
- the tile width.aHeight
- the tile height.aColorModel
- the color model.
-
TLcdByteArrayTile
public TLcdByteArrayTile(byte[] aPixels, int aWidth, int aHeight, int aSubTileWidth, int aSubTileHeight) Creates a new TLcdByteArrayTile with the given array, size, and subtile size. The subtile size can be chosen freely. The color model isnull
.- Parameters:
aPixels
- the pixel values.aWidth
- the tile width.aHeight
- the tile height.aSubTileWidth
- the subtile width.aSubTileHeight
- the subtile width.
-
TLcdByteArrayTile
public TLcdByteArrayTile(byte[] aPixels, int aWidth, int aHeight, int aSubTileWidth, int aSubTileHeight, ColorModel aColorModel) Creates a new TLcdByteArrayTile with the given array, size, subtile size, and color model. The subtile size can be chosen freely.- Parameters:
aPixels
- the pixel values.aWidth
- the tile width.aHeight
- the tile height.aSubTileWidth
- the subtile width.aSubTileHeight
- the subtile width.aColorModel
- the color model.
-
-
Method Details
-
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
- Returns:
- 8.
-
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
-
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.
-
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
-
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.
-
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.
-