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 Pavel Dolgov
19: * @version $Revision$
20: */package org.apache.harmony.awt.datatransfer;
21:
22: /**
23: * RawBitmap
24: */
25: public final class RawBitmap {
26:
27: public final int width;
28: public final int height;
29: public final int stride;
30: public final int bits;
31: public final int rMask;
32: public final int gMask;
33: public final int bMask;
34:
35: /**
36: * Array representing bitmap data.
37: * Depending on bit count per pixel, it could be
38: * int[] (32 bits) or short[] (15 or 16 bits) or byte[] (8 or 24 bits)
39: */
40: public final Object buffer;
41:
42: public RawBitmap(int w, int h, int stride, int bits, int rMask,
43: int gMask, int bMask, Object buffer) {
44: this .width = w;
45: this .height = h;
46: this .stride = stride;
47: this .bits = bits;
48: this .rMask = rMask;
49: this .gMask = gMask;
50: this .bMask = bMask;
51: this .buffer = buffer;
52: }
53:
54: public RawBitmap(int header[], Object buffer) {
55: this .width = header[0];
56: this .height = header[1];
57: this .stride = header[2];
58: this .bits = header[3];
59: this .rMask = header[4];
60: this .gMask = header[5];
61: this .bMask = header[6];
62: this .buffer = buffer;
63: }
64:
65: public int[] getHeader() {
66: return new int[] { width, height, stride, bits, rMask, gMask,
67: bMask };
68: }
69: }
|