01: /*
02: * $RCSfile: WritableRectIterCSMFloat.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:55:45 $
10: * $State: Exp $
11: */
12: package com.sun.media.jai.iterator;
13:
14: import java.awt.Rectangle;
15: import java.awt.image.RenderedImage;
16: import javax.media.jai.iterator.WritableRectIter;
17:
18: /**
19: */
20: public class WritableRectIterCSMFloat extends RectIterCSMFloat
21: implements WritableRectIter {
22:
23: public WritableRectIterCSMFloat(RenderedImage im, Rectangle bounds) {
24: super (im, bounds);
25: }
26:
27: public void setSample(int s) {
28: bank[offset + bandOffset] = (float) s;
29: }
30:
31: public void setSample(int b, int s) {
32: bankData[b][offset + bandOffsets[b]] = (float) s;
33: }
34:
35: public void setSample(float s) {
36: bank[offset + bandOffset] = s;
37: }
38:
39: public void setSample(int b, float s) {
40: bankData[b][offset + bandOffsets[b]] = s;
41: }
42:
43: public void setSample(double s) {
44: bank[offset + bandOffset] = (float) s;
45: }
46:
47: public void setSample(int b, double s) {
48: bankData[b][offset + bandOffsets[b]] = (float) s;
49: }
50:
51: public void setPixel(int[] iArray) {
52: for (int b = 0; b < numBands; b++) {
53: bankData[b][offset + bandOffsets[b]] = (float) iArray[b];
54: }
55: }
56:
57: public void setPixel(float[] fArray) {
58: for (int b = 0; b < numBands; b++) {
59: bankData[b][offset + bandOffsets[b]] = fArray[b];
60: }
61: }
62:
63: public void setPixel(double[] dArray) {
64: for (int b = 0; b < numBands; b++) {
65: bankData[b][offset + bandOffsets[b]] = (float) dArray[b];
66: }
67: }
68: }
|