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