javax.media.jai.iterator
Interface WritableRandomIter

All Superinterfaces:
RandomIter

public interface WritableRandomIter
extends RandomIter

An iterator that allows random read/write 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 setSample() and setPixel() methods allow individual source samples and whole pixels to be written.

An instance of RandomIter may be obtained by means of the RandomIterFactory.createWritable() method, which returns an opaque object implementing this interface.

See Also:
RandomIter, RandomIterFactory

Method Summary
 void setPixel(int x, int y, double[] dArray)
          Sets a pixel in the image using a float array of samples for input.
 void setPixel(int x, int y, float[] fArray)
          Sets a pixel in the image using a float array of samples for input.
 void setPixel(int x, int y, int[] iArray)
          Sets a pixel in the image using an int array of samples for input.
 void setSample(int x, int y, int b, double s)
          Sets the specified sample of the image to a double value.
 void setSample(int x, int y, int b, float s)
          Sets the specified sample of the image to a float value.
 void setSample(int x, int y, int b, int s)
          Sets the specified sample of the image to an integral value.
 
Methods inherited from interface javax.media.jai.iterator.RandomIter
done, getPixel, getPixel, getPixel, getSample, getSampleDouble, getSampleFloat
 

Method Detail

setSample

public void setSample(int x,
                      int y,
                      int b,
                      int s)
Sets the specified sample of the image to an integral value.

Parameters:
x - the X coordinate of the pixel.
y - the Y coordinate of the pixel.
b - the band to be set.
s - the sample's new integral value.

setSample

public void setSample(int x,
                      int y,
                      int b,
                      float s)
Sets the specified sample of the image to a float value.

Parameters:
x - the X coordinate of the pixel.
y - the Y coordinate of the pixel.
b - the band to be set.
s - the sample's new float value.

setSample

public void setSample(int x,
                      int y,
                      int b,
                      double s)
Sets the specified sample of the image to a double value.

Parameters:
x - the X coordinate of the pixel.
y - the Y coordinate of the pixel.
b - the band to be set.
s - the sample's new double value.

setPixel

public void setPixel(int x,
                     int y,
                     int[] iArray)
Sets a pixel in the image using an int array of samples for input.

Parameters:
x - the X coordinate of the pixel.
y - the Y coordinate of the pixel.
iArray - the input samples in an int array.

setPixel

public void setPixel(int x,
                     int y,
                     float[] fArray)
Sets a pixel in the image using a float array of samples for input.

Parameters:
x - the X coordinate of the pixel.
y - the Y coordinate of the pixel.

setPixel

public void setPixel(int x,
                     int y,
                     double[] dArray)
Sets a pixel in the image using a float array of samples for input.

Parameters:
x - the X coordinate of the pixel.
y - the Y coordinate of the pixel.
dArray - the input samples in a double array.