01: /*
02: * @(#)PPCImageRepresentation.java 1.6 06/10/10
03: *
04: * Copyright 1990-2006 Sun Microsystems, Inc. All Rights Reserved.
05: * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER
06: *
07: * This program is free software; you can redistribute it and/or
08: * modify it under the terms of the GNU General Public License version
09: * 2 only, as published by the Free Software Foundation.
10: *
11: * This program is distributed in the hope that it will be useful, but
12: * WITHOUT ANY WARRANTY; without even the implied warranty of
13: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14: * General Public License version 2 for more details (a copy is
15: * included at /legal/license.txt).
16: *
17: * You should have received a copy of the GNU General Public License
18: * version 2 along with this work; if not, write to the Free Software
19: * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
20: * 02110-1301 USA
21: *
22: * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa
23: * Clara, CA 95054 or visit www.sun.com if you need additional
24: * information or have any questions.
25: */
26:
27: package sun.awt.pocketpc;
28:
29: import sun.awt.image.ImageRepresentation;
30: import java.awt.Color;
31: import java.awt.Graphics;
32: import java.awt.image.ColorModel;
33:
34: /** Defines the representation used to store images in MFC. The image is
35: stored as a PPC pixmap (server side image). */
36:
37: class PPCImageRepresentation extends ImageRepresentation {
38: private static native void initIDs();
39:
40: static {
41: initIDs();
42: }
43:
44: PPCImageRepresentation(PPCImage image) {
45: super (image, 0);
46: }
47:
48: protected native void offscreenInit(Color bg);
49:
50: protected native boolean setBytePixels(int x, int y, int w, int h,
51: ColorModel model, byte pix[], int off, int scansize);
52:
53: protected native boolean setIntPixels(int x, int y, int w, int h,
54: ColorModel model, int pix[], int off, int scansize);
55:
56: protected native boolean finish(boolean force);
57:
58: protected native synchronized void imageDraw(Graphics g, int x,
59: int y, Color c);
60:
61: protected native synchronized void imageStretch(Graphics g,
62: int dx1, int dy1, int dx2, int dy2, int sx1, int sy1,
63: int sx2, int sy2, Color c);
64:
65: protected native void disposeImage();
66:
67: native int getRGB(ColorModel cm, int x, int y);
68:
69: native void getRGBs(ColorModel cm, int startX, int startY, int w,
70: int h, int[] rgbArray, int offset, int scansize);
71: }
|