1 | /* |
2 | * Copyright (c) 2000, 2005, Oracle and/or its affiliates. All rights reserved. |
3 | * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
4 | * |
5 | * This code is free software; you can redistribute it and/or modify it |
6 | * under the terms of the GNU General Public License version 2 only, as |
7 | * published by the Free Software Foundation. Oracle designates this |
8 | * particular file as subject to the "Classpath" exception as provided |
9 | * by Oracle in the LICENSE file that accompanied this code. |
10 | * |
11 | * This code is distributed in the hope that it will be useful, but WITHOUT |
12 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
13 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
14 | * version 2 for more details (a copy is included in the LICENSE file that |
15 | * accompanied this code). |
16 | * |
17 | * You should have received a copy of the GNU General Public License version |
18 | * 2 along with this work; if not, write to the Free Software Foundation, |
19 | * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. |
20 | * |
21 | * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA |
22 | * or visit www.oracle.com if you need additional information or have any |
23 | * questions. |
24 | */ |
25 | |
26 | #include "AnyShort.h" |
27 | #include "Ushort565Rgb.h" |
28 | #include "AlphaMacros.h" |
29 | |
30 | #include "IntArgb.h" |
31 | #include "IntArgbBm.h" |
32 | #include "IntArgbPre.h" |
33 | #include "IntRgb.h" |
34 | #include "ThreeByteBgr.h" |
35 | #include "ByteGray.h" |
36 | #include "ByteIndexed.h" |
37 | #include "Ushort4444Argb.h" |
38 | |
39 | /* |
40 | * This file declares, registers, and defines the various graphics |
41 | * primitive loops to manipulate surfaces of type "Ushort565Rgb". |
42 | * |
43 | * See also LoopMacros.h |
44 | */ |
45 | |
46 | RegisterFunc RegisterUshort565Rgb; |
47 | |
48 | DECLARE_CONVERT_BLIT(Ushort565Rgb, IntArgb); |
49 | DECLARE_CONVERT_BLIT(IntArgb, Ushort565Rgb); |
50 | DECLARE_CONVERT_BLIT(ThreeByteBgr, Ushort565Rgb); |
51 | DECLARE_CONVERT_BLIT(ByteGray, Ushort565Rgb); |
52 | DECLARE_CONVERT_BLIT(ByteIndexed, Ushort565Rgb); |
53 | DECLARE_SCALE_BLIT(Ushort565Rgb, IntArgb); |
54 | DECLARE_SCALE_BLIT(IntArgb, Ushort565Rgb); |
55 | DECLARE_SCALE_BLIT(ThreeByteBgr, Ushort565Rgb); |
56 | DECLARE_SCALE_BLIT(ByteGray, Ushort565Rgb); |
57 | DECLARE_SCALE_BLIT(ByteIndexed, Ushort565Rgb); |
58 | DECLARE_XPAR_CONVERT_BLIT(ByteIndexedBm, Ushort565Rgb); |
59 | DECLARE_XPAR_SCALE_BLIT(ByteIndexedBm, Ushort565Rgb); |
60 | DECLARE_XPAR_SCALE_BLIT(IntArgbBm, Ushort565Rgb); |
61 | DECLARE_XPAR_BLITBG(ByteIndexedBm, Ushort565Rgb); |
62 | DECLARE_XPAR_CONVERT_BLIT(IntArgbBm, Ushort565Rgb); |
63 | DECLARE_XPAR_BLITBG(IntArgbBm, Ushort565Rgb); |
64 | |
65 | DECLARE_XOR_BLIT(IntArgb, Ushort565Rgb); |
66 | DECLARE_SRC_MASKFILL(Ushort565Rgb); |
67 | DECLARE_SRCOVER_MASKFILL(Ushort565Rgb); |
68 | DECLARE_ALPHA_MASKFILL(Ushort565Rgb); |
69 | DECLARE_SRCOVER_MASKBLIT(IntArgb, Ushort565Rgb); |
70 | DECLARE_SRCOVER_MASKBLIT(IntArgbPre, Ushort565Rgb); |
71 | DECLARE_SRCOVER_MASKBLIT(Ushort4444Argb, Ushort565Rgb); |
72 | DECLARE_ALPHA_MASKBLIT(IntArgb, Ushort565Rgb); |
73 | DECLARE_ALPHA_MASKBLIT(IntArgbPre, Ushort565Rgb); |
74 | DECLARE_ALPHA_MASKBLIT(IntRgb, Ushort565Rgb); |
75 | DECLARE_SOLID_DRAWGLYPHLISTAA(Ushort565Rgb); |
76 | DECLARE_SOLID_DRAWGLYPHLISTLCD(Ushort565Rgb); |
77 | |
78 | NativePrimitive Ushort565RgbPrimitives[] = { |
79 | REGISTER_ANYSHORT_ISOCOPY_BLIT(Ushort565Rgb), |
80 | REGISTER_ANYSHORT_ISOSCALE_BLIT(Ushort565Rgb), |
81 | REGISTER_ANYSHORT_ISOXOR_BLIT(Ushort565Rgb), |
82 | REGISTER_CONVERT_BLIT(Ushort565Rgb, IntArgb), |
83 | REGISTER_CONVERT_BLIT(IntArgb, Ushort565Rgb), |
84 | REGISTER_CONVERT_BLIT_EQUIV(IntRgb, Ushort565Rgb, |
85 | NAME_CONVERT_BLIT(IntArgb, Ushort565Rgb)), |
86 | REGISTER_CONVERT_BLIT_EQUIV(IntArgbBm, Ushort565Rgb, |
87 | NAME_CONVERT_BLIT(IntArgb, Ushort565Rgb)), |
88 | REGISTER_CONVERT_BLIT(ThreeByteBgr, Ushort565Rgb), |
89 | REGISTER_CONVERT_BLIT(ByteGray, Ushort565Rgb), |
90 | REGISTER_CONVERT_BLIT(ByteIndexed, Ushort565Rgb), |
91 | REGISTER_SCALE_BLIT(Ushort565Rgb, IntArgb), |
92 | REGISTER_SCALE_BLIT(IntArgb, Ushort565Rgb), |
93 | REGISTER_SCALE_BLIT_EQUIV(IntArgbBm, Ushort565Rgb, |
94 | NAME_SCALE_BLIT(IntArgb, Ushort565Rgb)), |
95 | REGISTER_SCALE_BLIT_EQUIV(IntRgb, Ushort565Rgb, |
96 | NAME_SCALE_BLIT(IntArgb, Ushort565Rgb)), |
97 | REGISTER_SCALE_BLIT(ThreeByteBgr, Ushort565Rgb), |
98 | REGISTER_SCALE_BLIT(ByteGray, Ushort565Rgb), |
99 | REGISTER_SCALE_BLIT(ByteIndexed, Ushort565Rgb), |
100 | REGISTER_XPAR_CONVERT_BLIT(ByteIndexedBm, Ushort565Rgb), |
101 | REGISTER_XPAR_SCALE_BLIT(ByteIndexedBm, Ushort565Rgb), |
102 | REGISTER_XPAR_SCALE_BLIT(IntArgbBm, Ushort565Rgb), |
103 | REGISTER_XPAR_BLITBG(ByteIndexedBm, Ushort565Rgb), |
104 | REGISTER_XPAR_CONVERT_BLIT(IntArgbBm, Ushort565Rgb), |
105 | REGISTER_XPAR_BLITBG(IntArgbBm, Ushort565Rgb), |
106 | |
107 | REGISTER_XOR_BLIT(IntArgb, Ushort565Rgb), |
108 | REGISTER_SRC_MASKFILL(Ushort565Rgb), |
109 | REGISTER_SRCOVER_MASKFILL(Ushort565Rgb), |
110 | REGISTER_ALPHA_MASKFILL(Ushort565Rgb), |
111 | REGISTER_SRCOVER_MASKBLIT(IntArgb, Ushort565Rgb), |
112 | REGISTER_SRCOVER_MASKBLIT(IntArgbPre, Ushort565Rgb), |
113 | REGISTER_SRCOVER_MASKBLIT(Ushort4444Argb, Ushort565Rgb), |
114 | REGISTER_ALPHA_MASKBLIT(IntArgb, Ushort565Rgb), |
115 | REGISTER_ALPHA_MASKBLIT(IntArgbPre, Ushort565Rgb), |
116 | REGISTER_ALPHA_MASKBLIT(IntRgb, Ushort565Rgb), |
117 | REGISTER_SOLID_DRAWGLYPHLISTAA(Ushort565Rgb), |
118 | REGISTER_SOLID_DRAWGLYPHLISTLCD(Ushort565Rgb), |
119 | }; |
120 | |
121 | jboolean RegisterUshort565Rgb(JNIEnv *env) |
122 | { |
123 | return RegisterPrimitives(env, Ushort565RgbPrimitives, |
124 | ArraySize(Ushort565RgbPrimitives)); |
125 | } |
126 | |
127 | jint PixelForUshort565Rgb(SurfaceDataRasInfo *pRasInfo, jint rgb) |
128 | { |
129 | return IntArgbToUshort565Rgb(rgb); |
130 | } |
131 | |
132 | DEFINE_CONVERT_BLIT(Ushort565Rgb, IntArgb, 3ByteRgb) |
133 | |
134 | DEFINE_CONVERT_BLIT(IntArgb, Ushort565Rgb, 1IntRgb) |
135 | |
136 | DEFINE_CONVERT_BLIT(ThreeByteBgr, Ushort565Rgb, 3ByteRgb) |
137 | |
138 | DEFINE_CONVERT_BLIT(ByteGray, Ushort565Rgb, 3ByteRgb) |
139 | |
140 | DEFINE_CONVERT_BLIT_LUT8(ByteIndexed, Ushort565Rgb, PreProcessLut) |
141 | |
142 | DEFINE_SCALE_BLIT(Ushort565Rgb, IntArgb, 3ByteRgb) |
143 | |
144 | DEFINE_SCALE_BLIT(IntArgb, Ushort565Rgb, 1IntRgb) |
145 | |
146 | DEFINE_SCALE_BLIT(ThreeByteBgr, Ushort565Rgb, 3ByteRgb) |
147 | |
148 | DEFINE_SCALE_BLIT(ByteGray, Ushort565Rgb, 3ByteRgb) |
149 | |
150 | DEFINE_SCALE_BLIT_LUT8(ByteIndexed, Ushort565Rgb, PreProcessLut) |
151 | |
152 | DEFINE_XPAR_CONVERT_BLIT_LUT8(ByteIndexedBm, Ushort565Rgb, PreProcessLut) |
153 | |
154 | DEFINE_XPAR_SCALE_BLIT_LUT8(ByteIndexedBm, Ushort565Rgb, PreProcessLut) |
155 | |
156 | DEFINE_XPAR_SCALE_BLIT(IntArgbBm, Ushort565Rgb, 1IntRgb) |
157 | |
158 | DEFINE_XPAR_BLITBG_LUT8(ByteIndexedBm, Ushort565Rgb, PreProcessLut) |
159 | |
160 | DEFINE_XPAR_CONVERT_BLIT(IntArgbBm, Ushort565Rgb, 1IntRgb) |
161 | |
162 | DEFINE_XPAR_BLITBG(IntArgbBm, Ushort565Rgb, 1IntRgb) |
163 | |
164 | DEFINE_XOR_BLIT(IntArgb, Ushort565Rgb, AnyShort) |
165 | |
166 | DEFINE_SRC_MASKFILL(Ushort565Rgb, 4ByteArgb) |
167 | |
168 | DEFINE_SRCOVER_MASKFILL(Ushort565Rgb, 4ByteArgb) |
169 | |
170 | DEFINE_ALPHA_MASKFILL(Ushort565Rgb, 4ByteArgb) |
171 | |
172 | DEFINE_SRCOVER_MASKBLIT(IntArgb, Ushort565Rgb, 4ByteArgb) |
173 | |
174 | DEFINE_SRCOVER_MASKBLIT(IntArgbPre, Ushort565Rgb, 4ByteArgb) |
175 | |
176 | DEFINE_SRCOVER_MASKBLIT(Ushort4444Argb, Ushort565Rgb, 4ByteArgb) |
177 | |
178 | DEFINE_ALPHA_MASKBLIT(IntArgb, Ushort565Rgb, 4ByteArgb) |
179 | |
180 | DEFINE_ALPHA_MASKBLIT(IntArgbPre, Ushort565Rgb, 4ByteArgb) |
181 | |
182 | DEFINE_ALPHA_MASKBLIT(IntRgb, Ushort565Rgb, 4ByteArgb) |
183 | |
184 | DEFINE_SOLID_DRAWGLYPHLISTAA(Ushort565Rgb, 3ByteRgb) |
185 | |
186 | DEFINE_SOLID_DRAWGLYPHLISTLCD(Ushort565Rgb, 3ByteRgb) |
187 | |