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