|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface RandomIter
An iterator that allows random read-only access to any sample within its bounding rectangle. This flexibility will generally exact a corresponding price in speed and setup overhead.
The iterator is initialized with a particular rectangle as its bounds, which it is illegal to exceed. This initialization takes place in a factory method and is not a part of the iterator interface itself.
The getSample(), getSampleFloat(), and getSampleDouble() methods are provided to allow read-only access to the source data. The getPixel() methods allow retrieval of all bands simultaneously.
An instance of RandomIter may be obtained by means of the RandomIterFactory.create() method, which returns an opaque object implementing this interface.
WritableRandomIter
,
RandomIterFactory
Method Summary | |
---|---|
void |
done()
Informs the iterator that it may discard its internal data structures. |
double[] |
getPixel(int x,
int y,
double[] dArray)
Returns the samples of the specified pixel from the image in an array of double. |
float[] |
getPixel(int x,
int y,
float[] fArray)
Returns the samples of the specified pixel from the image in an array of float. |
int[] |
getPixel(int x,
int y,
int[] iArray)
Returns the samples of the specified pixel from the image in an array of int. |
int |
getSample(int x,
int y,
int b)
Returns the specified sample from the image. |
double |
getSampleDouble(int x,
int y,
int b)
Returns the specified sample from the image as a double. |
float |
getSampleFloat(int x,
int y,
int b)
Returns the specified sample from the image as a float. |
Method Detail |
---|
int getSample(int x, int y, int b)
x
- the X coordinate of the desired pixel.y
- the Y coordinate of the desired pixel.b
- the band to retrieve.float getSampleFloat(int x, int y, int b)
x
- the X coordinate of the desired pixel.y
- the Y coordinate of the desired pixel.b
- the band to retrieve.double getSampleDouble(int x, int y, int b)
x
- the X coordinate of the desired pixel.y
- the Y coordinate of the desired pixel.b
- the band to retrieve.int[] getPixel(int x, int y, int[] iArray)
x
- the X coordinate of the desired pixel.y
- the Y coordinate of the desired pixel.iArray
- An optionally preallocated int array.
float[] getPixel(int x, int y, float[] fArray)
x
- the X coordinate of the desired pixel.y
- the Y coordinate of the desired pixel.fArray
- An optionally preallocated float array.
double[] getPixel(int x, int y, double[] dArray)
x
- the X coordinate of the desired pixel.y
- the Y coordinate of the desired pixel.dArray
- An optionally preallocated double array.
void done()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |