01: /*
02: * CDataBuffer.java
03: *
04: * Created on February 17, 2004, 2:21 AM
05: */
06:
07: package org.netbeans.imagecache;
08:
09: import java.awt.image.DataBuffer;
10: import java.awt.image.DataBufferInt;
11: import java.nio.IntBuffer;
12:
13: /** An imaging DataBufferInt implementation backed by an IntBuffer over a
14: * memory mapped file.
15: *
16: * @author Tim Boudreau
17: */
18: class CDataBuffer extends DataBuffer {
19: IntBuffer buf;
20:
21: /** Creates a new instance of CDataBuffer */
22: public CDataBuffer(IntBuffer buf, int width, int height) {
23: super (TYPE_INT, width * height);
24: this .buf = buf;
25: }
26:
27: public int getOffset() {
28: return 0;
29: }
30:
31: public int getElem(int bank, int i) {
32: return this .buf.get(i);
33: }
34:
35: public void setElem(int bank, int i, int val) {
36: // throw new UnsupportedOperationException();
37: //do nothing
38: }
39:
40: }
|