01: /*
02: * $RCSfile: WritableRandomIter.java,v $
03: *
04: * Copyright (c) 2005 Sun Microsystems, Inc. All rights reserved.
05: *
06: * Use is subject to license terms.
07: *
08: * $Revision: 1.1 $
09: * $Date: 2005/02/11 04:57:27 $
10: * $State: Exp $
11: */
12: package javax.media.jai.iterator;
13:
14: /**
15: * An iterator that allows random read/write access to any sample
16: * within its bounding rectangle. This flexibility will generally
17: * exact a corresponding price in speed and setup overhead.
18: *
19: * <p> The iterator is initialized with a particular rectangle as its
20: * bounds, which it is illegal to exceed. This initialization takes
21: * place in a factory method and is not a part of the iterator
22: * interface itself.
23: *
24: * <p> The setSample() and setPixel() methods allow individual source
25: * samples and whole pixels to be written.
26: *
27: * <p> An instance of RandomIter may be obtained by means of the
28: * RandomIterFactory.createWritable() method, which returns an
29: * opaque object implementing this interface.
30: *
31: * @see RandomIter
32: * @see RandomIterFactory
33: */
34: public interface WritableRandomIter extends RandomIter {
35:
36: /**
37: * Sets the specified sample of the image to an integral value.
38: *
39: * @param x the X coordinate of the pixel.
40: * @param y the Y coordinate of the pixel.
41: * @param b the band to be set.
42: * @param s the sample's new integral value.
43: */
44: void setSample(int x, int y, int b, int s);
45:
46: /**
47: * Sets the specified sample of the image to a float value.
48: *
49: * @param x the X coordinate of the pixel.
50: * @param y the Y coordinate of the pixel.
51: * @param b the band to be set.
52: * @param s the sample's new float value.
53: */
54: void setSample(int x, int y, int b, float s);
55:
56: /**
57: * Sets the specified sample of the image to a double value.
58: *
59: * @param x the X coordinate of the pixel.
60: * @param y the Y coordinate of the pixel.
61: * @param b the band to be set.
62: * @param s the sample's new double value.
63: */
64: void setSample(int x, int y, int b, double s);
65:
66: /**
67: * Sets a pixel in the image using an int array of samples for input.
68: *
69: * @param x the X coordinate of the pixel.
70: * @param y the Y coordinate of the pixel.
71: * @param iArray the input samples in an int array.
72: */
73: void setPixel(int x, int y, int[] iArray);
74:
75: /**
76: * Sets a pixel in the image using a float array of samples for input.
77: *
78: * @param x the X coordinate of the pixel.
79: * @param y the Y coordinate of the pixel.
80: * @param iArray the input samples in a float array.
81: */
82: void setPixel(int x, int y, float[] fArray);
83:
84: /**
85: * Sets a pixel in the image using a float array of samples for input.
86: *
87: * @param x the X coordinate of the pixel.
88: * @param y the Y coordinate of the pixel.
89: * @param dArray the input samples in a double array.
90: */
91: void setPixel(int x, int y, double[] dArray);
92: }
|