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 "Ushort555Rgbx.h"
28
29#include "IntArgb.h"
30#include "IntArgbBm.h"
31#include "ThreeByteBgr.h"
32#include "ByteGray.h"
33#include "ByteIndexed.h"
34
35/*
36 * This file declares, registers, and defines the various graphics
37 * primitive loops to manipulate surfaces of type "Ushort555Rgbx".
38 *
39 * See also LoopMacros.h
40 */
41
42RegisterFunc RegisterUshort555Rgbx;
43
44DECLARE_CONVERT_BLIT(Ushort555Rgbx, IntArgb);
45DECLARE_CONVERT_BLIT(IntArgb, Ushort555Rgbx);
46DECLARE_CONVERT_BLIT(ThreeByteBgr, Ushort555Rgbx);
47DECLARE_CONVERT_BLIT(ByteGray, Ushort555Rgbx);
48DECLARE_CONVERT_BLIT(ByteIndexed, Ushort555Rgbx);
49DECLARE_SCALE_BLIT(Ushort555Rgbx, IntArgb);
50DECLARE_SCALE_BLIT(IntArgb, Ushort555Rgbx);
51DECLARE_SCALE_BLIT(ThreeByteBgr, Ushort555Rgbx);
52DECLARE_SCALE_BLIT(ByteGray, Ushort555Rgbx);
53DECLARE_SCALE_BLIT(ByteIndexed, Ushort555Rgbx);
54DECLARE_XPAR_CONVERT_BLIT(ByteIndexedBm, Ushort555Rgbx);
55DECLARE_XPAR_SCALE_BLIT(ByteIndexedBm, Ushort555Rgbx);
56DECLARE_XPAR_SCALE_BLIT(IntArgbBm, Ushort555Rgbx);
57DECLARE_XPAR_BLITBG(ByteIndexedBm, Ushort555Rgbx);
58DECLARE_XOR_BLIT(IntArgb, Ushort555Rgbx);
59DECLARE_SOLID_DRAWGLYPHLISTAA(Ushort555Rgbx);
60DECLARE_SOLID_DRAWGLYPHLISTLCD(Ushort555Rgbx);
61
62NativePrimitive Ushort555RgbxPrimitives[] = {
63    REGISTER_ANYSHORT_ISOCOPY_BLIT(Ushort555Rgbx),
64    REGISTER_ANYSHORT_ISOSCALE_BLIT(Ushort555Rgbx),
65    REGISTER_ANYSHORT_ISOXOR_BLIT(Ushort555Rgbx),
66    REGISTER_CONVERT_BLIT(Ushort555Rgbx, IntArgb),
67    REGISTER_CONVERT_BLIT(IntArgb, Ushort555Rgbx),
68    REGISTER_CONVERT_BLIT_EQUIV(IntRgb, Ushort555Rgbx,
69                                NAME_CONVERT_BLIT(IntArgb, Ushort555Rgbx)),
70    REGISTER_CONVERT_BLIT(ThreeByteBgr, Ushort555Rgbx),
71    REGISTER_CONVERT_BLIT(ByteGray, Ushort555Rgbx),
72    REGISTER_CONVERT_BLIT(ByteIndexed, Ushort555Rgbx),
73    REGISTER_SCALE_BLIT(Ushort555Rgbx, IntArgb),
74    REGISTER_SCALE_BLIT(IntArgb, Ushort555Rgbx),
75    REGISTER_SCALE_BLIT_EQUIV(IntRgb, Ushort555Rgbx,
76                              NAME_SCALE_BLIT(IntArgb, Ushort555Rgbx)),
77    REGISTER_SCALE_BLIT(ThreeByteBgr, Ushort555Rgbx),
78    REGISTER_SCALE_BLIT(ByteGray, Ushort555Rgbx),
79    REGISTER_SCALE_BLIT(ByteIndexed, Ushort555Rgbx),
80    REGISTER_XPAR_CONVERT_BLIT(ByteIndexedBm, Ushort555Rgbx),
81    REGISTER_XPAR_SCALE_BLIT(ByteIndexedBm, Ushort555Rgbx),
82    REGISTER_XPAR_SCALE_BLIT(IntArgbBm, Ushort555Rgbx),
83    REGISTER_XPAR_BLITBG(ByteIndexedBm, Ushort555Rgbx),
84    REGISTER_XOR_BLIT(IntArgb, Ushort555Rgbx),
85    REGISTER_SOLID_DRAWGLYPHLISTAA(Ushort555Rgbx),
86    REGISTER_SOLID_DRAWGLYPHLISTLCD(Ushort555Rgbx),
87};
88
89jboolean RegisterUshort555Rgbx(JNIEnv *env)
90{
91    return RegisterPrimitives(env, Ushort555RgbxPrimitives,
92                              ArraySize(Ushort555RgbxPrimitives));
93}
94
95jint PixelForUshort555Rgbx(SurfaceDataRasInfo *pRasInfo, jint rgb)
96{
97    return IntArgbToUshort555Rgbx(rgb);
98}
99
100DEFINE_CONVERT_BLIT(Ushort555Rgbx, IntArgb, 3ByteRgb)
101
102DEFINE_CONVERT_BLIT(IntArgb, Ushort555Rgbx, 1IntRgb)
103
104DEFINE_CONVERT_BLIT(ThreeByteBgr, Ushort555Rgbx, 3ByteRgb)
105
106DEFINE_CONVERT_BLIT(ByteGray, Ushort555Rgbx, 3ByteRgb)
107
108DEFINE_CONVERT_BLIT_LUT8(ByteIndexed, Ushort555Rgbx, PreProcessLut)
109
110DEFINE_SCALE_BLIT(Ushort555Rgbx, IntArgb, 3ByteRgb)
111
112DEFINE_SCALE_BLIT(IntArgb, Ushort555Rgbx, 1IntRgb)
113
114DEFINE_SCALE_BLIT(ThreeByteBgr, Ushort555Rgbx, 3ByteRgb)
115
116DEFINE_SCALE_BLIT(ByteGray, Ushort555Rgbx, 3ByteRgb)
117
118DEFINE_SCALE_BLIT_LUT8(ByteIndexed, Ushort555Rgbx, PreProcessLut)
119
120DEFINE_XPAR_CONVERT_BLIT_LUT8(ByteIndexedBm, Ushort555Rgbx, PreProcessLut)
121
122DEFINE_XPAR_SCALE_BLIT_LUT8(ByteIndexedBm, Ushort555Rgbx, PreProcessLut)
123
124DEFINE_XPAR_SCALE_BLIT(IntArgbBm, Ushort555Rgbx, 1IntRgb)
125
126DEFINE_XPAR_BLITBG_LUT8(ByteIndexedBm, Ushort555Rgbx, PreProcessLut)
127
128DEFINE_XOR_BLIT(IntArgb, Ushort555Rgbx, AnyShort)
129
130DEFINE_SOLID_DRAWGLYPHLISTAA(Ushort555Rgbx, 3ByteRgb)
131
132DEFINE_SOLID_DRAWGLYPHLISTLCD(Ushort555Rgbx, 3ByteRgb)
133