Package boofcv.struct.image
Class GrayI<T extends GrayI<T>>
java.lang.Object
boofcv.struct.image.ImageBase<T>
boofcv.struct.image.ImageGray<T>
boofcv.struct.image.GrayI<T>
- All Implemented Interfaces:
Serializable
,Cloneable
Base class for all integer images. An integer image can either be signed or unsigned. Since all integers in Java are signed (which is really f*ing annoying) a boolean variable is used to differentiate these image types.
DESIGN NOTE: No performance or generality is lost by using the 'int' type for setters and getters. At a low level the JavaVM converts all integer types into an int when not in an array.
DESIGN NOTE: Java does not support unsigned data. If an image is unsigned this is only directly enforced by the get() function. When directly accessing the data array the data's unsigned nature must be enforced manually using the bitwise and operator.
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class boofcv.struct.image.ImageBase
ImageBase.PixelXY
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
forEachPixel
(GrayI.EachPixel function) Passes in the coordinate and value of each pixel in the image.int
get
(int x, int y) Returns the value of the specified pixel.Returns image type informationvoid
print()
Prints the image to standard outvoid
void
abstract void
set
(int x, int y, int value) Sets the value of the specified pixel.abstract int
unsafe_get
(int x, int y) Get function which does not perform bounds checking.abstract void
unsafe_set
(int x, int y, int value) Set function which does not perform bounds checking.Methods inherited from class boofcv.struct.image.ImageGray
_getData, _setData, copyRow, create, createSameShape, initialize, reshape, reshape, setTo, subimage
Methods inherited from class boofcv.struct.image.ImageBase
clone, copyCol, createNew, createSameShape, forEachXY, getImageType, getIndex, indexToPixelX, indexToPixelY, isInBounds, isSameShape, isSubimage, reshapeTo, subimage, totalPixels
-
Constructor Details
-
GrayI
protected GrayI(int width, int height) -
GrayI
protected GrayI()
-
-
Method Details
-
get
public int get(int x, int y) Returns the value of the specified pixel.- Parameters:
x
- pixel coordinate.y
- pixel coordinate.- Returns:
- an intensity value.
-
set
public abstract void set(int x, int y, int value) Sets the value of the specified pixel.- Parameters:
x
- pixel coordinate.y
- pixel coordinate.value
- The pixel's new value.
-
unsafe_set
public abstract void unsafe_set(int x, int y, int value) Set function which does not perform bounds checking.- Parameters:
x
- pixel coordinate.y
- pixel coordinate.value
- The pixel's new value.
-
unsafe_get
public abstract int unsafe_get(int x, int y) Get function which does not perform bounds checking.- Parameters:
x
- pixel coordinate.y
- pixel coordinate.- Returns:
- an intensity value.
-
forEachPixel
Passes in the coordinate and value of each pixel in the image.- Parameters:
function
- (Input) The function
-
getDataType
Description copied from class:ImageGray
Returns image type information- Specified by:
getDataType
in classImageGray<T extends GrayI<T>>
- Returns:
- The type of image.
-
print
public void print()Description copied from class:ImageGray
Prints the image to standard out -
printBinary
public void printBinary() -
printNotZero
public void printNotZero()
-