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 "AnyInt.h"
27#include "IntRgbx.h"
28#include "AlphaMacros.h"
29
30#include "IntRgb.h"
31#include "IntArgb.h"
32#include "IntArgbBm.h"
33#include "IntArgbPre.h"
34#include "ThreeByteBgr.h"
35#include "ByteGray.h"
36#include "ByteIndexed.h"
37
38/*
39 * This file declares, registers, and defines the various graphics
40 * primitive loops to manipulate surfaces of type "IntRgbx".
41 *
42 * See also LoopMacros.h
43 */
44
45RegisterFunc RegisterIntRgbx;
46
47DECLARE_CONVERT_BLIT(IntRgbx, IntArgb);
48DECLARE_CONVERT_BLIT(IntArgb, IntRgbx);
49DECLARE_CONVERT_BLIT(ThreeByteBgr, IntRgbx);
50DECLARE_CONVERT_BLIT(ByteGray, IntRgbx);
51DECLARE_CONVERT_BLIT(ByteIndexed, IntRgbx);
52DECLARE_SCALE_BLIT(IntRgbx, IntArgb);
53DECLARE_SCALE_BLIT(IntArgb, IntRgbx);
54DECLARE_SCALE_BLIT(ThreeByteBgr, IntRgbx);
55DECLARE_SCALE_BLIT(ByteGray, IntRgbx);
56DECLARE_SCALE_BLIT(ByteIndexed, IntRgbx);
57DECLARE_XPAR_CONVERT_BLIT(ByteIndexedBm, IntRgbx);
58DECLARE_XPAR_SCALE_BLIT(ByteIndexedBm, IntRgbx);
59DECLARE_XPAR_SCALE_BLIT(IntArgbBm, IntRgbx);
60DECLARE_XPAR_BLITBG(ByteIndexedBm, IntRgbx);
61DECLARE_XOR_BLIT(IntArgb, IntRgbx);
62DECLARE_SRC_MASKFILL(IntRgbx);
63DECLARE_SRCOVER_MASKFILL(IntRgbx);
64DECLARE_ALPHA_MASKFILL(IntRgbx);
65DECLARE_SRCOVER_MASKBLIT(IntArgb, IntRgbx);
66DECLARE_ALPHA_MASKBLIT(IntArgb, IntRgbx);
67DECLARE_SRCOVER_MASKBLIT(IntArgbPre, IntRgbx);
68DECLARE_ALPHA_MASKBLIT(IntArgbPre, IntRgbx);
69DECLARE_ALPHA_MASKBLIT(IntRgb, IntRgbx);
70DECLARE_SOLID_DRAWGLYPHLISTAA(IntRgbx);
71DECLARE_SOLID_DRAWGLYPHLISTLCD(IntRgbx);
72
73DECLARE_TRANSFORMHELPER_FUNCS(IntRgbx);
74
75NativePrimitive IntRgbxPrimitives[] = {
76 REGISTER_ANYINT_ISOCOPY_BLIT(IntRgbx),
77 REGISTER_ANYINT_ISOSCALE_BLIT(IntRgbx),
78 REGISTER_ANYINT_ISOXOR_BLIT(IntRgbx),
79 REGISTER_CONVERT_BLIT(IntRgbx, IntArgb),
80 REGISTER_CONVERT_BLIT(IntArgb, IntRgbx),
81 REGISTER_CONVERT_BLIT(ThreeByteBgr, IntRgbx),
82 REGISTER_CONVERT_BLIT(ByteGray, IntRgbx),
83 REGISTER_CONVERT_BLIT_EQUIV(IntRgb, IntRgbx,
84 NAME_CONVERT_BLIT(IntArgb, IntRgbx)),
85 REGISTER_CONVERT_BLIT(ByteIndexed, IntRgbx),
86 REGISTER_SCALE_BLIT(IntRgbx, IntArgb),
87 REGISTER_SCALE_BLIT(IntArgb, IntRgbx),
88 REGISTER_SCALE_BLIT(ThreeByteBgr, IntRgbx),
89 REGISTER_SCALE_BLIT(ByteGray, IntRgbx),
90 REGISTER_SCALE_BLIT_EQUIV(IntRgb, IntRgbx,
91 NAME_SCALE_BLIT(IntArgb, IntRgbx)),
92 REGISTER_SCALE_BLIT(ByteIndexed, IntRgbx),
93 REGISTER_XPAR_CONVERT_BLIT(ByteIndexedBm, IntRgbx),
94 REGISTER_XPAR_SCALE_BLIT(ByteIndexedBm, IntRgbx),
95 REGISTER_XPAR_SCALE_BLIT(IntArgbBm, IntRgbx),
96 REGISTER_XPAR_BLITBG(ByteIndexedBm, IntRgbx),
97 REGISTER_XOR_BLIT(IntArgb, IntRgbx),
98 REGISTER_SRC_MASKFILL(IntRgbx),
99 REGISTER_SRCOVER_MASKFILL(IntRgbx),
100 REGISTER_ALPHA_MASKFILL(IntRgbx),
101 REGISTER_SRCOVER_MASKBLIT(IntArgb, IntRgbx),
102 REGISTER_ALPHA_MASKBLIT(IntArgb, IntRgbx),
103 REGISTER_SRCOVER_MASKBLIT(IntArgbPre, IntRgbx),
104 REGISTER_ALPHA_MASKBLIT(IntArgbPre, IntRgbx),
105 REGISTER_ALPHA_MASKBLIT(IntRgb, IntRgbx),
106 REGISTER_SOLID_DRAWGLYPHLISTAA(IntRgbx),
107 REGISTER_SOLID_DRAWGLYPHLISTLCD(IntRgbx),
108
109 REGISTER_TRANSFORMHELPER_FUNCS(IntRgbx),
110};
111
112jboolean RegisterIntRgbx(JNIEnv *env)
113{
114 return RegisterPrimitives(env, IntRgbxPrimitives,
115 ArraySize(IntRgbxPrimitives));
116}
117
118jint PixelForIntRgbx(SurfaceDataRasInfo *pRasInfo, jint rgb)
119{
120 return (rgb << 8);
121}
122
123DEFINE_CONVERT_BLIT(IntRgbx, IntArgb, 1IntRgb)
124
125DEFINE_CONVERT_BLIT(IntArgb, IntRgbx, 1IntRgb)
126
127DEFINE_CONVERT_BLIT(ThreeByteBgr, IntRgbx, 1IntRgb)
128
129DEFINE_CONVERT_BLIT(ByteGray, IntRgbx, 1IntRgb)
130
131DEFINE_CONVERT_BLIT_LUT8(ByteIndexed, IntRgbx, ConvertOnTheFly)
132
133DEFINE_SCALE_BLIT(IntRgbx, IntArgb, 1IntRgb)
134
135DEFINE_SCALE_BLIT(IntArgb, IntRgbx, 1IntRgb)
136
137DEFINE_SCALE_BLIT(ThreeByteBgr, IntRgbx, 1IntRgb)
138
139DEFINE_SCALE_BLIT(ByteGray, IntRgbx, 1IntRgb)
140
141DEFINE_SCALE_BLIT_LUT8(ByteIndexed, IntRgbx, ConvertOnTheFly)
142
143DEFINE_XPAR_CONVERT_BLIT_LUT8(ByteIndexedBm, IntRgbx, ConvertOnTheFly)
144
145DEFINE_XPAR_SCALE_BLIT_LUT8(ByteIndexedBm, IntRgbx, ConvertOnTheFly)
146
147DEFINE_XPAR_SCALE_BLIT(IntArgbBm, IntRgbx, 1IntRgb)
148
149DEFINE_XPAR_BLITBG_LUT8(ByteIndexedBm, IntRgbx, ConvertOnTheFly)
150
151DEFINE_XOR_BLIT(IntArgb, IntRgbx, AnyInt)
152
153DEFINE_SRC_MASKFILL(IntRgbx, 4ByteArgb)
154
155DEFINE_SRCOVER_MASKFILL(IntRgbx, 4ByteArgb)
156
157DEFINE_ALPHA_MASKFILL(IntRgbx, 4ByteArgb)
158
159DEFINE_SRCOVER_MASKBLIT(IntArgb, IntRgbx, 4ByteArgb)
160
161DEFINE_ALPHA_MASKBLIT(IntArgb, IntRgbx, 4ByteArgb)
162
163DEFINE_SRCOVER_MASKBLIT(IntArgbPre, IntRgbx, 4ByteArgb)
164
165DEFINE_ALPHA_MASKBLIT(IntArgbPre, IntRgbx, 4ByteArgb)
166
167DEFINE_ALPHA_MASKBLIT(IntRgb, IntRgbx, 4ByteArgb)
168
169DEFINE_SOLID_DRAWGLYPHLISTAA(IntRgbx, 3ByteRgb)
170
171DEFINE_SOLID_DRAWGLYPHLISTLCD(IntRgbx, 3ByteRgb)
172
173DEFINE_TRANSFORMHELPERS(IntRgbx)
174