blob: e695ac846ee67067949c2de8440b7fc881937d8e [file] [log] [blame]
J. Duke319a3b92007-12-01 00:00:00 +00001/*
2 * Copyright 2000-2004 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#ifndef IntRgbx_h_Included
27#define IntRgbx_h_Included
28
29#include "IntDcm.h"
30
31/*
32 * This file contains macro and type definitions used by the macros in
33 * LoopMacros.h to manipulate a surface of type "IntRgbx".
34 */
35
36typedef jint IntRgbxPixelType;
37typedef jint IntRgbxDataType;
38
39#define IntRgbxPixelStride 4
40
41#define DeclareIntRgbxLoadVars(PREFIX)
42#define DeclareIntRgbxStoreVars(PREFIX)
43#define SetIntRgbxStoreVarsYPos(PREFIX, pRasInfo, y)
44#define SetIntRgbxStoreVarsXPos(PREFIX, pRasInfo, x)
45#define InitIntRgbxLoadVars(PREFIX, pRasInfo)
46#define InitIntRgbxStoreVarsY(PREFIX, pRasInfo)
47#define InitIntRgbxStoreVarsX(PREFIX, pRasInfo)
48#define NextIntRgbxStoreVarsX(PREFIX)
49#define NextIntRgbxStoreVarsY(PREFIX)
50
51#define IntRgbxXparLutEntry 1
52#define IntRgbxIsXparLutEntry(pix) ((pix & 1) != 0)
53#define StoreIntRgbxNonXparFromArgb StoreIntRgbxFromArgb
54
55
56#define IntRgbxPixelFromArgb(pixel, rgb, pRasInfo) \
57 (pixel) = (rgb << 8)
58
59#define StoreIntRgbxPixel(pRas, x, pixel) \
60 (pRas)[x] = (pixel)
61
62#define DeclareIntRgbxPixelData(PREFIX)
63
64#define ExtractIntRgbxPixelData(PIXEL, PREFIX)
65
66#define StoreIntRgbxPixelData(pPix, x, pixel, PREFIX) \
67 (pPix)[x] = (pixel)
68
69
70#define LoadIntRgbxTo1IntRgb(pRas, PREFIX, x, rgb) \
71 (rgb) = ((pRas)[x] >> 8)
72
73#define LoadIntRgbxTo1IntArgb(pRas, PREFIX, x, argb) \
74 (argb) = 0xff000000 | ((pRas)[x] >> 8)
75
76#define LoadIntRgbxTo3ByteRgb(pRas, PREFIX, x, r, g, b) \
77 do { \
78 jint pixel = (pRas)[x]; \
79 ExtractIntDcmComponents123X(pixel, r, g, b); \
80 } while (0)
81
82#define LoadIntRgbxTo4ByteArgb(pRas, PREFIX, x, a, r, g, b) \
83 do { \
84 LoadIntRgbxTo3ByteRgb(pRas, PREFIX, x, r, g, b); \
85 (a) = 0xff; \
86 } while (0)
87
88#define StoreIntRgbxFrom1IntRgb(pRas, PREFIX, x, rgb) \
89 (pRas)[x] = ((rgb) << 8)
90
91#define StoreIntRgbxFrom1IntArgb(pRas, PREFIX, x, argb) \
92 (pRas)[x] = ((argb) << 8)
93
94#define StoreIntRgbxFrom3ByteRgb(pRas, PREFIX, x, r, g, b) \
95 (pRas)[x] = ComposeIntDcmComponents123X(r, g, b)
96
97#define StoreIntRgbxFrom4ByteArgb(pRas, PREFIX, x, a, r, g, b) \
98 StoreIntRgbxFrom3ByteRgb(pRas, PREFIX, x, r, g, b)
99
100#define CopyIntRgbxToIntArgbPre(pRGB, i, PREFIX, pRow, x) \
101 (pRGB)[i] = (((pRow)[x] >> 8) | 0xff000000)
102
103
104#define DeclareIntRgbxAlphaLoadData(PREFIX)
105
106#define InitIntRgbxAlphaLoadData(PREFIX, pRasInfo)
107
108#define LoadAlphaFromIntRgbxFor4ByteArgb(pRas, PREFIX, COMP_PREFIX) \
109 COMP_PREFIX ## A = 0xff
110
111#define Postload4ByteArgbFromIntRgbx(pRas, PREFIX, COMP_PREFIX) \
112 LoadIntRgbxTo3ByteRgb(pRas, PREFIX, 0, COMP_PREFIX ## R, \
113 COMP_PREFIX ## G, COMP_PREFIX ## B)
114
115#define StoreIntRgbxFrom4ByteArgbComps(pRas, PREFIX, x, COMP_PREFIX) \
116 StoreIntRgbxFrom4ByteArgb(pRas, PREFIX, x, \
117 COMP_PREFIX ## A, COMP_PREFIX ## R, \
118 COMP_PREFIX ## G, COMP_PREFIX ## B)
119
120#define IntRgbxIsPremultiplied 0
121
122#define DeclareIntRgbxBlendFillVars(PREFIX)
123
124#define ClearIntRgbxBlendFillVars(PREFIX, argb) \
125 argb = 0
126
127#define InitIntRgbxBlendFillVarsNonPre(PREFIX, argb, COMP_PREFIX)
128
129#define InitIntRgbxBlendFillVarsPre(PREFIX, argb, COMP_PREFIX)
130
131#define StoreIntRgbxBlendFill(pRas, PREFIX, x, argb, COMP_PREFIX) \
132 (pRas)[x] = (argb << 8)
133
134#endif /* IntRgbx_h_Included */