public abstract class ImageInterleaved<T extends ImageInterleaved> extends ImageMultiBand<T>
Base class for images that contain multiple interleaved bands. Typically each band represents a different color or frequency of light detected in the imaging sensor.
Each pixel is composed of N bands. In an RGB image each pixel would be composed of 3 elements, [red][green][blue].
The index of the green band at pixel (3,10) would be:
index of green at (3,10) = startIndex + 10*stride + 3*numBands + 1
| Modifier and Type | Field and Description |
|---|---|
int |
numBands
How many color bands are contained in each pixel
|
| Modifier | Constructor and Description |
|---|---|
protected |
ImageInterleaved() |
protected |
ImageInterleaved(int width,
int height,
int numBands)
Creates a new image with all of its parameters initialized, including the
data array.
|
| Modifier and Type | Method and Description |
|---|---|
protected abstract java.lang.Object |
_getData()
Returns the data array the image is stored in.
|
protected abstract void |
_setData(java.lang.Object data)
Sets the image's internal data array.
|
abstract ImageDataType |
getDataType()
Returns image type information
|
int |
getIndex(int x,
int y) |
int |
getIndex(int x,
int y,
int band) |
int |
getNumBands()
Returns the number of bands or colors stored in this image.
|
protected abstract java.lang.Class |
getPrimitiveDataType() |
void |
reshape(int width,
int height)
Changes the width and height of the image.
|
void |
setNumBands(int numBands) |
void |
setTo(T orig)
Sets this image equal to the specified image.
|
T |
subimage(int x0,
int y0,
int x1,
int y1,
T subimage)
Creates a sub-image from 'this' image.
|
_createNew, clone, createSameShape, getHeight, getImageType, getStartIndex, getStride, getWidth, indexToPixel, isInBounds, isSubimage, setHeight, setStartIndex, setStride, setWidth, subimageprotected ImageInterleaved(int width,
int height,
int numBands)
width - Image's width.height - Image's height.numBands - Number of bands/colors.protected ImageInterleaved()
public T subimage(int x0, int y0, int x1, int y1, T subimage)
subimage in class ImageBase<T extends ImageInterleaved>x0 - x-coordinate of top-left corner of the sub-image.y0 - y-coordinate of top-left corner of the sub-image.x1 - x-coordinate of bottom-right corner of the sub-image.y1 - y-coordinate of bottom-right corner of the sub-image.subimage - public void reshape(int width,
int height)
ImageBasereshape in class ImageBase<T extends ImageInterleaved>width - Desired image widthheight - Desired image heightpublic int getIndex(int x,
int y)
getIndex in class ImageBase<T extends ImageInterleaved>public int getIndex(int x,
int y,
int band)
public void setTo(T orig)
setTo in class ImageBase<T extends ImageInterleaved>orig - The original image whose value is to be copied into this onepublic int getNumBands()
ImageMultiBandgetNumBands in class ImageMultiBand<T extends ImageInterleaved>public final void setNumBands(int numBands)
public abstract ImageDataType getDataType()
protected abstract java.lang.Object _getData()
protected abstract java.lang.Class getPrimitiveDataType()
protected abstract void _setData(java.lang.Object data)
data - data array