01: /*
02: * Licensed to the Apache Software Foundation (ASF) under one or more
03: * contributor license agreements. See the NOTICE file distributed with
04: * this work for additional information regarding copyright ownership.
05: * The ASF licenses this file to You under the Apache License, Version 2.0
06: * (the "License"); you may not use this file except in compliance with
07: * the License. You may obtain a copy of the License at
08: *
09: * http://www.apache.org/licenses/LICENSE-2.0
10: *
11: * Unless required by applicable law or agreed to in writing, software
12: * distributed under the License is distributed on an "AS IS" BASIS,
13: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14: * See the License for the specific language governing permissions and
15: * limitations under the License.
16: */
17: /**
18: * @author Igor V. Stolyarov
19: * @version $Revision$
20: * Created on 23.11.2005
21: *
22: */package org.apache.harmony.awt.gl;
23:
24: import java.awt.Image;
25: import java.awt.image.DataBuffer;
26: import java.awt.image.IndexColorModel;
27: import java.awt.image.DataBufferInt;
28:
29: import org.apache.harmony.awt.gl.image.DataBufferListener;
30:
31: /**
32: * This class give an opportunity to get access to private data of
33: * some java.awt.image classes
34: * Implementation of this class placed in java.awt.image package
35: */
36:
37: public abstract class AwtImageBackdoorAccessor {
38:
39: static protected AwtImageBackdoorAccessor inst;
40:
41: public static AwtImageBackdoorAccessor getInstance() {
42: // First we need to run the static initializer in the DataBuffer class to resolve inst.
43: new DataBufferInt(0);
44: return inst;
45: }
46:
47: public abstract Surface getImageSurface(Image image);
48:
49: public abstract boolean isGrayPallete(IndexColorModel icm);
50:
51: public abstract Object getData(DataBuffer db);
52:
53: public abstract int[] getDataInt(DataBuffer db);
54:
55: public abstract byte[] getDataByte(DataBuffer db);
56:
57: public abstract short[] getDataShort(DataBuffer db);
58:
59: public abstract short[] getDataUShort(DataBuffer db);
60:
61: public abstract double[] getDataDouble(DataBuffer db);
62:
63: public abstract float[] getDataFloat(DataBuffer db);
64:
65: public abstract void releaseData(DataBuffer db);
66:
67: public abstract void addDataBufferListener(DataBuffer db,
68: DataBufferListener listener);
69:
70: public abstract void removeDataBufferListener(DataBuffer db);
71:
72: public abstract void validate(DataBuffer db);
73: }
|