/*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
* particular file as subject to the "Classpath" exception as provided
* by Oracle in the LICENSE file that accompanied this code.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
#ifndef AnyByteBinary_h_Included
#define AnyByteBinary_h_Included
#include <string.h>
#include "AlphaMacros.h"
#include "GraphicsPrimitiveMgr.h"
#include "LoopMacros.h"
#include "LineUtils.h"
/*
* This file contains macros that are similar to those found in LoopMacros.h
* and AlphaMacros.h, yet have been specialized to manipulate any one of the
* surfaces in the "ByteBinary" family. It also contains generalized versions
* of some macros that are used by the more specific ByteBinary surfaces.
*/
/* REMIND: the ByteBinary store macros should probably do ordered dithering */
TYPE ## BitsPerPixel); \
do { \
} \
} while (0)
do { \
} while (0)
do { \
jint r, g, b; \
ExtractIntDcmComponentsX123(rgb, r, g, b); \
r, g, b); \
} while (0)
do { \
ExtractIntDcmComponentsX123(rgb, r, g, b); \
} while (0)
do { \
ExtractIntDcmComponents1234(argb, a, r, g, b); \
} while (0)
do { \
int r, g, b; \
ExtractIntDcmComponentsX123(rgb, r, g, b); \
} while (0)
r, g, b), \
do { \
} while (0)
do { \
} while (0)
#define ByteBinaryIsPremultiplied 0
COMP_PREFIX ## A, COMP_PREFIX ## R, \
COMP_PREFIX ## G, COMP_PREFIX ## B)
do { \
do { \
srcx1) \
dstx1) \
do { \
BODY; \
} while (--w > 0); \
} while (--HEIGHT > 0); \
} while (0)
do { \
\
if (IsArgbTransparent(srcpixel)) { \
break; \
} \
\
\
} while (0)
NativePrimitive *pPrim, \
{ \
\
0, 0)); \
}
NativePrimitive *pPrim, \
{ \
\
0, xorpixel, \
}
NativePrimitive *pPrim, \
{ \
\
do { \
do { \
} while (--w > 0); \
} while (--height > 0); \
}
{ \
\
x, DST ## PixelStride, \
y, scan); \
do { \
do { \
} while (--relx > 0); \
} while (--h > 0); \
} \
}
NativePrimitive *pPrim, \
{ \
\
if (errmajor == 0) { \
do { \
} while (--steps > 0); \
} else { \
do { \
if (error < 0) { \
} else { \
} \
} while (--steps > 0); \
} \
}
NativePrimitive *pPrim, \
{ \
\
do { \
do { \
} while (--w > 0); \
} while (--height > 0); \
}
NativePrimitive *pPrim, \
{ \
\
x, DST ## PixelStride, \
y, scan); \
do { \
do { \
} while (--relx > 0); \
} while (--h > 0); \
} \
}
NativePrimitive *pPrim, \
{ \
\
\
if (errmajor == 0) { \
do { \
} while (--steps > 0); \
} else { \
do { \
if (error < 0) { \
} else { \
} \
} while (--steps > 0); \
} \
}
NativePrimitive *pPrim, \
{ \
jint glyphCounter; \
\
glyphs, glyphCounter, continue) \
\
do { \
jint x = 0; \
do { \
if (pixels[x]) { \
} \
} while (++x < width); \
} while (--height > 0); \
} \
}
/*
* REMIND: we shouldn't be attempting to do antialiased text for the
* ByteBinary surfaces in the first place
*/
NativePrimitive *pPrim, \
{ \
jint glyphCounter; \
\
\
\
glyphs, glyphCounter, continue) \
\
do { \
int x = 0; \
do { \
} while (++x < width); \
} while (--height > 0); \
} \
}
NativePrimitive *pPrim, \
{ \
jint glyphCounter; \
\
glyphs, glyphCounter, continue) \
\
do { \
jint x = 0; \
do { \
if (pixels[x]) { \
} \
} while (++x < width); \
} while (--height > 0); \
} \
}
NativePrimitive *pPrim, \
{ \
\
SrcOp); \
DstOp); \
\
if (pMask) { \
} \
\
do { \
do { \
\
if (pMask) { \
if (!pathA) { \
continue; \
} \
} \
if (loadsrc) { \
} \
if (loaddst) { \
} \
} \
if (srcF) { \
if (!(SRC ## IsPremultiplied)) { \
} else { \
} \
if (srcF) { \
/* assert(loadsrc); */ \
} \
} else { \
} \
} else { \
continue; \
} \
resA = 0; \
} \
if (dstF) { \
if (!(DST ## IsPremultiplied)) { \
} \
if (dstF) { \
/* assert(loaddst); */ \
} \
} \
} \
{ \
} \
0, res); \
} while (--w > 0); \
if (pMask) { \
} \
} while (--height > 0); \
}
void NAME_ALPHA_MASKFILL(TYPE) \
(void *rasBase, \
NativePrimitive *pPrim, \
{ \
\
} \
\
SrcOp); \
DstOp); \
\
\
if (pMask) { \
} \
\
do { \
do { \
\
if (pMask) { \
if (!pathA) { \
continue; \
} \
} \
if (loaddst) { \
} \
} \
if (srcF) { \
} else { \
} \
} else { \
continue; \
} \
resA = 0; \
} \
if (dstF) { \
if (!(TYPE ## IsPremultiplied)) { \
} \
if (dstF) { \
/* assert(loaddst); */ \
} \
} \
} \
{ \
} \
0, res); \
} while (--w > 0); \
if (pMask) { \
} \
} while (--height > 0); \
}
/*
* The macros defined above use the following macro definitions supplied
* for the various ByteBinary-specific surface types to manipulate pixel data.
*
* In the macro names in the following definitions, the string <stype>
* is used as a place holder for the SurfaceType name (eg. ByteBinary2Bit).
* The macros above access these type specific macros using the ANSI
* CPP token concatenation operator "##".
*
* Declare<stype>InitialLoadVars Declare and initialize the variables used
* InitialLoad<stype> Store the current byte, fetch the next
* byte, and reset the bit offset
* ShiftBits<stype> Advance to the next pixel by adjusting
* the bit offset (1, 2, or 4 bits)
* FinalStore<stype> Store the current byte
* CurrentPixel<stype> Represents the current pixel by shifting
* the value with the current bit offset and
* then masking the value to either 1, 2, or
* 4 bits
*/
#endif /* AnyByteBinary_h_Included */