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