boofcv.struct.image
Class ImageInterleaved<T extends ImageInterleaved>
- java.lang.Object
-
- boofcv.struct.image.ImageBase<T>
-
- boofcv.struct.image.ImageMultiBand<T>
-
- boofcv.struct.image.ImageInterleaved<T>
-
- All Implemented Interfaces:
- java.io.Serializable, java.lang.Cloneable
- Direct Known Subclasses:
- InterleavedF32, InterleavedF64, InterleavedInteger, InterleavedS64
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- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field and Description intnumBandsHow many color bands are contained in each pixel
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method and Description abstract ImageDataTypegetDataType()Returns image type informationintgetIndex(int x, int y)intgetIndex(int x, int y, int band)intgetNumBands()Returns the number of bands or colors stored in this image.voidreshape(int width, int height)Changes the width and height of the image.voidsetNumBands(int numBands)voidsetTo(T orig)Sets this image equal to the specified image.Tsubimage(int x0, int y0, int x1, int y1, T subimage)Creates a sub-image from 'this' image.-
Methods inherited from class boofcv.struct.image.ImageBase
_createNew, clone, createSameShape, getHeight, getImageType, getStartIndex, getStride, getWidth, indexToPixel, isInBounds, isSubimage, setHeight, setStartIndex, setStride, setWidth, subimage
-
-
-
-
Method Detail
-
subimage
public T subimage(int x0, int y0, int x1, int y1, T subimage)
Creates a sub-image from 'this' image. The subimage will share the same internal array that stores each pixel's value, but will only pertain to an axis-aligned rectangular segment of the original.- Specified by:
subimagein classImageBase<T extends ImageInterleaved>- Parameters:
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-- Returns:
- A sub-image of this image.
-
reshape
public void reshape(int width, int height)Description copied from class:ImageBaseChanges the width and height of the image. If the image data array isn't large enough to hold an image of this size then a new array is declared. Otherwise the image data array is left unchanged and only the width and height variables are modified.- Specified by:
reshapein classImageBase<T extends ImageInterleaved>- Parameters:
width- Desired image widthheight- Desired image height
-
getIndex
public int getIndex(int x, int y)- Overrides:
getIndexin classImageBase<T extends ImageInterleaved>
-
getIndex
public int getIndex(int x, int y, int band)
-
setTo
public void setTo(T orig)
Sets this image equal to the specified image. Automatically resized to match the input image.- Specified by:
setToin classImageBase<T extends ImageInterleaved>- Parameters:
orig- The original image whose value is to be copied into this one
-
getNumBands
public int getNumBands()
Description copied from class:ImageMultiBandReturns the number of bands or colors stored in this image.- Specified by:
getNumBandsin classImageMultiBand<T extends ImageInterleaved>- Returns:
- Number of bands in the image.
-
setNumBands
public final void setNumBands(int numBands)
-
getDataType
public abstract ImageDataType getDataType()
Returns image type information- Returns:
- The type of image.
-
-
DataMelt 3.0 © DataMelt by jWork.ORG