blob: 4c4cca83b85c4080bd214edac75f55fab7f90d8f [file] [log] [blame]
J. Duke319a3b92007-12-01 00:00:00 +00001/*
2 * Copyright 2000-2001 Sun Microsystems, Inc. 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. Sun designates this
8 * particular file as subject to the "Classpath" exception as provided
9 * by Sun 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 Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
22 * CA 95054 USA or visit www.sun.com if you need additional information or
23 * have any questions.
24 */
25
26#include "ByteBinary1Bit.h"
27
28#include "IntArgb.h"
29
30/*
31 * This file declares, registers, and defines the various graphics
32 * primitive loops to manipulate surfaces of type "ByteBinary1Bit".
33 *
34 * See also LoopMacros.h
35 */
36
37RegisterFunc RegisterByteBinary1Bit;
38
39DECLARE_SOLID_FILLRECT(ByteBinary1Bit);
40DECLARE_SOLID_FILLSPANS(ByteBinary1Bit);
41DECLARE_SOLID_DRAWLINE(ByteBinary1Bit);
42DECLARE_XOR_FILLRECT(ByteBinary1Bit);
43DECLARE_XOR_FILLSPANS(ByteBinary1Bit);
44DECLARE_XOR_DRAWLINE(ByteBinary1Bit);
45DECLARE_SOLID_DRAWGLYPHLIST(ByteBinary1Bit);
46DECLARE_SOLID_DRAWGLYPHLISTAA(ByteBinary1Bit);
47DECLARE_XOR_DRAWGLYPHLIST(ByteBinary1Bit);
48
49DECLARE_CONVERT_BLIT(ByteBinary1Bit, ByteBinary1Bit);
50DECLARE_CONVERT_BLIT(ByteBinary1Bit, IntArgb);
51DECLARE_CONVERT_BLIT(IntArgb, ByteBinary1Bit);
52DECLARE_XOR_BLIT(IntArgb, ByteBinary1Bit);
53
54DECLARE_ALPHA_MASKBLIT(ByteBinary1Bit, IntArgb);
55DECLARE_ALPHA_MASKBLIT(IntArgb, ByteBinary1Bit);
56DECLARE_ALPHA_MASKFILL(ByteBinary1Bit);
57
58NativePrimitive ByteBinary1BitPrimitives[] = {
59 REGISTER_SOLID_FILLRECT(ByteBinary1Bit),
60 REGISTER_SOLID_FILLSPANS(ByteBinary1Bit),
61 REGISTER_SOLID_LINE_PRIMITIVES(ByteBinary1Bit),
62 REGISTER_XOR_FILLRECT(ByteBinary1Bit),
63 REGISTER_XOR_FILLSPANS(ByteBinary1Bit),
64 REGISTER_XOR_LINE_PRIMITIVES(ByteBinary1Bit),
65 REGISTER_SOLID_DRAWGLYPHLIST(ByteBinary1Bit),
66 REGISTER_SOLID_DRAWGLYPHLISTAA(ByteBinary1Bit),
67 REGISTER_XOR_DRAWGLYPHLIST(ByteBinary1Bit),
68
69 REGISTER_CONVERT_BLIT(ByteBinary1Bit, ByteBinary1Bit),
70 REGISTER_CONVERT_BLIT(ByteBinary1Bit, IntArgb),
71 REGISTER_CONVERT_BLIT(IntArgb, ByteBinary1Bit),
72 REGISTER_XOR_BLIT(IntArgb, ByteBinary1Bit),
73
74 REGISTER_ALPHA_MASKBLIT(ByteBinary1Bit, IntArgb),
75 REGISTER_ALPHA_MASKBLIT(IntArgb, ByteBinary1Bit),
76 REGISTER_ALPHA_MASKFILL(ByteBinary1Bit),
77};
78
79jboolean RegisterByteBinary1Bit(JNIEnv *env)
80{
81 return RegisterPrimitives(env, ByteBinary1BitPrimitives,
82 ArraySize(ByteBinary1BitPrimitives));
83}
84
85jint PixelForByteBinary(SurfaceDataRasInfo *pRasInfo, jint rgb)
86{
87 jint r, g, b;
88 ExtractIntDcmComponentsX123(rgb, r, g, b);
89 return SurfaceData_InvColorMap(pRasInfo->invColorTable, r, g, b);
90}
91
92DEFINE_BYTE_BINARY_SOLID_FILLRECT(ByteBinary1Bit)
93
94DEFINE_BYTE_BINARY_SOLID_FILLSPANS(ByteBinary1Bit)
95
96DEFINE_BYTE_BINARY_SOLID_DRAWLINE(ByteBinary1Bit)
97
98DEFINE_BYTE_BINARY_XOR_FILLRECT(ByteBinary1Bit)
99
100DEFINE_BYTE_BINARY_XOR_FILLSPANS(ByteBinary1Bit)
101
102DEFINE_BYTE_BINARY_XOR_DRAWLINE(ByteBinary1Bit)
103
104DEFINE_BYTE_BINARY_SOLID_DRAWGLYPHLIST(ByteBinary1Bit)
105
106DEFINE_BYTE_BINARY_SOLID_DRAWGLYPHLISTAA(ByteBinary1Bit, 3ByteRgb)
107
108DEFINE_BYTE_BINARY_XOR_DRAWGLYPHLIST(ByteBinary1Bit)
109
110DEFINE_BYTE_BINARY_CONVERT_BLIT(ByteBinary1Bit, ByteBinary1Bit, 1IntRgb)
111
112DEFINE_BYTE_BINARY_CONVERT_BLIT(ByteBinary1Bit, IntArgb, 1IntArgb)
113
114DEFINE_BYTE_BINARY_CONVERT_BLIT(IntArgb, ByteBinary1Bit, 1IntRgb)
115
116DEFINE_BYTE_BINARY_XOR_BLIT(IntArgb, ByteBinary1Bit)
117
118DEFINE_BYTE_BINARY_ALPHA_MASKBLIT(ByteBinary1Bit, IntArgb, 4ByteArgb)
119
120DEFINE_BYTE_BINARY_ALPHA_MASKBLIT(IntArgb, ByteBinary1Bit, 4ByteArgb)
121
122DEFINE_BYTE_BINARY_ALPHA_MASKFILL(ByteBinary1Bit, 4ByteArgb)