public abstract class GrayI<T extends GrayI> extends ImageGray<T>
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.
| Modifier | Constructor and Description |
|---|---|
protected |
GrayI() |
protected |
GrayI(int width,
int height) |
| Modifier and Type | Method and Description |
|---|---|
int |
get(int x,
int y)
Returns the value of the specified pixel.
|
ImageDataType |
getDataType()
Returns image type information
|
void |
print() |
void |
printBinary() |
void |
printNotZero() |
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.
|
_getData, _setData, reshape, setTo, subimage_createNew, clone, createSameShape, getHeight, getImageType, getIndex, getStartIndex, getStride, getWidth, indexToPixel, isInBounds, isSubimage, setHeight, setStartIndex, setStride, setWidth, subimagepublic int get(int x,
int y)
x - pixel coordinate.y - pixel coordinate.public abstract void set(int x,
int y,
int value)
x - pixel coordinate.y - pixel coordinate.value - The pixel's new value.public abstract void unsafe_set(int x,
int y,
int value)
x - pixel coordinate.y - pixel coordinate.value - The pixel's new value.public abstract int unsafe_get(int x,
int y)
x - pixel coordinate.y - pixel coordinate.public ImageDataType getDataType()
ImageGraygetDataType in class ImageGray<T extends GrayI>public void print()
public void printBinary()
public void printNotZero()