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 ClassesNested classes/interfaces inherited from class boofcv.struct.image.ImageBase
ImageBase.PixelXY -
Field Summary
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidforEachPixel(GrayI.EachPixel function) Passes in the coordinate and value of each pixel in the image.intget(int x, int y) Returns the value of the specified pixel.Returns image type informationvoidprint()Prints the image to standard outvoidvoidabstract voidset(int x, int y, int value) Sets the value of the specified pixel.abstract intunsafe_get(int x, int y) Get function which does not perform bounds checking.abstract voidunsafe_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, subimageMethods 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:ImageGrayReturns image type information- Specified by:
getDataTypein classImageGray<T extends GrayI<T>>- Returns:
- The type of image.
-
print
public void print()Description copied from class:ImageGrayPrints the image to standard out -
printBinary
public void printBinary() -
printNotZero
public void printNotZero()
-