0N/A/*
3261N/A * Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved.
0N/A * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
0N/A *
0N/A * This code is free software; you can redistribute it and/or modify it
0N/A * under the terms of the GNU General Public License version 2 only, as
2362N/A * published by the Free Software Foundation. Oracle designates this
0N/A * particular file as subject to the "Classpath" exception as provided
2362N/A * by Oracle in the LICENSE file that accompanied this code.
0N/A *
0N/A * This code is distributed in the hope that it will be useful, but WITHOUT
0N/A * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
0N/A * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
0N/A * version 2 for more details (a copy is included in the LICENSE file that
0N/A * accompanied this code).
0N/A *
0N/A * You should have received a copy of the GNU General Public License version
0N/A * 2 along with this work; if not, write to the Free Software Foundation,
0N/A * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
0N/A *
2362N/A * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
2362N/A * or visit www.oracle.com if you need additional information or have any
2362N/A * questions.
0N/A */
0N/A
0N/A#ifndef LoopMacros_h_Included
0N/A#define LoopMacros_h_Included
0N/A
0N/A#include "j2d_md.h"
0N/A
0N/A#include "LineUtils.h"
0N/A
0N/A/*
0N/A * This file contains macros to aid in defining native graphics
0N/A * primitive functions.
0N/A *
0N/A * A number of useful building block macros are defined, but the
0N/A * vast majority of primitives are defined completely by a single
0N/A * macro expansion which uses macro names in the argument list to
0N/A * choose not only from a small number of strategies but also to
0N/A * choose macro packages specific to the source and destination
0N/A * pixel formats - greatly simplifying all aspects of creating
0N/A * a new loop.
0N/A *
0N/A * See the following macros which define entire functions with
0N/A * just one or two surface names and sometimes a strategy name:
0N/A * DEFINE_ISOCOPY_BLIT(ANYTYPE)
0N/A * DEFINE_ISOXOR_BLIT(ANYTYPE)
0N/A * DEFINE_CONVERT_BLIT(SRC, DST, CONV_METHOD)
0N/A * DEFINE_CONVERT_BLIT_LUT(SRC, DST, LUT_STRATEGY)
0N/A * DEFINE_XPAR_CONVERT_BLIT_LUT(SRC, DST, LUT_STRATEGY)
0N/A * DEFINE_XPAR_BLITBG_LUT(SRC, DST, LUT_STRATEGY)
0N/A * DEFINE_SOLID_FILLRECT(DST)
0N/A * DEFINE_SOLID_FILLSPANS(DST)
0N/A * DEFINE_SOLID_DRAWLINE(DST)
0N/A *
0N/A * Many of these loop macros take the name of a SurfaceType as
0N/A * an argument and use the ANSI CPP token concatenation operator
0N/A * "##" to reference macro and type definitions that are specific
0N/A * to that type of surface.
0N/A *
0N/A * A description of the various surface specific macro utilities
0N/A * that are used by these loop macros appears at the end of the
0N/A * file. The definitions of these surface-specific macros will
0N/A * usually appear in a header file named after the SurfaceType
0N/A * name (i.e. IntArgb.h, ByteGray.h, etc.).
0N/A */
0N/A
0N/A/*
0N/A * This loop is the standard "while (--height > 0)" loop used by
0N/A * some of the blits below.
0N/A */
0N/A#define BlitLoopHeight(SRCTYPE, SRCPTR, SRCBASE, SRCINFO, \
0N/A DSTTYPE, DSTPTR, DSTBASE, DSTINFO, DSTPREFIX, \
0N/A HEIGHT, BODY) \
0N/A do { \
0N/A SRCTYPE ## DataType *SRCPTR = (SRCTYPE ## DataType *) (SRCBASE); \
0N/A DSTTYPE ## DataType *DSTPTR = (DSTTYPE ## DataType *) (DSTBASE); \
0N/A jint srcScan = (SRCINFO)->scanStride; \
0N/A jint dstScan = (DSTINFO)->scanStride; \
0N/A Init ## DSTTYPE ## StoreVarsY(DSTPREFIX, DSTINFO); \
0N/A do { \
0N/A BODY; \
0N/A SRCPTR = PtrAddBytes(SRCPTR, srcScan); \
0N/A DSTPTR = PtrAddBytes(DSTPTR, dstScan); \
0N/A Next ## DSTTYPE ## StoreVarsY(DSTPREFIX); \
0N/A } while (--HEIGHT > 0); \
0N/A } while (0)
0N/A
0N/A/*
0N/A * This loop is the standard nested "while (--width/height > 0)" loop
0N/A * used by most of the basic blits below.
0N/A */
0N/A#define BlitLoopWidthHeight(SRCTYPE, SRCPTR, SRCBASE, SRCINFO, \
0N/A DSTTYPE, DSTPTR, DSTBASE, DSTINFO, DSTPREFIX, \
0N/A WIDTH, HEIGHT, BODY) \
0N/A do { \
0N/A SRCTYPE ## DataType *SRCPTR = (SRCTYPE ## DataType *) (SRCBASE); \
0N/A DSTTYPE ## DataType *DSTPTR = (DSTTYPE ## DataType *) (DSTBASE); \
0N/A jint srcScan = (SRCINFO)->scanStride; \
0N/A jint dstScan = (DSTINFO)->scanStride; \
0N/A Init ## DSTTYPE ## StoreVarsY(DSTPREFIX, DSTINFO); \
0N/A srcScan -= (WIDTH) * SRCTYPE ## PixelStride; \
0N/A dstScan -= (WIDTH) * DSTTYPE ## PixelStride; \
0N/A do { \
0N/A juint w = WIDTH; \
0N/A Init ## DSTTYPE ## StoreVarsX(DSTPREFIX, DSTINFO); \
0N/A do { \
0N/A BODY; \
0N/A SRCPTR = PtrAddBytes(SRCPTR, SRCTYPE ## PixelStride); \
0N/A DSTPTR = PtrAddBytes(DSTPTR, DSTTYPE ## PixelStride); \
0N/A Next ## DSTTYPE ## StoreVarsX(DSTPREFIX); \
0N/A } while (--w > 0); \
0N/A SRCPTR = PtrAddBytes(SRCPTR, srcScan); \
0N/A DSTPTR = PtrAddBytes(DSTPTR, dstScan); \
0N/A Next ## DSTTYPE ## StoreVarsY(DSTPREFIX); \
0N/A } while (--HEIGHT > 0); \
0N/A } while (0)
0N/A
0N/A/*
0N/A * This loop is the standard nested "while (--width/height > 0)" loop
0N/A * used by most of the scaled blits below. It calculates the proper
0N/A * X source variable
0N/A */
0N/A#define BlitLoopScaleWidthHeight(SRCTYPE, SRCPTR, SRCBASE, SRCINFO, \
0N/A DSTTYPE, DSTPTR, DSTBASE, DSTINFO, DSTPREFIX, \
0N/A XVAR, WIDTH, HEIGHT, \
0N/A SXLOC, SYLOC, SXINC, SYINC, SHIFT, \
0N/A BODY) \
0N/A do { \
0N/A SRCTYPE ## DataType *SRCPTR; \
0N/A DSTTYPE ## DataType *DSTPTR = (DSTTYPE ## DataType *) (DSTBASE); \
0N/A jint srcScan = (SRCINFO)->scanStride; \
0N/A jint dstScan = (DSTINFO)->scanStride; \
0N/A Init ## DSTTYPE ## StoreVarsY(DSTPREFIX, DSTINFO); \
0N/A dstScan -= (WIDTH) * DSTTYPE ## PixelStride; \
0N/A do { \
0N/A juint w = WIDTH; \
0N/A jint tmpsxloc = SXLOC; \
0N/A SRCPTR = PtrAddBytes(SRCBASE, ((SYLOC >> SHIFT) * srcScan)); \
0N/A Init ## DSTTYPE ## StoreVarsX(DSTPREFIX, DSTINFO); \
0N/A do { \
0N/A jint XVAR = (tmpsxloc >> SHIFT); \
0N/A BODY; \
0N/A DSTPTR = PtrAddBytes(DSTPTR, DSTTYPE ## PixelStride); \
0N/A Next ## DSTTYPE ## StoreVarsX(DSTPREFIX); \
0N/A tmpsxloc += SXINC; \
0N/A } while (--w > 0); \
0N/A DSTPTR = PtrAddBytes(DSTPTR, dstScan); \
0N/A Next ## DSTTYPE ## StoreVarsY(DSTPREFIX); \
0N/A SYLOC += SYINC; \
0N/A } while (--HEIGHT > 0); \
0N/A } while (0)
0N/A
0N/A/*
0N/A * This loop is a standard horizontal loop iterating with a "relative"
0N/A * X coordinate (0 <= X < WIDTH) used primarily by the LUT conversion
0N/A * preprocessing loops below.
0N/A */
0N/A#define BlitLoopXRel(DSTTYPE, DSTINFO, DSTPREFIX, \
0N/A XVAR, WIDTH, BODY) \
0N/A do { \
0N/A juint XVAR = 0; \
0N/A Init ## DSTTYPE ## StoreVarsX(DSTPREFIX, DSTINFO); \
0N/A do { \
0N/A BODY; \
0N/A Next ## DSTTYPE ## StoreVarsX(DSTPREFIX); \
0N/A } while (++XVAR < WIDTH); \
0N/A } while (0)
0N/A
0N/A/*
0N/A * This is a "conversion strategy" for use with the DEFINE_CONVERT_BLIT
0N/A * macros. It converts from the source pixel format to the destination
0N/A * via an intermediate "jint rgb" format.
0N/A */
0N/A#define ConvertVia1IntRgb(SRCPTR, SRCTYPE, SRCPREFIX, \
0N/A DSTPTR, DSTTYPE, DSTPREFIX, \
0N/A SXVAR, DXVAR) \
0N/A do { \
0N/A int rgb; \
0N/A Load ## SRCTYPE ## To1IntRgb(SRCPTR, SRCPREFIX, SXVAR, rgb); \
0N/A Store ## DSTTYPE ## From1IntRgb(DSTPTR, DSTPREFIX, DXVAR, rgb); \
0N/A } while (0)
0N/A
0N/A/*
0N/A * This is a "conversion strategy" for use with the DEFINE_CONVERT_BLIT
0N/A * macros. It converts from the source pixel format to the destination
0N/A * via an intermediate "jint argb" format.
0N/A */
0N/A#define ConvertVia1IntArgb(SRCPTR, SRCTYPE, SRCPREFIX, \
0N/A DSTPTR, DSTTYPE, DSTPREFIX, \
0N/A SXVAR, DXVAR) \
0N/A do { \
0N/A int argb; \
0N/A Load ## SRCTYPE ## To1IntArgb(SRCPTR, SRCPREFIX, SXVAR, argb); \
0N/A Store ## DSTTYPE ## From1IntArgb(DSTPTR, DSTPREFIX, DXVAR, argb); \
0N/A } while (0)
0N/A
0N/A/*
0N/A * This is a "conversion strategy" for use with the DEFINE_CONVERT_BLIT
0N/A * macros. It converts from the source pixel format to the destination
0N/A * via an intermediate set of 3 component variables "jint r, g, b".
0N/A */
0N/A#define ConvertVia3ByteRgb(SRCPTR, SRCTYPE, SRCPREFIX, \
0N/A DSTPTR, DSTTYPE, DSTPREFIX, \
0N/A SXVAR, DXVAR) \
0N/A do { \
0N/A jint r, g, b; \
0N/A Load ## SRCTYPE ## To3ByteRgb(SRCPTR, SRCPREFIX, SXVAR, r, g, b); \
0N/A Store ## DSTTYPE ## From3ByteRgb(DSTPTR, DSTPREFIX, DXVAR, r, g, b); \
0N/A } while (0)
0N/A
0N/A/*
0N/A * This is a "conversion strategy" for use with the DEFINE_CONVERT_BLIT
0N/A * macros. It converts from the source pixel format to the destination
0N/A * via an intermediate set of 4 component variables "jint a, r, g, b".
0N/A */
0N/A#define ConvertVia4ByteArgb(SRCPTR, SRCTYPE, SRCPREFIX, \
0N/A DSTPTR, DSTTYPE, DSTPREFIX, \
0N/A SXVAR, DXVAR) \
0N/A do { \
0N/A jint a, r, g, b; \
0N/A Load ## SRCTYPE ## To4ByteArgb(SRCPTR, SRCPREFIX, SXVAR, a, r, g, b); \
0N/A Store ## DSTTYPE ## From4ByteArgb(DSTPTR, DSTPREFIX, DXVAR, \
0N/A a, r, g, b); \
0N/A } while (0)
0N/A
0N/A/*
0N/A * This is a "conversion strategy" for use with the DEFINE_CONVERT_BLIT
0N/A * macros. It converts from the source pixel format to the destination
0N/A * via an intermediate "jint gray" format.
0N/A */
0N/A#define ConvertVia1ByteGray(SRCPTR, SRCTYPE, SRCPREFIX, \
0N/A DSTPTR, DSTTYPE, DSTPREFIX, \
0N/A SXVAR, DXVAR) \
0N/A do { \
0N/A jint gray; \
0N/A Load ## SRCTYPE ## To1ByteGray(SRCPTR, SRCPREFIX, SXVAR, gray); \
0N/A Store ## DSTTYPE ## From1ByteGray(DSTPTR, DSTPREFIX, DXVAR, gray); \
0N/A } while (0)
0N/A
0N/A/*
0N/A * This is a "conversion strategy" for use with the DEFINE_XPAR_CONVERT_BLIT
0N/A * macros. It converts from the source pixel format to the destination
0N/A * via the specified intermediate format while testing for transparent pixels.
0N/A */
0N/A#define ConvertXparVia1IntRgb(SRCPTR, SRCTYPE, SRCPREFIX, \
0N/A DSTPTR, DSTTYPE, DSTPREFIX, \
0N/A SXVAR, DXVAR) \
0N/A do { \
0N/A Declare ## SRCTYPE ## Data(XparLoad); \
0N/A Load ## SRCTYPE ## Data(SRCPTR, SRCPREFIX, SXVAR, XparLoad); \
0N/A if (! (Is ## SRCTYPE ## DataTransparent(XparLoad))) { \
0N/A int rgb; \
0N/A Convert ## SRCTYPE ## DataTo1IntRgb(XparLoad, rgb); \
0N/A Store ## DSTTYPE ## From1IntRgb(DSTPTR, DSTPREFIX, DXVAR, rgb); \
0N/A } \
0N/A } while (0)
0N/A
0N/A/*
0N/A * This is a "conversion strategy" for use with the DEFINE_XPAR_BLITBG
0N/A * macros. It converts from the source pixel format to the destination
0N/A * via the specified intermediate format while substituting the specified
0N/A * bgcolor for transparent pixels.
0N/A */
0N/A#define BgCopyXparVia1IntRgb(SRCPTR, SRCTYPE, SRCPREFIX, \
0N/A DSTPTR, DSTTYPE, DSTPREFIX, \
0N/A SXVAR, DXVAR, BGPIXEL, BGPREFIX) \
0N/A do { \
0N/A Declare ## SRCTYPE ## Data(XparLoad); \
0N/A Load ## SRCTYPE ## Data(SRCPTR, SRCPREFIX, SXVAR, XparLoad); \
0N/A if (Is ## SRCTYPE ## DataTransparent(XparLoad)) { \
0N/A Store ## DSTTYPE ## PixelData(DSTPTR, DXVAR, BGPIXEL, BGPREFIX); \
0N/A } else { \
0N/A int rgb; \
0N/A Convert ## SRCTYPE ## DataTo1IntRgb(XparLoad, rgb); \
0N/A Store ## DSTTYPE ## From1IntRgb(DSTPTR, DSTPREFIX, DXVAR, rgb); \
0N/A } \
0N/A } while (0)
0N/A
0N/A/*
0N/A * This macro determines whether or not the given pixel is considered
0N/A * "transparent" for XOR purposes. The ARGB pixel is considered
0N/A * "transparent" if the alpha value is < 0.5.
0N/A */
0N/A#define IsArgbTransparent(pixel) \
0N/A (((jint) pixel) >= 0)
0N/A
0N/A/*
0N/A * This is a "conversion strategy" for use with the DEFINE_XOR_BLIT macro. It
0N/A * converts the source pixel to an intermediate ARGB value and then converts
0N/A * the ARGB value to the pixel representation for the destination surface. It
0N/A * then XORs the srcpixel, xorpixel, and destination pixel together and stores
0N/A * the result in the destination surface.
0N/A */
0N/A#define XorVia1IntArgb(SRCPTR, SRCTYPE, SRCPREFIX, \
0N/A DSTPTR, DSTTYPE, DSTANYTYPE, \
0N/A XVAR, XORPIXEL, XORPREFIX, \
0N/A MASK, MASKPREFIX, DSTINFOPTR) \
0N/A do { \
0N/A jint srcpixel; \
0N/A Declare ## DSTANYTYPE ## PixelData(pix) \
0N/A Load ## SRCTYPE ## To1IntArgb(SRCPTR, SRCPREFIX, XVAR, srcpixel); \
0N/A \
0N/A if (IsArgbTransparent(srcpixel)) { \
0N/A break; \
0N/A } \
0N/A \
0N/A DSTTYPE ## PixelFromArgb(srcpixel, srcpixel, DSTINFOPTR); \
0N/A \
0N/A Extract ## DSTANYTYPE ## PixelData(srcpixel, pix); \
0N/A Xor ## DSTANYTYPE ## PixelData(srcpixel, pix, DSTPTR, XVAR, \
0N/A XORPIXEL, XORPREFIX, \
0N/A MASK, MASKPREFIX); \
0N/A } while (0)
0N/A
0N/A/*
0N/A * "LUT_STRATEGY" macro sets.
0N/A *
0N/A * There are 2 major strategies for dealing with luts and 3
0N/A * implementations of those strategies.
0N/A *
0N/A * The 2 strategies are "PreProcessLut" and "ConvertOnTheFly".
0N/A *
0N/A * For the "PreProcessLut" strategy, the raw ARGB lut supplied
0N/A * by the SD_LOCK_LUT flag is converted at the beginning into a
0N/A * form that is more suited for storing into the destination
0N/A * pixel format. The inner loop consists of a series of table
0N/A * lookups with very little conversion from that intermediate
0N/A * pixel format.
0N/A *
0N/A * For the "ConvertOnTheFly" strategy, the raw ARGB values are
0N/A * converted on a pixel by pixel basis in the inner loop itself.
0N/A * This strategy is most useful for formats which tend to use
0N/A * the ARGB color format as their pixel format also.
0N/A *
0N/A * Each of these strategies has 3 implementations which are needed
0N/A * for the special cases:
0N/A * - straight conversion (invoked from DEFINE_CONVERT_BLIT_LUT)
0N/A * - straight conversion with transparency handling (invoked from
0N/A * DEFINE_XPAR_CONVERT_BLIT_LUT)
0N/A * - straight conversion with a bgcolor for the transparent pixels
0N/A * (invoked from DEFINE_XPAR_BLITBG_LUT)
0N/A */
0N/A
0N/A/***
0N/A * Start of PreProcessLut strategy macros, CONVERT_BLIT implementation.
0N/A */
0N/A#define LutSize(TYPE) \
0N/A (1 << TYPE ## BitsPerPixel)
0N/A
0N/A#define DeclarePreProcessLutLut(SRC, DST, PIXLUT) \
0N/A DST ## PixelType PIXLUT[LutSize(SRC)];
0N/A
0N/A#define SetupPreProcessLutLut(SRC, DST, PIXLUT, SRCINFO, DSTINFO) \
0N/A do { \
0N/A jint *srcLut = (SRCINFO)->lutBase; \
0N/A juint lutSize = (SRCINFO)->lutSize; \
0N/A Declare ## DST ## StoreVars(PreLut) \
0N/A Init ## DST ## StoreVarsY(PreLut, DSTINFO); \
0N/A if (lutSize >= LutSize(SRC)) { \
0N/A lutSize = LutSize(SRC); \
0N/A } else { \
0N/A DST ## PixelType *pPIXLUT = &PIXLUT[lutSize]; \
0N/A do { \
0N/A Store ## DST ## From1IntArgb(pPIXLUT, PreLut, 0, 0); \
0N/A } while (++pPIXLUT < &PIXLUT[LutSize(SRC)]); \
0N/A } \
0N/A BlitLoopXRel(DST, DSTINFO, PreLut, x, lutSize, \
0N/A do { \
0N/A jint argb = srcLut[x]; \
0N/A Store ## DST ## From1IntArgb(PIXLUT, PreLut, x, argb); \
0N/A } while (0)); \
0N/A } while (0)
0N/A
0N/A#define BodyPreProcessLutLut(SRCPTR, SRCTYPE, PIXLUT, \
0N/A DSTPTR, DSTTYPE, DSTPREFIX, \
0N/A SXVAR, DXVAR) \
0N/A DSTPTR[DXVAR] = PIXLUT[SRCPTR[SXVAR]]
0N/A
0N/A/*
0N/A * End of PreProcessLut/CONVERT_BLIT macros.
0N/A ***/
0N/A
0N/A/***
0N/A * Start of ConvertOnTheFly strategy macros, CONVERT_BLIT implementation.
0N/A */
0N/A#define DeclareConvertOnTheFlyLut(SRC, DST, PIXLUT) \
0N/A Declare ## SRC ## LoadVars(PIXLUT)
0N/A
0N/A#define SetupConvertOnTheFlyLut(SRC, DST, PIXLUT, SRCINFO, DSTINFO) \
0N/A Init ## SRC ## LoadVars(PIXLUT, SRCINFO)
0N/A
0N/A#define BodyConvertOnTheFlyLut(SRCPTR, SRCTYPE, PIXLUT, \
0N/A DSTPTR, DSTTYPE, DSTPREFIX, \
0N/A SXVAR, DXVAR) \
0N/A ConvertVia1IntArgb(SRCPTR, SRCTYPE, PIXLUT, \
0N/A DSTPTR, DSTTYPE, DSTPREFIX, \
0N/A SXVAR, DXVAR)
0N/A
0N/A/*
0N/A * End of ConvertOnTheFly/CONVERT_BLIT macros.
0N/A ***/
0N/A
0N/A/***
0N/A * Start of PreProcessLut strategy macros, XPAR_CONVERT_BLIT implementation.
0N/A */
0N/A#define DeclarePreProcessLutXparLut(SRC, DST, PIXLUT) \
0N/A jint PIXLUT[LutSize(SRC)];
0N/A
0N/A#define SetupPreProcessLutXparLut(SRC, DST, PIXLUT, SRCINFO, DSTINFO) \
0N/A do { \
0N/A jint *srcLut = (SRCINFO)->lutBase; \
0N/A juint lutSize = (SRCINFO)->lutSize; \
0N/A Declare ## DST ## StoreVars(PreLut) \
0N/A Init ## DST ## StoreVarsY(PreLut, DSTINFO); \
0N/A if (lutSize >= LutSize(SRC)) { \
0N/A lutSize = LutSize(SRC); \
0N/A } else { \
0N/A jint *pPIXLUT = &PIXLUT[lutSize]; \
0N/A do { \
0N/A pPIXLUT[0] = DST ## XparLutEntry; \
0N/A } while (++pPIXLUT < &PIXLUT[LutSize(SRC)]); \
0N/A } \
0N/A BlitLoopXRel(DST, DSTINFO, PreLut, x, lutSize, \
0N/A do { \
0N/A jint argb = srcLut[x]; \
0N/A if (argb < 0) { \
0N/A Store ## DST ## NonXparFromArgb \
0N/A (PIXLUT, PreLut, x, argb); \
0N/A } else { \
0N/A PIXLUT[x] = DST ## XparLutEntry; \
0N/A } \
0N/A } while (0)); \
0N/A } while (0)
0N/A
0N/A#define BodyPreProcessLutXparLut(SRCPTR, SRCTYPE, PIXLUT, \
0N/A DSTPTR, DSTTYPE, DSTPREFIX, \
0N/A SXVAR, DXVAR) \
0N/A do { \
0N/A jint pix = PIXLUT[SRCPTR[SXVAR]]; \
0N/A if (! DSTTYPE ## IsXparLutEntry(pix)) { \
0N/A DSTPTR[DXVAR] = (DSTTYPE ## PixelType) pix; \
0N/A } \
0N/A } while (0)
0N/A
0N/A/*
0N/A * End of PreProcessLut/XPAR_CONVERT_BLIT macros.
0N/A ***/
0N/A
0N/A/***
0N/A * Start of ConvertOnTheFly strategy macros, CONVERT_BLIT implementation.
0N/A */
0N/A#define DeclareConvertOnTheFlyXparLut(SRC, DST, PIXLUT) \
0N/A Declare ## SRC ## LoadVars(PIXLUT)
0N/A
0N/A#define SetupConvertOnTheFlyXparLut(SRC, DST, PIXLUT, SRCINFO, DSTINFO) \
0N/A Init ## SRC ## LoadVars(PIXLUT, SRCINFO)
0N/A
0N/A#define BodyConvertOnTheFlyXparLut(SRCPTR, SRCTYPE, PIXLUT, \
0N/A DSTPTR, DSTTYPE, DSTPREFIX, \
0N/A SXVAR, DXVAR) \
0N/A do { \
0N/A jint argb; \
0N/A Load ## SRCTYPE ## To1IntArgb(SRCPTR, PIXLUT, SXVAR, argb); \
0N/A if (argb < 0) { \
0N/A Store ## DSTTYPE ## From1IntArgb(DSTPTR, DSTPREFIX, DXVAR, argb); \
0N/A } \
0N/A } while (0)
0N/A
0N/A/*
0N/A * End of ConvertOnTheFly/CONVERT_BLIT macros.
0N/A ***/
0N/A
0N/A/***
0N/A * Start of PreProcessLut strategy macros, BLITBG implementation.
0N/A */
0N/A#define DeclarePreProcessLutBgLut(SRC, DST, PIXLUT) \
0N/A jint PIXLUT[LutSize(SRC)];
0N/A
0N/A#define SetupPreProcessLutBgLut(SRC, DST, PIXLUT, SRCINFO, DSTINFO, BGPIXEL) \
0N/A do { \
0N/A jint *srcLut = (SRCINFO)->lutBase; \
0N/A juint lutSize = (SRCINFO)->lutSize; \
0N/A Declare ## DST ## StoreVars(PreLut) \
0N/A Init ## DST ## StoreVarsY(PreLut, DSTINFO); \
0N/A if (lutSize >= LutSize(SRC)) { \
0N/A lutSize = LutSize(SRC); \
0N/A } else { \
0N/A jint *pPIXLUT = &PIXLUT[lutSize]; \
0N/A do { \
0N/A pPIXLUT[0] = BGPIXEL; \
0N/A } while (++pPIXLUT < &PIXLUT[LutSize(SRC)]); \
0N/A } \
0N/A BlitLoopXRel(DST, DSTINFO, PreLut, x, lutSize, \
0N/A do { \
0N/A jint argb = srcLut[x]; \
0N/A if (argb < 0) { \
0N/A Store ## DST ## From1IntArgb(PIXLUT, PreLut, \
0N/A x, argb); \
0N/A } else { \
0N/A PIXLUT[x] = BGPIXEL; \
0N/A } \
0N/A } while (0)); \
0N/A } while (0)
0N/A
0N/A#define BodyPreProcessLutBgLut(SRCPTR, SRCTYPE, PIXLUT, \
0N/A DSTPTR, DSTTYPE, DSTPREFIX, \
0N/A SXVAR, DXVAR, BGPIXEL) \
0N/A do { \
0N/A jint pix = PIXLUT[SRCPTR[SXVAR]]; \
0N/A Store ## DSTTYPE ## Pixel(DSTPTR, DXVAR, pix); \
0N/A } while (0)
0N/A
0N/A/*
0N/A * End of PreProcessLut/BLITBG implementation.
0N/A ***/
0N/A
0N/A/***
0N/A * Start of ConvertOnTheFly strategy macros, BLITBG implementation.
0N/A */
0N/A#define DeclareConvertOnTheFlyBgLut(SRC, DST, PIXLUT) \
0N/A Declare ## SRC ## LoadVars(PIXLUT) \
0N/A Declare ## DST ## PixelData(bgpix);
0N/A
0N/A#define SetupConvertOnTheFlyBgLut(SRC, DST, PIXLUT, SRCINFO, DSTINFO, BGPIXEL) \
0N/A do { \
0N/A Init ## SRC ## LoadVars(PIXLUT, SRCINFO); \
0N/A Extract ## DST ## PixelData(BGPIXEL, bgpix); \
0N/A } while (0)
0N/A
0N/A#define BodyConvertOnTheFlyBgLut(SRCPTR, SRCTYPE, PIXLUT, \
0N/A DSTPTR, DSTTYPE, DSTPREFIX, \
0N/A SXVAR, DXVAR, BGPIXEL) \
0N/A do { \
0N/A jint argb; \
0N/A Load ## SRCTYPE ## To1IntArgb(SRCPTR, PIXLUT, SXVAR, argb); \
0N/A if (argb < 0) { \
0N/A Store ## DSTTYPE ## From1IntArgb(DSTPTR, DSTPREFIX, DXVAR, argb); \
0N/A } else { \
0N/A Store ## DSTTYPE ## PixelData(DSTPTR, DXVAR, BGPIXEL, bgpix); \
0N/A } \
0N/A } while (0)
0N/A
0N/A/*
0N/A * End of ConvertOnTheFly/BLITBG macros.
0N/A ***/
0N/A
0N/A/*
0N/A * These macros provide consistent naming conventions for the
0N/A * various types of native primitive inner loop functions.
0N/A * The names are mechanically constructed from the SurfaceType names.
0N/A */
0N/A#define NAME_CONVERT_BLIT(SRC, DST) SRC ## To ## DST ## Convert
0N/A
0N/A#define NAME_SCALE_BLIT(SRC, DST) SRC ## To ## DST ## ScaleConvert
0N/A
0N/A#define NAME_XPAR_CONVERT_BLIT(SRC, DST) SRC ## To ## DST ## XparOver
0N/A
0N/A#define NAME_XPAR_SCALE_BLIT(SRC, DST) SRC ## To ## DST ## ScaleXparOver
0N/A
0N/A#define NAME_XPAR_BLITBG(SRC, DST) SRC ## To ## DST ## XparBgCopy
0N/A
0N/A#define NAME_XOR_BLIT(SRC, DST) SRC ## To ## DST ## XorBlit
0N/A
0N/A#define NAME_ISOCOPY_BLIT(ANYTYPE) ANYTYPE ## IsomorphicCopy
0N/A
0N/A#define NAME_ISOSCALE_BLIT(ANYTYPE) ANYTYPE ## IsomorphicScaleCopy
0N/A
0N/A#define NAME_ISOXOR_BLIT(ANYTYPE) ANYTYPE ## IsomorphicXorCopy
0N/A
0N/A#define NAME_SOLID_FILLRECT(TYPE) TYPE ## SetRect
0N/A
0N/A#define NAME_SOLID_FILLSPANS(TYPE) TYPE ## SetSpans
0N/A
0N/A#define NAME_SOLID_DRAWLINE(TYPE) TYPE ## SetLine
0N/A
0N/A#define NAME_XOR_FILLRECT(TYPE) TYPE ## XorRect
0N/A
0N/A#define NAME_XOR_FILLSPANS(TYPE) TYPE ## XorSpans
0N/A
0N/A#define NAME_XOR_DRAWLINE(TYPE) TYPE ## XorLine
0N/A
0N/A#define NAME_SRC_MASKFILL(TYPE) TYPE ## SrcMaskFill
0N/A
0N/A#define NAME_SRCOVER_MASKFILL(TYPE) TYPE ## SrcOverMaskFill
0N/A
0N/A#define NAME_ALPHA_MASKFILL(TYPE) TYPE ## AlphaMaskFill
0N/A
0N/A#define NAME_SRCOVER_MASKBLIT(SRC, DST) SRC ## To ## DST ## SrcOverMaskBlit
0N/A
0N/A#define NAME_ALPHA_MASKBLIT(SRC, DST) SRC ## To ## DST ## AlphaMaskBlit
0N/A
0N/A#define NAME_SOLID_DRAWGLYPHLIST(TYPE) TYPE ## DrawGlyphList
0N/A
0N/A#define NAME_SOLID_DRAWGLYPHLISTAA(TYPE) TYPE ## DrawGlyphListAA
0N/A
0N/A#define NAME_SOLID_DRAWGLYPHLISTLCD(TYPE) TYPE ## DrawGlyphListLCD
0N/A
0N/A#define NAME_XOR_DRAWGLYPHLIST(TYPE) TYPE ## DrawGlyphListXor
0N/A
0N/A#define NAME_TRANSFORMHELPER(TYPE, MODE) TYPE ## MODE ## TransformHelper
0N/A
0N/A#define NAME_TRANSFORMHELPER_NN(TYPE) NAME_TRANSFORMHELPER(TYPE, NrstNbr)
0N/A#define NAME_TRANSFORMHELPER_BL(TYPE) NAME_TRANSFORMHELPER(TYPE, Bilinear)
0N/A#define NAME_TRANSFORMHELPER_BC(TYPE) NAME_TRANSFORMHELPER(TYPE, Bicubic)
0N/A
0N/A#define NAME_TRANSFORMHELPER_FUNCS(TYPE) TYPE ## TransformHelperFuncs
0N/A
3172N/A#define NAME_SOLID_FILLPGRAM(TYPE) TYPE ## SetParallelogram
3172N/A#define NAME_SOLID_PGRAM_FUNCS(TYPE) TYPE ## SetParallelogramFuncs
3172N/A
3172N/A#define NAME_XOR_FILLPGRAM(TYPE) TYPE ## XorParallelogram
3172N/A#define NAME_XOR_PGRAM_FUNCS(TYPE) TYPE ## XorParallelogramFuncs
3172N/A
0N/A/*
0N/A * These macros conveniently name and declare the indicated native
0N/A * primitive loop function for forward referencing.
0N/A */
0N/A#define DECLARE_CONVERT_BLIT(SRC, DST) \
0N/A BlitFunc NAME_CONVERT_BLIT(SRC, DST)
0N/A
0N/A#define DECLARE_SCALE_BLIT(SRC, DST) \
0N/A ScaleBlitFunc NAME_SCALE_BLIT(SRC, DST)
0N/A
0N/A#define DECLARE_XPAR_CONVERT_BLIT(SRC, DST) \
0N/A BlitFunc NAME_XPAR_CONVERT_BLIT(SRC, DST)
0N/A
0N/A#define DECLARE_XPAR_SCALE_BLIT(SRC, DST) \
0N/A ScaleBlitFunc NAME_XPAR_SCALE_BLIT(SRC, DST)
0N/A
0N/A#define DECLARE_XPAR_BLITBG(SRC, DST) \
0N/A BlitBgFunc NAME_XPAR_BLITBG(SRC, DST)
0N/A
0N/A#define DECLARE_XOR_BLIT(SRC, DST) \
0N/A BlitFunc NAME_XOR_BLIT(SRC, DST)
0N/A
0N/A#define DECLARE_ISOCOPY_BLIT(ANYTYPE) \
0N/A BlitFunc NAME_ISOCOPY_BLIT(ANYTYPE)
0N/A
0N/A#define DECLARE_ISOSCALE_BLIT(ANYTYPE) \
0N/A ScaleBlitFunc NAME_ISOSCALE_BLIT(ANYTYPE)
0N/A
0N/A#define DECLARE_ISOXOR_BLIT(ANYTYPE) \
0N/A BlitFunc NAME_ISOXOR_BLIT(ANYTYPE)
0N/A
0N/A#define DECLARE_SOLID_FILLRECT(TYPE) \
0N/A FillRectFunc NAME_SOLID_FILLRECT(TYPE)
0N/A
0N/A#define DECLARE_SOLID_FILLSPANS(TYPE) \
0N/A FillSpansFunc NAME_SOLID_FILLSPANS(TYPE)
0N/A
0N/A#define DECLARE_SOLID_DRAWLINE(TYPE) \
0N/A DrawLineFunc NAME_SOLID_DRAWLINE(TYPE)
0N/A
0N/A#define DECLARE_XOR_FILLRECT(TYPE) \
0N/A FillRectFunc NAME_XOR_FILLRECT(TYPE)
0N/A
0N/A#define DECLARE_XOR_FILLSPANS(TYPE) \
0N/A FillSpansFunc NAME_XOR_FILLSPANS(TYPE)
0N/A
0N/A#define DECLARE_XOR_DRAWLINE(TYPE) \
0N/A DrawLineFunc NAME_XOR_DRAWLINE(TYPE)
0N/A
0N/A#define DECLARE_ALPHA_MASKFILL(TYPE) \
0N/A MaskFillFunc NAME_ALPHA_MASKFILL(TYPE)
0N/A
0N/A#define DECLARE_SRC_MASKFILL(TYPE) \
0N/A MaskFillFunc NAME_SRC_MASKFILL(TYPE)
0N/A
0N/A#define DECLARE_SRCOVER_MASKFILL(TYPE) \
0N/A MaskFillFunc NAME_SRCOVER_MASKFILL(TYPE)
0N/A
0N/A#define DECLARE_SRCOVER_MASKBLIT(SRC, DST) \
0N/A MaskBlitFunc NAME_SRCOVER_MASKBLIT(SRC, DST)
0N/A
0N/A#define DECLARE_ALPHA_MASKBLIT(SRC, DST) \
0N/A MaskBlitFunc NAME_ALPHA_MASKBLIT(SRC, DST)
0N/A
0N/A#define DECLARE_SOLID_DRAWGLYPHLIST(TYPE) \
0N/A DrawGlyphListFunc NAME_SOLID_DRAWGLYPHLIST(TYPE)
0N/A
0N/A#define DECLARE_SOLID_DRAWGLYPHLISTAA(TYPE) \
0N/A DrawGlyphListAAFunc NAME_SOLID_DRAWGLYPHLISTAA(TYPE)
0N/A
0N/A#define DECLARE_SOLID_DRAWGLYPHLISTLCD(TYPE) \
0N/A DrawGlyphListLCDFunc NAME_SOLID_DRAWGLYPHLISTLCD(TYPE)
0N/A
0N/A#define DECLARE_XOR_DRAWGLYPHLIST(TYPE) \
0N/A DrawGlyphListFunc NAME_XOR_DRAWGLYPHLIST(TYPE)
0N/A
0N/A#define DECLARE_TRANSFORMHELPER_FUNCS(TYPE) \
0N/A TransformHelperFunc NAME_TRANSFORMHELPER_NN(TYPE); \
0N/A TransformHelperFunc NAME_TRANSFORMHELPER_BL(TYPE); \
0N/A TransformHelperFunc NAME_TRANSFORMHELPER_BC(TYPE); \
0N/A TransformHelperFuncs NAME_TRANSFORMHELPER_FUNCS(TYPE)
0N/A
3172N/A#define DECLARE_SOLID_PARALLELOGRAM(TYPE) \
3172N/A FillParallelogramFunc NAME_SOLID_FILLPGRAM(TYPE); \
3172N/A DECLARE_SOLID_DRAWLINE(TYPE); \
3172N/A DrawParallelogramFuncs NAME_SOLID_PGRAM_FUNCS(TYPE)
3172N/A
3172N/A#define DECLARE_XOR_PARALLELOGRAM(TYPE) \
3172N/A FillParallelogramFunc NAME_XOR_FILLPGRAM(TYPE); \
3172N/A DECLARE_XOR_DRAWLINE(TYPE); \
3172N/A DrawParallelogramFuncs NAME_XOR_PGRAM_FUNCS(TYPE)
3172N/A
0N/A/*
0N/A * These macros construct the necessary NativePrimitive structure
0N/A * for the indicated native primitive loop function which will be
0N/A * declared somewhere prior and defined elsewhere (usually after).
0N/A */
0N/A#define REGISTER_CONVERT_BLIT(SRC, DST) \
0N/A REGISTER_BLIT(SRC, SrcNoEa, DST, NAME_CONVERT_BLIT(SRC, DST))
0N/A
0N/A#define REGISTER_CONVERT_BLIT_FLAGS(SRC, DST, SFLAGS, DFLAGS) \
0N/A REGISTER_BLIT_FLAGS(SRC, SrcNoEa, DST, NAME_CONVERT_BLIT(SRC, DST), \
0N/A SFLAGS, DFLAGS)
0N/A
0N/A#define REGISTER_CONVERT_BLIT_EQUIV(SRC, DST, FUNC) \
0N/A REGISTER_BLIT(SRC, SrcNoEa, DST, FUNC)
0N/A
0N/A#define REGISTER_SCALE_BLIT(SRC, DST) \
0N/A REGISTER_SCALEBLIT(SRC, SrcNoEa, DST, NAME_SCALE_BLIT(SRC, DST))
0N/A
0N/A#define REGISTER_SCALE_BLIT_FLAGS(SRC, DST, SFLAGS, DFLAGS) \
0N/A REGISTER_SCALEBLIT_FLAGS(SRC, SrcNoEa, DST, NAME_SCALE_BLIT(SRC, DST), \
0N/A SFLAGS, DFLAGS)
0N/A
0N/A#define REGISTER_SCALE_BLIT_EQUIV(SRC, DST, FUNC) \
0N/A REGISTER_SCALEBLIT(SRC, SrcNoEa, DST, FUNC)
0N/A
0N/A#define REGISTER_XPAR_CONVERT_BLIT(SRC, DST) \
0N/A REGISTER_BLIT(SRC, SrcOverBmNoEa, DST, NAME_XPAR_CONVERT_BLIT(SRC, DST))
0N/A
0N/A#define REGISTER_XPAR_CONVERT_BLIT_EQUIV(SRC, DST, FUNC) \
0N/A REGISTER_BLIT(SRC, SrcOverBmNoEa, DST, FUNC)
0N/A
0N/A#define REGISTER_XPAR_SCALE_BLIT(SRC, DST) \
0N/A REGISTER_SCALEBLIT(SRC, SrcOverBmNoEa, DST, NAME_XPAR_SCALE_BLIT(SRC, DST))
0N/A
0N/A#define REGISTER_XPAR_SCALE_BLIT_EQUIV(SRC, DST, FUNC) \
0N/A REGISTER_SCALEBLIT(SRC, SrcOverBmNoEa, DST, FUNC)
0N/A
0N/A#define REGISTER_XPAR_BLITBG(SRC, DST) \
0N/A REGISTER_BLITBG(SRC, SrcNoEa, DST, NAME_XPAR_BLITBG(SRC, DST))
0N/A
0N/A#define REGISTER_XPAR_BLITBG_EQUIV(SRC, DST, FUNC) \
0N/A REGISTER_BLITBG(SRC, SrcNoEa, DST, FUNC)
0N/A
0N/A#define REGISTER_XOR_BLIT(SRC, DST) \
0N/A REGISTER_BLIT(SRC, Xor, DST, NAME_XOR_BLIT(SRC, DST))
0N/A
0N/A#define REGISTER_ISOCOPY_BLIT(THISTYPE, ANYTYPE) \
0N/A REGISTER_BLIT(THISTYPE, SrcNoEa, THISTYPE, NAME_ISOCOPY_BLIT(ANYTYPE))
0N/A
0N/A#define REGISTER_ISOSCALE_BLIT(THISTYPE, ANYTYPE) \
0N/A REGISTER_SCALEBLIT(THISTYPE, SrcNoEa, THISTYPE, NAME_ISOSCALE_BLIT(ANYTYPE))
0N/A
0N/A#define REGISTER_ISOXOR_BLIT(THISTYPE, ANYTYPE) \
0N/A REGISTER_BLIT(THISTYPE, Xor, THISTYPE, NAME_ISOXOR_BLIT(ANYTYPE))
0N/A
0N/A#define REGISTER_SOLID_FILLRECT(TYPE) \
0N/A REGISTER_FILLRECT(AnyColor, SrcNoEa, TYPE, NAME_SOLID_FILLRECT(TYPE))
0N/A
0N/A#define REGISTER_SOLID_FILLSPANS(TYPE) \
0N/A REGISTER_FILLSPANS(AnyColor, SrcNoEa, TYPE, NAME_SOLID_FILLSPANS(TYPE))
0N/A
0N/A#define REGISTER_SOLID_LINE_PRIMITIVES(TYPE) \
0N/A REGISTER_LINE_PRIMITIVES(AnyColor, SrcNoEa, TYPE, \
0N/A NAME_SOLID_DRAWLINE(TYPE))
0N/A
0N/A#define REGISTER_XOR_FILLRECT(TYPE) \
0N/A REGISTER_FILLRECT(AnyColor, Xor, TYPE, NAME_XOR_FILLRECT(TYPE))
0N/A
0N/A#define REGISTER_XOR_FILLSPANS(TYPE) \
0N/A REGISTER_FILLSPANS(AnyColor, Xor, TYPE, NAME_XOR_FILLSPANS(TYPE))
0N/A
0N/A#define REGISTER_XOR_LINE_PRIMITIVES(TYPE) \
0N/A REGISTER_LINE_PRIMITIVES(AnyColor, Xor, TYPE, NAME_XOR_DRAWLINE(TYPE))
0N/A
0N/A#define REGISTER_ALPHA_MASKFILL(TYPE) \
0N/A REGISTER_MASKFILL(AnyColor, AnyAlpha, TYPE, NAME_ALPHA_MASKFILL(TYPE))
0N/A
0N/A#define REGISTER_SRC_MASKFILL(TYPE) \
0N/A REGISTER_MASKFILL(AnyColor, Src, TYPE, NAME_SRC_MASKFILL(TYPE))
0N/A
0N/A#define REGISTER_SRCOVER_MASKFILL(TYPE) \
0N/A REGISTER_MASKFILL(AnyColor, SrcOver, TYPE, NAME_SRCOVER_MASKFILL(TYPE))
0N/A
0N/A#define REGISTER_SRCOVER_MASKBLIT(SRC, DST) \
0N/A REGISTER_MASKBLIT(SRC, SrcOver, DST, NAME_SRCOVER_MASKBLIT(SRC, DST))
0N/A
0N/A#define REGISTER_ALPHA_MASKBLIT(SRC, DST) \
0N/A REGISTER_MASKBLIT(SRC, AnyAlpha, DST, NAME_ALPHA_MASKBLIT(SRC, DST))
0N/A
0N/A#define REGISTER_SOLID_DRAWGLYPHLIST(TYPE) \
0N/A REGISTER_DRAWGLYPHLIST(AnyColor, SrcNoEa, TYPE, \
0N/A NAME_SOLID_DRAWGLYPHLIST(TYPE))
0N/A
0N/A#define REGISTER_SOLID_DRAWGLYPHLISTAA(TYPE) \
0N/A REGISTER_DRAWGLYPHLISTAA(AnyColor, SrcNoEa, TYPE, \
0N/A NAME_SOLID_DRAWGLYPHLISTAA(TYPE))
0N/A
0N/A#define REGISTER_SOLID_DRAWGLYPHLISTLCD(TYPE) \
0N/A REGISTER_DRAWGLYPHLISTLCD(AnyColor, SrcNoEa, TYPE, \
0N/A NAME_SOLID_DRAWGLYPHLISTLCD(TYPE))
0N/A
0N/A#define REGISTER_XOR_DRAWGLYPHLIST(TYPE) \
0N/A REGISTER_DRAWGLYPHLIST(AnyColor, Xor, TYPE, \
0N/A NAME_XOR_DRAWGLYPHLIST(TYPE)), \
0N/A REGISTER_DRAWGLYPHLISTAA(AnyColor, Xor, TYPE, \
0N/A NAME_XOR_DRAWGLYPHLIST(TYPE))
0N/A
0N/A#define REGISTER_TRANSFORMHELPER_FUNCS(TYPE) \
0N/A REGISTER_PRIMITIVE(TransformHelper, TYPE, SrcNoEa, IntArgbPre, \
0N/A (AnyFunc *) &NAME_TRANSFORMHELPER_FUNCS(TYPE))
0N/A
3172N/A#define REGISTER_SOLID_PARALLELOGRAM(TYPE) \
3172N/A REGISTER_PRIMITIVE(FillParallelogram, AnyColor, SrcNoEa, TYPE, \
3172N/A NAME_SOLID_FILLPGRAM(TYPE)), \
3172N/A REGISTER_PRIMITIVE(DrawParallelogram, AnyColor, SrcNoEa, TYPE, \
3172N/A (AnyFunc *) &NAME_SOLID_PGRAM_FUNCS(TYPE))
3172N/A
3172N/A#define REGISTER_XOR_PARALLELOGRAM(TYPE) \
3172N/A REGISTER_PRIMITIVE(FillParallelogram, AnyColor, Xor, TYPE, \
3172N/A NAME_XOR_FILLPGRAM(TYPE)), \
3172N/A REGISTER_PRIMITIVE(DrawParallelogram, AnyColor, Xor, TYPE, \
3172N/A (AnyFunc *) &NAME_XOR_PGRAM_FUNCS(TYPE))
3172N/A
0N/A/*
0N/A * This macro defines an entire function to implement a Blit inner loop
0N/A * for copying pixels of a common type from one buffer to another.
0N/A */
0N/A#define DEFINE_ISOCOPY_BLIT(ANYTYPE) \
0N/Avoid NAME_ISOCOPY_BLIT(ANYTYPE)(void *srcBase, void *dstBase, \
0N/A juint width, juint height, \
0N/A SurfaceDataRasInfo *pSrcInfo, \
0N/A SurfaceDataRasInfo *pDstInfo, \
0N/A NativePrimitive *pPrim, \
0N/A CompositeInfo *pCompInfo) \
0N/A{ \
0N/A Declare ## ANYTYPE ## StoreVars(DstWrite) \
0N/A BlitLoopHeight(ANYTYPE, pSrc, srcBase, pSrcInfo, \
0N/A ANYTYPE, pDst, dstBase, pDstInfo, DstWrite, \
0N/A height, \
0N/A memcpy(pDst, pSrc, width * ANYTYPE ## PixelStride)); \
0N/A}
0N/A
0N/A/*
0N/A * This macro defines an entire function to implement a ScaleBlit inner loop
0N/A * for scaling pixels of a common type from one buffer to another.
0N/A */
0N/A#define DEFINE_ISOSCALE_BLIT(ANYTYPE) \
0N/Avoid NAME_ISOSCALE_BLIT(ANYTYPE)(void *srcBase, void *dstBase, \
0N/A juint width, juint height, \
0N/A jint sxloc, jint syloc, \
0N/A jint sxinc, jint syinc, jint shift, \
0N/A SurfaceDataRasInfo *pSrcInfo, \
0N/A SurfaceDataRasInfo *pDstInfo, \
0N/A NativePrimitive *pPrim, \
0N/A CompositeInfo *pCompInfo) \
0N/A{ \
0N/A Declare ## ANYTYPE ## StoreVars(DstWrite) \
0N/A BlitLoopScaleWidthHeight(ANYTYPE, pSrc, srcBase, pSrcInfo, \
0N/A ANYTYPE, pDst, dstBase, pDstInfo, DstWrite, \
0N/A x, width, height, \
0N/A sxloc, syloc, sxinc, syinc, shift, \
0N/A Copy ## ANYTYPE ## PixelData(pSrc, x, pDst, 0)); \
0N/A}
0N/A
0N/A/*
0N/A * This macro defines an entire function to implement a Blit inner loop
0N/A * for XORing pixels of a common type from one buffer into another.
0N/A */
0N/A#define DEFINE_ISOXOR_BLIT(ANYTYPE) \
0N/Avoid NAME_ISOXOR_BLIT(ANYTYPE)(void *srcBase, void *dstBase, \
0N/A juint width, juint height, \
0N/A SurfaceDataRasInfo *pSrcInfo, \
0N/A SurfaceDataRasInfo *pDstInfo, \
0N/A NativePrimitive *pPrim, \
0N/A CompositeInfo *pCompInfo) \
0N/A{ \
0N/A jint xorpixel = pCompInfo->details.xorPixel; \
0N/A Declare ## ANYTYPE ## PixelData(xor) \
0N/A Declare ## ANYTYPE ## StoreVars(DstWrite) \
0N/A \
0N/A Extract ## ANYTYPE ## PixelData(xorpixel, xor); \
0N/A \
0N/A BlitLoopWidthHeight(ANYTYPE, pSrc, srcBase, pSrcInfo, \
0N/A ANYTYPE, pDst, dstBase, pDstInfo, DstWrite, \
0N/A width, height, \
0N/A XorCopy ## ANYTYPE ## PixelData(pSrc, pDst, 0, \
0N/A xorpixel, xor)); \
0N/A}
0N/A
0N/A/*
0N/A * This macro defines an entire function to implement a Blit inner loop
0N/A * for converting pixels from a buffer of one type into a buffer of
0N/A * another type. No blending is done of the pixels.
0N/A */
0N/A#define DEFINE_CONVERT_BLIT(SRC, DST, STRATEGY) \
0N/Avoid NAME_CONVERT_BLIT(SRC, DST)(void *srcBase, void *dstBase, \
0N/A juint width, juint height, \
0N/A SurfaceDataRasInfo *pSrcInfo, \
0N/A SurfaceDataRasInfo *pDstInfo, \
0N/A NativePrimitive *pPrim, \
0N/A CompositeInfo *pCompInfo) \
0N/A{ \
0N/A Declare ## SRC ## LoadVars(SrcRead) \
0N/A Declare ## DST ## StoreVars(DstWrite) \
0N/A \
0N/A Init ## SRC ## LoadVars(SrcRead, pSrcInfo); \
0N/A BlitLoopWidthHeight(SRC, pSrc, srcBase, pSrcInfo, \
0N/A DST, pDst, dstBase, pDstInfo, DstWrite, \
0N/A width, height, \
0N/A ConvertVia ## STRATEGY(pSrc, SRC, SrcRead, \
0N/A pDst, DST, DstWrite, \
0N/A 0, 0)); \
0N/A}
0N/A
0N/A/*
0N/A * This macro defines an entire function to implement a Blit inner loop
0N/A * for converting pixels from a buffer of byte pixels with a lookup
0N/A * table into a buffer of another type. No blending is done of the pixels.
0N/A */
0N/A#define DEFINE_CONVERT_BLIT_LUT(SRC, DST, LUT_STRATEGY) \
0N/Avoid NAME_CONVERT_BLIT(SRC, DST)(void *srcBase, void *dstBase, \
0N/A juint width, juint height, \
0N/A SurfaceDataRasInfo *pSrcInfo, \
0N/A SurfaceDataRasInfo *pDstInfo, \
0N/A NativePrimitive *pPrim, \
0N/A CompositeInfo *pCompInfo) \
0N/A{ \
0N/A Declare ## DST ## StoreVars(DstWrite) \
0N/A Declare ## LUT_STRATEGY ## Lut(SRC, DST, pixLut) \
0N/A \
0N/A Setup ## LUT_STRATEGY ## Lut(SRC, DST, pixLut,\
0N/A pSrcInfo, pDstInfo); \
0N/A BlitLoopWidthHeight(SRC, pSrc, srcBase, pSrcInfo, \
0N/A DST, pDst, dstBase, pDstInfo, DstWrite, \
0N/A width, height, \
0N/A Body ## LUT_STRATEGY ## Lut(pSrc, SRC, \
0N/A pixLut, \
0N/A pDst, DST, \
0N/A DstWrite, 0, 0));\
0N/A}
0N/A#define DEFINE_CONVERT_BLIT_LUT8(SRC, DST, LUT_STRATEGY) \
0N/A DEFINE_CONVERT_BLIT_LUT(SRC, DST, LUT_STRATEGY)
0N/A
0N/A/*
0N/A * This macro defines an entire function to implement a ScaleBlit inner
0N/A * loop for scaling and converting pixels from a buffer of one type into
0N/A * a buffer of another type. No blending is done of the pixels.
0N/A */
0N/A#define DEFINE_SCALE_BLIT(SRC, DST, STRATEGY) \
0N/Avoid NAME_SCALE_BLIT(SRC, DST)(void *srcBase, void *dstBase, \
0N/A juint width, juint height, \
0N/A jint sxloc, jint syloc, \
0N/A jint sxinc, jint syinc, jint shift, \
0N/A SurfaceDataRasInfo *pSrcInfo, \
0N/A SurfaceDataRasInfo *pDstInfo, \
0N/A NativePrimitive *pPrim, \
0N/A CompositeInfo *pCompInfo) \
0N/A{ \
0N/A Declare ## SRC ## LoadVars(SrcRead) \
0N/A Declare ## DST ## StoreVars(DstWrite) \
0N/A \
0N/A Init ## SRC ## LoadVars(SrcRead, pSrcInfo); \
0N/A BlitLoopScaleWidthHeight(SRC, pSrc, srcBase, pSrcInfo, \
0N/A DST, pDst, dstBase, pDstInfo, DstWrite, \
0N/A x, width, height, \
0N/A sxloc, syloc, sxinc, syinc, shift, \
0N/A ConvertVia ## STRATEGY(pSrc, SRC, SrcRead, \
0N/A pDst, DST, DstWrite, \
0N/A x, 0)); \
0N/A}
0N/A
0N/A/*
0N/A * This macro defines an entire function to implement a ScaleBlit inner
0N/A * loop for scaling and converting pixels from a buffer of byte pixels
0N/A * with a lookup table into a buffer of another type. No blending is
0N/A * done of the pixels.
0N/A */
0N/A#define DEFINE_SCALE_BLIT_LUT(SRC, DST, LUT_STRATEGY) \
0N/Avoid NAME_SCALE_BLIT(SRC, DST)(void *srcBase, void *dstBase, \
0N/A juint width, juint height, \
0N/A jint sxloc, jint syloc, \
0N/A jint sxinc, jint syinc, jint shift, \
0N/A SurfaceDataRasInfo *pSrcInfo, \
0N/A SurfaceDataRasInfo *pDstInfo, \
0N/A NativePrimitive *pPrim, \
0N/A CompositeInfo *pCompInfo) \
0N/A{ \
0N/A Declare ## DST ## StoreVars(DstWrite) \
0N/A Declare ## LUT_STRATEGY ## Lut(SRC, DST, pixLut) \
0N/A \
0N/A Setup ## LUT_STRATEGY ## Lut(SRC, DST, pixLut, pSrcInfo, pDstInfo); \
0N/A BlitLoopScaleWidthHeight(SRC, pSrc, srcBase, pSrcInfo, \
0N/A DST, pDst, dstBase, pDstInfo, DstWrite, \
0N/A x, width, height, \
0N/A sxloc, syloc, sxinc, syinc, shift, \
0N/A Body ## LUT_STRATEGY ## Lut(pSrc, SRC, pixLut, \
0N/A pDst, DST, \
0N/A DstWrite, x, 0));\
0N/A}
0N/A#define DEFINE_SCALE_BLIT_LUT8(SRC, DST, LUT_STRATEGY) \
0N/A DEFINE_SCALE_BLIT_LUT(SRC, DST, LUT_STRATEGY)
0N/A
0N/A/*
0N/A * This macro defines an entire function to implement a Blit inner loop
0N/A * for drawing opaque pixels from a buffer of one type onto a buffer of
0N/A * another type, ignoring the transparent pixels in the source buffer.
0N/A * No blending is done of the pixels - the converted pixel value is
0N/A * either copied or the destination is left untouched.
0N/A */
0N/A#define DEFINE_XPAR_CONVERT_BLIT(SRC, DST, STRATEGY) \
0N/Avoid NAME_XPAR_CONVERT_BLIT(SRC, DST)(void *srcBase, void *dstBase, \
0N/A juint width, juint height, \
0N/A SurfaceDataRasInfo *pSrcInfo, \
0N/A SurfaceDataRasInfo *pDstInfo, \
0N/A NativePrimitive *pPrim, \
0N/A CompositeInfo *pCompInfo) \
0N/A{ \
0N/A Declare ## SRC ## LoadVars(SrcRead) \
0N/A Declare ## DST ## StoreVars(DstWrite) \
0N/A \
0N/A Init ## SRC ## LoadVars(SrcRead, pSrcInfo); \
0N/A BlitLoopWidthHeight(SRC, pSrc, srcBase, pSrcInfo, \
0N/A DST, pDst, dstBase, pDstInfo, DstWrite, \
0N/A width, height, \
0N/A ConvertXparVia ## STRATEGY(pSrc, SRC, SrcRead, \
0N/A pDst, DST, DstWrite, \
0N/A 0, 0)); \
0N/A}
0N/A
0N/A/*
0N/A * This macro defines an entire function to implement a Blit inner loop
0N/A * for converting pixels from a buffer of byte pixels with a lookup
0N/A * table containing transparent pixels into a buffer of another type.
0N/A * No blending is done of the pixels - the converted pixel value is
0N/A * either copied or the destination is left untouched.
0N/A */
0N/A#define DEFINE_XPAR_CONVERT_BLIT_LUT(SRC, DST, LUT_STRATEGY) \
0N/Avoid NAME_XPAR_CONVERT_BLIT(SRC, DST)(void *srcBase, void *dstBase, \
0N/A juint width, juint height, \
0N/A SurfaceDataRasInfo *pSrcInfo, \
0N/A SurfaceDataRasInfo *pDstInfo, \
0N/A NativePrimitive *pPrim, \
0N/A CompositeInfo *pCompInfo) \
0N/A{ \
0N/A Declare ## DST ## StoreVars(DstWrite) \
0N/A Declare ## LUT_STRATEGY ## XparLut(SRC, DST, pixLut) \
0N/A \
0N/A Setup ## LUT_STRATEGY ## XparLut(SRC, DST, pixLut, pSrcInfo, pDstInfo); \
0N/A BlitLoopWidthHeight(SRC, pSrc, srcBase, pSrcInfo, \
0N/A DST, pDst, dstBase, pDstInfo, DstWrite, \
0N/A width, height, \
0N/A Body ## LUT_STRATEGY ## XparLut(pSrc, SRC, pixLut, \
0N/A pDst, DST, \
0N/A DstWrite, 0, 0)); \
0N/A}
0N/A#define DEFINE_XPAR_CONVERT_BLIT_LUT8(SRC, DST, LUT_STRATEGY) \
0N/A DEFINE_XPAR_CONVERT_BLIT_LUT(SRC, DST, LUT_STRATEGY)
0N/A
0N/A/*
0N/A * This macro defines an entire function to implement a ScaleBlit inner
0N/A * loop for scaling and converting pixels from a buffer of byte pixels
0N/A * with a lookup table containing transparent pixels into a buffer of
0N/A * another type.
0N/A * No blending is done of the pixels - the converted pixel value is
0N/A * either copied or the destination is left untouched.
0N/A */
0N/A#define DEFINE_XPAR_SCALE_BLIT_LUT(SRC, DST, LUT_STRATEGY) \
0N/Avoid NAME_XPAR_SCALE_BLIT(SRC, DST)(void *srcBase, void *dstBase, \
0N/A juint width, juint height, \
0N/A jint sxloc, jint syloc, \
0N/A jint sxinc, jint syinc, jint shift, \
0N/A SurfaceDataRasInfo *pSrcInfo, \
0N/A SurfaceDataRasInfo *pDstInfo, \
0N/A NativePrimitive *pPrim, \
0N/A CompositeInfo *pCompInfo) \
0N/A{ \
0N/A Declare ## DST ## StoreVars(DstWrite) \
0N/A Declare ## LUT_STRATEGY ## XparLut(SRC, DST, pixLut) \
0N/A \
0N/A Setup ## LUT_STRATEGY ## XparLut(SRC, DST, pixLut, pSrcInfo, pDstInfo); \
0N/A BlitLoopScaleWidthHeight(SRC, pSrc, srcBase, pSrcInfo, \
0N/A DST, pDst, dstBase, pDstInfo, DstWrite, \
0N/A x, width, height, \
0N/A sxloc, syloc, sxinc, syinc, shift, \
0N/A Body ## LUT_STRATEGY ## XparLut(pSrc, SRC, pixLut, \
0N/A pDst, DST, \
0N/A DstWrite, \
0N/A x, 0)); \
0N/A}
0N/A#define DEFINE_XPAR_SCALE_BLIT_LUT8(SRC, DST, LUT_STRATEGY) \
0N/A DEFINE_XPAR_SCALE_BLIT_LUT(SRC, DST, LUT_STRATEGY)
0N/A
0N/A/*
0N/A * This macro defines an entire function to implement a ScaleBlit inner
0N/A * loop for scaling and converting pixels from a buffer of one type
0N/A * containing transparent pixels into a buffer of another type.
0N/A *
0N/A * No blending is done of the pixels - the converted pixel value is
0N/A * either copied or the destination is left untouched.
0N/A */
0N/A#define DEFINE_XPAR_SCALE_BLIT(SRC, DST, STRATEGY) \
0N/Avoid NAME_XPAR_SCALE_BLIT(SRC, DST)(void *srcBase, void *dstBase, \
0N/A juint width, juint height, \
0N/A jint sxloc, jint syloc, \
0N/A jint sxinc, jint syinc, jint shift, \
0N/A SurfaceDataRasInfo *pSrcInfo, \
0N/A SurfaceDataRasInfo *pDstInfo, \
0N/A NativePrimitive *pPrim, \
0N/A CompositeInfo *pCompInfo) \
0N/A{ \
0N/A Declare ## SRC ## LoadVars(SrcRead) \
0N/A Declare ## DST ## StoreVars(DstWrite) \
0N/A \
0N/A Init ## SRC ## LoadVars(SrcRead, pSrcInfo); \
0N/A BlitLoopScaleWidthHeight(SRC, pSrc, srcBase, pSrcInfo, \
0N/A DST, pDst, dstBase, pDstInfo, DstWrite, \
0N/A x, width, height, \
0N/A sxloc, syloc, sxinc, syinc, shift, \
0N/A ConvertXparVia ## STRATEGY(pSrc, SRC, SrcRead, \
0N/A pDst, DST, DstWrite, \
0N/A x, 0)); \
0N/A}
0N/A
0N/A/*
0N/A * This macro defines an entire function to implement a BlitBg inner loop
0N/A * for converting pixels from a buffer of one type containing transparent
0N/A * pixels into a buffer of another type with a specified bgcolor for the
0N/A * transparent pixels.
0N/A * No blending is done of the pixels other than to substitute the
0N/A * bgcolor for any transparent pixels.
0N/A */
0N/A#define DEFINE_XPAR_BLITBG(SRC, DST, STRATEGY) \
0N/Avoid NAME_XPAR_BLITBG(SRC, DST)(void *srcBase, void *dstBase, \
0N/A juint width, juint height, \
0N/A jint bgpixel, \
0N/A SurfaceDataRasInfo *pSrcInfo, \
0N/A SurfaceDataRasInfo *pDstInfo, \
0N/A NativePrimitive *pPrim, \
0N/A CompositeInfo *pCompInfo) \
0N/A{ \
0N/A Declare ## SRC ## LoadVars(SrcRead) \
0N/A Declare ## DST ## StoreVars(DstWrite) \
0N/A Declare ## DST ## PixelData(bgdata) \
0N/A \
0N/A Extract ## DST ## PixelData(bgpixel, bgdata); \
0N/A BlitLoopWidthHeight(SRC, pSrc, srcBase, pSrcInfo, \
0N/A DST, pDst, dstBase, pDstInfo, DstWrite, \
0N/A width, height, \
0N/A BgCopyXparVia ## STRATEGY(pSrc, SRC, SrcRead, \
0N/A pDst, DST, DstWrite, \
0N/A 0, 0, bgpixel, bgdata)); \
0N/A}
0N/A
0N/A/*
0N/A * This macro defines an entire function to implement a BlitBg inner loop
0N/A * for converting pixels from a buffer of byte pixels with a lookup
0N/A * table containing transparent pixels into a buffer of another type
0N/A * with a specified bgcolor for the transparent pixels.
0N/A * No blending is done of the pixels other than to substitute the
0N/A * bgcolor for any transparent pixels.
0N/A */
0N/A#define DEFINE_XPAR_BLITBG_LUT(SRC, DST, LUT_STRATEGY) \
0N/Avoid NAME_XPAR_BLITBG(SRC, DST)(void *srcBase, void *dstBase, \
0N/A juint width, juint height, \
0N/A jint bgpixel, \
0N/A SurfaceDataRasInfo *pSrcInfo, \
0N/A SurfaceDataRasInfo *pDstInfo, \
0N/A NativePrimitive *pPrim, \
0N/A CompositeInfo *pCompInfo) \
0N/A{ \
0N/A Declare ## DST ## StoreVars(DstWrite) \
0N/A Declare ## LUT_STRATEGY ## BgLut(SRC, DST, pixLut) \
0N/A \
0N/A Setup ## LUT_STRATEGY ## BgLut(SRC, DST, pixLut, pSrcInfo, pDstInfo, \
0N/A bgpixel); \
0N/A BlitLoopWidthHeight(SRC, pSrc, srcBase, pSrcInfo, \
0N/A DST, pDst, dstBase, pDstInfo, DstWrite, \
0N/A width, height, \
0N/A Body ## LUT_STRATEGY ## BgLut(pSrc, SRC, pixLut, \
0N/A pDst, DST, \
0N/A DstWrite, 0, 0, \
0N/A bgpixel)); \
0N/A}
0N/A#define DEFINE_XPAR_BLITBG_LUT8(SRC, DST, LUT_STRATEGY) \
0N/A DEFINE_XPAR_BLITBG_LUT(SRC, DST, LUT_STRATEGY)
0N/A
0N/A/*
0N/A * This macro defines an entire function to implement a Blit inner loop
0N/A * for converting pixels from a buffer of one type into a buffer of
0N/A * another type. Each source pixel is XORed with the current XOR color value.
0N/A * That result is then XORed with the destination pixel and the final
0N/A * result is stored in the destination surface.
0N/A */
0N/A#define DEFINE_XOR_BLIT(SRC, DST, DSTANYTYPE) \
0N/Avoid NAME_XOR_BLIT(SRC, DST)(void *srcBase, void *dstBase, \
0N/A juint width, juint height, \
0N/A SurfaceDataRasInfo *pSrcInfo, \
0N/A SurfaceDataRasInfo *pDstInfo, \
0N/A NativePrimitive *pPrim, \
0N/A CompositeInfo *pCompInfo) \
0N/A{ \
0N/A jint xorpixel = pCompInfo->details.xorPixel; \
0N/A juint alphamask = pCompInfo->alphaMask; \
0N/A Declare ## DSTANYTYPE ## PixelData(xor) \
0N/A Declare ## DSTANYTYPE ## PixelData(mask) \
0N/A Declare ## SRC ## LoadVars(SrcRead) \
0N/A Declare ## DST ## StoreVars(DstWrite) \
0N/A \
0N/A Extract ## DSTANYTYPE ## PixelData(xorpixel, xor); \
0N/A Extract ## DSTANYTYPE ## PixelData(alphamask, mask); \
0N/A \
0N/A Init ## SRC ## LoadVars(SrcRead, pSrcInfo); \
0N/A BlitLoopWidthHeight(SRC, pSrc, srcBase, pSrcInfo, \
0N/A DST, pDst, dstBase, pDstInfo, DstWrite, \
0N/A width, height, \
0N/A XorVia1IntArgb(pSrc, SRC, SrcRead, \
0N/A pDst, DST, DSTANYTYPE, \
0N/A 0, xorpixel, xor, \
0N/A alphamask, mask, pDstInfo)); \
0N/A}
0N/A
0N/A/*
0N/A * This macro defines an entire function to implement a FillRect inner loop
0N/A * for setting a rectangular region of pixels to a specific pixel value.
0N/A * No blending of the fill color is done with the pixels.
0N/A */
0N/A#define DEFINE_SOLID_FILLRECT(DST) \
0N/Avoid NAME_SOLID_FILLRECT(DST)(SurfaceDataRasInfo *pRasInfo, \
0N/A jint lox, jint loy, \
0N/A jint hix, jint hiy, \
0N/A jint pixel, \
0N/A NativePrimitive *pPrim, \
0N/A CompositeInfo *pCompInfo) \
0N/A{ \
0N/A Declare ## DST ## PixelData(pix) \
0N/A DST ## DataType *pPix; \
0N/A jint scan = pRasInfo->scanStride; \
0N/A juint height = hiy - loy; \
0N/A juint width = hix - lox; \
0N/A \
0N/A pPix = PtrCoord(pRasInfo->rasBase, lox, DST ## PixelStride, loy, scan); \
0N/A Extract ## DST ## PixelData(pixel, pix); \
0N/A do { \
0N/A juint x = 0; \
0N/A do { \
0N/A Store ## DST ## PixelData(pPix, x, pixel, pix); \
0N/A } while (++x < width); \
0N/A pPix = PtrAddBytes(pPix, scan); \
0N/A } while (--height > 0); \
0N/A}
0N/A
0N/A/*
0N/A * This macro defines an entire function to implement a FillSpans inner loop
0N/A * for iterating through a list of spans and setting those regions of pixels
0N/A * to a specific pixel value. No blending of the fill color is done with
0N/A * the pixels.
0N/A */
0N/A#define DEFINE_SOLID_FILLSPANS(DST) \
0N/Avoid NAME_SOLID_FILLSPANS(DST)(SurfaceDataRasInfo *pRasInfo, \
0N/A SpanIteratorFuncs *pSpanFuncs, void *siData, \
0N/A jint pixel, NativePrimitive *pPrim, \
0N/A CompositeInfo *pCompInfo) \
0N/A{ \
0N/A void *pBase = pRasInfo->rasBase; \
0N/A Declare ## DST ## PixelData(pix) \
0N/A jint scan = pRasInfo->scanStride; \
0N/A jint bbox[4]; \
0N/A \
0N/A Extract ## DST ## PixelData(pixel, pix); \
0N/A while ((*pSpanFuncs->nextSpan)(siData, bbox)) { \
0N/A jint x = bbox[0]; \
0N/A jint y = bbox[1]; \
0N/A juint w = bbox[2] - x; \
0N/A juint h = bbox[3] - y; \
0N/A DST ## DataType *pPix = PtrCoord(pBase, \
0N/A x, DST ## PixelStride, \
0N/A y, scan); \
0N/A do { \
0N/A juint relx; \
0N/A for (relx = 0; relx < w; relx++) { \
0N/A Store ## DST ## PixelData(pPix, relx, pixel, pix); \
0N/A } \
0N/A pPix = PtrAddBytes(pPix, scan); \
0N/A } while (--h > 0); \
0N/A } \
0N/A}
0N/A
0N/A/*
3172N/A * This macro defines an entire function to implement a FillParallelogram
3172N/A * inner loop for tracing 2 diagonal edges (left and right) and setting
3172N/A * those regions of pixels between them to a specific pixel value.
3172N/A * No blending of the fill color is done with the pixels.
3172N/A */
3172N/A#define DEFINE_SOLID_FILLPGRAM(DST) \
3172N/Avoid NAME_SOLID_FILLPGRAM(DST)(SurfaceDataRasInfo *pRasInfo, \
3172N/A jint lox, jint loy, jint hix, jint hiy, \
3172N/A jlong leftx, jlong dleftx, \
3172N/A jlong rightx, jlong drightx, \
3172N/A jint pixel, struct _NativePrimitive *pPrim, \
3172N/A CompositeInfo *pCompInfo) \
3172N/A{ \
3172N/A Declare ## DST ## PixelData(pix) \
3172N/A jint scan = pRasInfo->scanStride; \
3172N/A DST ## DataType *pPix = PtrCoord(pRasInfo->rasBase, 0, 0, loy, scan); \
3172N/A \
3172N/A Extract ## DST ## PixelData(pixel, pix); \
3172N/A while (loy < hiy) { \
3172N/A jint lx = WholeOfLong(leftx); \
3172N/A jint rx = WholeOfLong(rightx); \
3172N/A if (lx < lox) lx = lox; \
3172N/A if (rx > hix) rx = hix; \
3172N/A while (lx < rx) { \
3172N/A Store ## DST ## PixelData(pPix, lx, pixel, pix); \
3172N/A lx++; \
3172N/A } \
3172N/A pPix = PtrAddBytes(pPix, scan); \
3172N/A leftx += dleftx; \
3172N/A rightx += drightx; \
3172N/A loy++; \
3172N/A } \
3172N/A}
3172N/A
3172N/A#define DEFINE_SOLID_DRAWPARALLELOGRAM_FUNCS(DST) \
3172N/A DrawParallelogramFuncs NAME_SOLID_PGRAM_FUNCS(DST) = { \
3172N/A NAME_SOLID_FILLPGRAM(DST), \
3172N/A NAME_SOLID_DRAWLINE(DST), \
3172N/A };
3172N/A
3172N/A#define DEFINE_SOLID_PARALLELOGRAM(DST) \
3172N/A DEFINE_SOLID_FILLPGRAM(DST) \
3172N/A DEFINE_SOLID_DRAWPARALLELOGRAM_FUNCS(DST)
3172N/A
3172N/A/*
0N/A * This macro declares the bumpmajor and bumpminor variables used for the
0N/A * DrawLine functions.
0N/A */
0N/A#define DeclareBumps(BUMPMAJOR, BUMPMINOR) \
0N/A jint BUMPMAJOR, BUMPMINOR;
0N/A
0N/A/*
0N/A * This macro extracts "instructions" from the bumpmajor and bumpminor masks
0N/A * that determine the initial bumpmajor and bumpminor values. The bumpmajor
0N/A * and bumpminor masks are laid out in the following format:
0N/A *
0N/A * bumpmajormask: bumpminormask:
0N/A * bit0: bumpmajor = pixelStride bit0: bumpminor = pixelStride
0N/A * bit1: bumpmajor = -pixelStride bit1: bumpminor = -pixelStride
0N/A * bit2: bumpmajor = scanStride bit2: bumpminor = scanStride
0N/A * bit3: bumpmajor = -scanStride bit3: bumpminor = -scanStride
0N/A */
0N/A#define InitBumps(BUMPMAJOR, BUMPMINOR, \
0N/A BUMPMAJORMASK, BUMPMINORMASK, \
0N/A PIXELSTRIDE, SCANSTRIDE) \
0N/A BUMPMAJOR = (BUMPMAJORMASK & BUMP_POS_PIXEL) ? PIXELSTRIDE : \
0N/A (BUMPMAJORMASK & BUMP_NEG_PIXEL) ? -PIXELSTRIDE : \
0N/A (BUMPMAJORMASK & BUMP_POS_SCAN) ? SCANSTRIDE : \
0N/A -SCANSTRIDE; \
0N/A BUMPMINOR = (BUMPMINORMASK & BUMP_POS_PIXEL) ? PIXELSTRIDE : \
0N/A (BUMPMINORMASK & BUMP_NEG_PIXEL) ? -PIXELSTRIDE : \
0N/A (BUMPMINORMASK & BUMP_POS_SCAN) ? SCANSTRIDE : \
0N/A (BUMPMINORMASK & BUMP_NEG_SCAN) ? -SCANSTRIDE : \
0N/A 0; \
0N/A BUMPMINOR += BUMPMAJOR;
0N/A
0N/A/*
0N/A * This macro defines an entire function to implement a DrawLine inner loop
0N/A * for iterating along a horizontal or vertical line and setting the pixels
0N/A * on that line to a specific pixel value. No blending of the fill color
0N/A * is done with the pixels.
0N/A */
0N/A#define DEFINE_SOLID_DRAWLINE(DST) \
0N/Avoid NAME_SOLID_DRAWLINE(DST)(SurfaceDataRasInfo *pRasInfo, \
0N/A jint x1, jint y1, jint pixel, \
0N/A jint steps, jint error, \
0N/A jint bumpmajormask, jint errmajor, \
0N/A jint bumpminormask, jint errminor, \
0N/A NativePrimitive *pPrim, \
0N/A CompositeInfo *pCompInfo) \
0N/A{ \
0N/A Declare ## DST ## PixelData(pix) \
0N/A jint scan = pRasInfo->scanStride; \
0N/A DST ## DataType *pPix = PtrCoord(pRasInfo->rasBase, \
0N/A x1, DST ## PixelStride, \
0N/A y1, scan); \
0N/A DeclareBumps(bumpmajor, bumpminor) \
0N/A \
0N/A InitBumps(bumpmajor, bumpminor, bumpmajormask, bumpminormask, \
0N/A DST ## PixelStride, scan); \
0N/A Extract ## DST ## PixelData(pixel, pix); \
0N/A if (errmajor == 0) { \
0N/A do { \
0N/A Store ## DST ## PixelData(pPix, 0, pixel, pix); \
0N/A pPix = PtrAddBytes(pPix, bumpmajor); \
0N/A } while (--steps > 0); \
0N/A } else { \
0N/A do { \
0N/A Store ## DST ## PixelData(pPix, 0, pixel, pix); \
0N/A if (error < 0) { \
0N/A pPix = PtrAddBytes(pPix, bumpmajor); \
0N/A error += errmajor; \
0N/A } else { \
0N/A pPix = PtrAddBytes(pPix, bumpminor); \
0N/A error -= errminor; \
0N/A } \
0N/A } while (--steps > 0); \
0N/A } \
0N/A}
0N/A
0N/A/*
0N/A * This macro defines an entire function to implement a FillRect inner loop
0N/A * for setting a rectangular region of pixels to a specific pixel value.
0N/A * Each destination pixel is XORed with the current XOR mode color as well as
0N/A * the current fill color.
0N/A */
0N/A#define DEFINE_XOR_FILLRECT(DST) \
0N/Avoid NAME_XOR_FILLRECT(DST)(SurfaceDataRasInfo *pRasInfo, \
0N/A jint lox, jint loy, \
0N/A jint hix, jint hiy, \
0N/A jint pixel, \
0N/A NativePrimitive *pPrim, \
0N/A CompositeInfo *pCompInfo) \
0N/A{ \
0N/A jint xorpixel = pCompInfo->details.xorPixel; \
0N/A juint alphamask = pCompInfo->alphaMask; \
0N/A Declare ## DST ## PixelData(xor) \
0N/A Declare ## DST ## PixelData(pix) \
0N/A Declare ## DST ## PixelData(mask) \
0N/A DST ## DataType *pPix; \
0N/A jint scan = pRasInfo->scanStride; \
0N/A juint height = hiy - loy; \
0N/A juint width = hix - lox; \
0N/A \
0N/A pPix = PtrCoord(pRasInfo->rasBase, lox, DST ## PixelStride, loy, scan); \
0N/A Extract ## DST ## PixelData(xorpixel, xor); \
0N/A Extract ## DST ## PixelData(pixel, pix); \
0N/A Extract ## DST ## PixelData(alphamask, mask); \
0N/A \
0N/A do { \
0N/A juint x = 0; \
0N/A do { \
0N/A Xor ## DST ## PixelData(pixel, pix, pPix, x, \
0N/A xorpixel, xor, alphamask, mask); \
0N/A } while (++x < width); \
0N/A pPix = PtrAddBytes(pPix, scan); \
0N/A } while (--height > 0); \
0N/A}
0N/A
0N/A/*
0N/A * This macro defines an entire function to implement a FillSpans inner loop
0N/A * for iterating through a list of spans and setting those regions of pixels
0N/A * to a specific pixel value. Each destination pixel is XORed with the
0N/A * current XOR mode color as well as the current fill color.
0N/A */
0N/A#define DEFINE_XOR_FILLSPANS(DST) \
0N/Avoid NAME_XOR_FILLSPANS(DST)(SurfaceDataRasInfo *pRasInfo, \
0N/A SpanIteratorFuncs *pSpanFuncs, \
0N/A void *siData, jint pixel, \
0N/A NativePrimitive *pPrim, \
0N/A CompositeInfo *pCompInfo) \
0N/A{ \
0N/A void *pBase = pRasInfo->rasBase; \
0N/A jint xorpixel = pCompInfo->details.xorPixel; \
0N/A juint alphamask = pCompInfo->alphaMask; \
0N/A Declare ## DST ## PixelData(xor) \
0N/A Declare ## DST ## PixelData(pix) \
0N/A Declare ## DST ## PixelData(mask) \
0N/A jint scan = pRasInfo->scanStride; \
0N/A jint bbox[4]; \
0N/A \
0N/A Extract ## DST ## PixelData(xorpixel, xor); \
0N/A Extract ## DST ## PixelData(pixel, pix); \
0N/A Extract ## DST ## PixelData(alphamask, mask); \
0N/A \
0N/A while ((*pSpanFuncs->nextSpan)(siData, bbox)) { \
0N/A jint x = bbox[0]; \
0N/A jint y = bbox[1]; \
0N/A juint w = bbox[2] - x; \
0N/A juint h = bbox[3] - y; \
0N/A DST ## DataType *pPix = PtrCoord(pBase, \
0N/A x, DST ## PixelStride, \
0N/A y, scan); \
0N/A do { \
0N/A juint relx; \
0N/A for (relx = 0; relx < w; relx++) { \
0N/A Xor ## DST ## PixelData(pixel, pix, pPix, relx, \
0N/A xorpixel, xor, alphamask, mask); \
0N/A } \
0N/A pPix = PtrAddBytes(pPix, scan); \
0N/A } while (--h > 0); \
0N/A } \
0N/A}
0N/A
0N/A/*
0N/A * This macro defines an entire function to implement a DrawLine inner loop
0N/A * for iterating along a horizontal or vertical line and setting the pixels
0N/A * on that line to a specific pixel value. Each destination pixel is XORed
0N/A * with the current XOR mode color as well as the current draw color.
0N/A */
0N/A#define DEFINE_XOR_DRAWLINE(DST) \
0N/Avoid NAME_XOR_DRAWLINE(DST)(SurfaceDataRasInfo *pRasInfo, \
0N/A jint x1, jint y1, jint pixel, \
0N/A jint steps, jint error, \
0N/A jint bumpmajormask, jint errmajor, \
0N/A jint bumpminormask, jint errminor, \
0N/A NativePrimitive *pPrim, \
0N/A CompositeInfo *pCompInfo) \
0N/A{ \
0N/A jint xorpixel = pCompInfo->details.xorPixel; \
0N/A juint alphamask = pCompInfo->alphaMask; \
0N/A Declare ## DST ## PixelData(xor) \
0N/A Declare ## DST ## PixelData(pix) \
0N/A Declare ## DST ## PixelData(mask) \
0N/A jint scan = pRasInfo->scanStride; \
0N/A DST ## DataType *pPix = PtrCoord(pRasInfo->rasBase, \
0N/A x1, DST ## PixelStride, \
0N/A y1, scan); \
0N/A DeclareBumps(bumpmajor, bumpminor) \
0N/A \
0N/A InitBumps(bumpmajor, bumpminor, bumpmajormask, bumpminormask, \
0N/A DST ## PixelStride, scan); \
0N/A Extract ## DST ## PixelData(xorpixel, xor); \
0N/A Extract ## DST ## PixelData(pixel, pix); \
0N/A Extract ## DST ## PixelData(alphamask, mask); \
0N/A \
0N/A if (errmajor == 0) { \
0N/A do { \
0N/A Xor ## DST ## PixelData(pixel, pix, pPix, 0, \
0N/A xorpixel, xor, alphamask, mask); \
0N/A pPix = PtrAddBytes(pPix, bumpmajor); \
0N/A } while (--steps > 0); \
0N/A } else { \
0N/A do { \
0N/A Xor ## DST ## PixelData(pixel, pix, pPix, 0, \
0N/A xorpixel, xor, alphamask, mask); \
0N/A if (error < 0) { \
0N/A pPix = PtrAddBytes(pPix, bumpmajor); \
0N/A error += errmajor; \
0N/A } else { \
0N/A pPix = PtrAddBytes(pPix, bumpminor); \
0N/A error -= errminor; \
0N/A } \
0N/A } while (--steps > 0); \
0N/A } \
0N/A}
0N/A
0N/A/*
0N/A * This macro is used to declare the variables needed by the glyph clipping
0N/A * macro.
0N/A */
0N/A#define DeclareDrawGlyphListClipVars(PIXELS, ROWBYTES, WIDTH, HEIGHT, \
0N/A LEFT, TOP, RIGHT, BOTTOM) \
0N/A const jubyte * PIXELS; \
0N/A int ROWBYTES; \
0N/A int LEFT, TOP; \
0N/A int WIDTH, HEIGHT; \
0N/A int RIGHT, BOTTOM;
0N/A
0N/A/*
0N/A * This macro represents the glyph clipping code used in the various
0N/A * DRAWGLYPHLIST macros. This macro is typically used within a loop. Note
0N/A * that the body of this macro is NOT wrapped in a do..while block due to
0N/A * the use of continue statements within the block (those continue statements
0N/A * are intended skip the outer loop, not the do..while loop). To combat this
0N/A * problem, pass in the code (typically a continue statement) that should be
0N/A * executed when a null glyph is encountered.
0N/A */
0N/A#define ClipDrawGlyphList(DST, PIXELS, BYTESPERPIXEL, ROWBYTES, WIDTH, HEIGHT,\
0N/A LEFT, TOP, RIGHT, BOTTOM, \
0N/A CLIPLEFT, CLIPTOP, CLIPRIGHT, CLIPBOTTOM, \
0N/A GLYPHS, GLYPHCOUNTER, NULLGLYPHCODE) \
0N/A PIXELS = (const jubyte *)GLYPHS[GLYPHCOUNTER].pixels; \
0N/A if (!PIXELS) { \
0N/A NULLGLYPHCODE; \
0N/A } \
0N/A ROWBYTES = GLYPHS[GLYPHCOUNTER].rowBytes; \
0N/A LEFT = GLYPHS[GLYPHCOUNTER].x; \
0N/A TOP = GLYPHS[GLYPHCOUNTER].y; \
0N/A WIDTH = GLYPHS[GLYPHCOUNTER].width; \
0N/A HEIGHT = GLYPHS[GLYPHCOUNTER].height; \
0N/A\
0N/A /* if any clipping required, modify parameters now */ \
0N/A RIGHT = LEFT + WIDTH; \
0N/A BOTTOM = TOP + HEIGHT; \
0N/A if (LEFT < CLIPLEFT) { \
0N/A /* Multiply needed for LCD text as PIXELS is really BYTES */ \
0N/A PIXELS += (CLIPLEFT - LEFT) * BYTESPERPIXEL ; \
0N/A LEFT = CLIPLEFT; \
0N/A } \
0N/A if (TOP < CLIPTOP) { \
0N/A PIXELS += (CLIPTOP - TOP) * ROWBYTES; \
0N/A TOP = CLIPTOP; \
0N/A } \
0N/A if (RIGHT > CLIPRIGHT) { \
0N/A RIGHT = CLIPRIGHT; \
0N/A } \
0N/A if (BOTTOM > CLIPBOTTOM) { \
0N/A BOTTOM = CLIPBOTTOM; \
0N/A } \
0N/A if (RIGHT <= LEFT || BOTTOM <= TOP) { \
0N/A NULLGLYPHCODE; \
0N/A } \
0N/A WIDTH = RIGHT - LEFT; \
0N/A HEIGHT = BOTTOM - TOP;
0N/A
0N/A#define DEFINE_SOLID_DRAWGLYPHLIST(DST) \
0N/Avoid NAME_SOLID_DRAWGLYPHLIST(DST)(SurfaceDataRasInfo *pRasInfo, \
0N/A ImageRef *glyphs, \
0N/A jint totalGlyphs, jint fgpixel, \
0N/A jint argbcolor, \
0N/A jint clipLeft, jint clipTop, \
0N/A jint clipRight, jint clipBottom, \
0N/A NativePrimitive *pPrim, \
0N/A CompositeInfo *pCompInfo) \
0N/A{ \
0N/A jint glyphCounter; \
0N/A jint scan = pRasInfo->scanStride; \
0N/A Declare ## DST ## PixelData(pix) \
0N/A DST ## DataType *pPix; \
0N/A\
0N/A Extract ## DST ## PixelData(fgpixel, pix); \
0N/A for (glyphCounter = 0; glyphCounter < totalGlyphs; glyphCounter++) { \
0N/A DeclareDrawGlyphListClipVars(pixels, rowBytes, width, height, \
0N/A left, top, right, bottom) \
0N/A ClipDrawGlyphList(DST, pixels, 1, rowBytes, width, height, \
0N/A left, top, right, bottom, \
0N/A clipLeft, clipTop, clipRight, clipBottom, \
0N/A glyphs, glyphCounter, continue) \
0N/A pPix = PtrCoord(pRasInfo->rasBase,left,DST ## PixelStride,top,scan); \
0N/A\
0N/A do { \
0N/A int x = 0; \
0N/A do { \
0N/A if (pixels[x]) { \
0N/A Store ## DST ## PixelData(pPix, x, fgpixel, pix); \
0N/A } \
0N/A } while (++x < width); \
0N/A pPix = PtrAddBytes(pPix, scan); \
0N/A pixels += rowBytes; \
0N/A } while (--height > 0); \
0N/A } \
0N/A}
0N/A
0N/A#define GlyphListAABlend3ByteRgb(DST, GLYPH_PIXELS, PIXEL_INDEX, DST_PTR, \
0N/A FG_PIXEL, PREFIX, SRC_PREFIX) \
0N/A do { \
0N/A DeclareCompVarsFor3ByteRgb(dst) \
0N/A jint mixValSrc = GLYPH_PIXELS[PIXEL_INDEX]; \
0N/A if (mixValSrc) { \
0N/A if (mixValSrc < 255) { \
0N/A jint mixValDst = 255 - mixValSrc; \
0N/A Load ## DST ## To3ByteRgb(DST_PTR, pix, PIXEL_INDEX, \
0N/A dstR, dstG, dstB); \
0N/A MultMultAddAndStore3ByteRgbComps(dst, mixValDst, dst, \
0N/A mixValSrc, SRC_PREFIX); \
0N/A Store ## DST ## From3ByteRgb(DST_PTR, pix, PIXEL_INDEX, \
0N/A dstR, dstG, dstB); \
0N/A } else { \
0N/A Store ## DST ## PixelData(DST_PTR, PIXEL_INDEX, \
0N/A FG_PIXEL, PREFIX); \
0N/A } \
0N/A } \
0N/A } while (0);
0N/A
0N/A#define GlyphListAABlend4ByteArgb(DST, GLYPH_PIXELS, PIXEL_INDEX, DST_PTR, \
0N/A FG_PIXEL, PREFIX, SRC_PREFIX) \
0N/A do { \
0N/A DeclareAlphaVarFor4ByteArgb(dstA) \
0N/A DeclareCompVarsFor4ByteArgb(dst) \
0N/A jint mixValSrc = GLYPH_PIXELS[PIXEL_INDEX]; \
0N/A if (mixValSrc) { \
0N/A if (mixValSrc < 255) { \
0N/A jint mixValDst = 255 - mixValSrc; \
0N/A Load ## DST ## To4ByteArgb(DST_PTR, pix, PIXEL_INDEX, \
0N/A dstA, dstR, dstG, dstB); \
0N/A dstA = MUL8(dstA, mixValDst) + \
0N/A MUL8(SRC_PREFIX ## A, mixValSrc); \
0N/A MultMultAddAndStore4ByteArgbComps(dst, mixValDst, dst, \
0N/A mixValSrc, SRC_PREFIX); \
300N/A if (!(DST ## IsOpaque) && \
300N/A !(DST ## IsPremultiplied) && dstA && dstA < 255) { \
300N/A DivideAndStore4ByteArgbComps(dst, dst, dstA); \
300N/A } \
300N/A Store ## DST ## From4ByteArgbComps(DST_PTR, pix, \
300N/A PIXEL_INDEX, dst); \
0N/A } else { \
0N/A Store ## DST ## PixelData(DST_PTR, PIXEL_INDEX, \
0N/A FG_PIXEL, PREFIX); \
0N/A } \
0N/A } \
0N/A } while (0);
0N/A
0N/A#define GlyphListAABlend1ByteGray(DST, GLYPH_PIXELS, PIXEL_INDEX, DST_PTR, \
0N/A FG_PIXEL, PREFIX, SRC_PREFIX) \
0N/A do { \
0N/A DeclareCompVarsFor1ByteGray(dst) \
0N/A jint mixValSrc = GLYPH_PIXELS[PIXEL_INDEX]; \
0N/A if (mixValSrc) { \
0N/A if (mixValSrc < 255) { \
0N/A jint mixValDst = 255 - mixValSrc; \
0N/A Load ## DST ## To1ByteGray(DST_PTR, pix, PIXEL_INDEX, \
0N/A dstG); \
0N/A MultMultAddAndStore1ByteGrayComps(dst, mixValDst, dst, \
0N/A mixValSrc, SRC_PREFIX); \
0N/A Store ## DST ## From1ByteGray(DST_PTR, pix, PIXEL_INDEX, \
0N/A dstG); \
0N/A } else { \
0N/A Store ## DST ## PixelData(DST_PTR, PIXEL_INDEX, \
0N/A FG_PIXEL, PREFIX); \
0N/A } \
0N/A } \
0N/A } while (0);
0N/A
0N/A#define GlyphListAABlend1ShortGray(DST, GLYPH_PIXELS, PIXEL_INDEX, DST_PTR, \
0N/A FG_PIXEL, PREFIX, SRC_PREFIX) \
0N/A do { \
0N/A DeclareCompVarsFor1ShortGray(dst) \
0N/A juint mixValSrc = GLYPH_PIXELS[PIXEL_INDEX]; \
0N/A if (mixValSrc) { \
0N/A if (mixValSrc < 255) { \
0N/A juint mixValDst; \
0N/A PromoteByteAlphaFor1ShortGray(mixValSrc); \
0N/A mixValDst = 0xffff - mixValSrc; \
0N/A Load ## DST ## To1ShortGray(DST_PTR, pix, PIXEL_INDEX, \
0N/A dstG); \
0N/A MultMultAddAndStore1ShortGrayComps(dst, mixValDst, dst, \
0N/A mixValSrc, SRC_PREFIX); \
0N/A Store ## DST ## From1ShortGray(DST_PTR, pix, PIXEL_INDEX, \
0N/A dstG); \
0N/A } else { \
0N/A Store ## DST ## PixelData(DST_PTR, PIXEL_INDEX, \
0N/A FG_PIXEL, PREFIX); \
0N/A } \
0N/A } \
0N/A } while (0);
0N/A
0N/A#define DEFINE_SOLID_DRAWGLYPHLISTAA(DST, STRATEGY) \
0N/Avoid NAME_SOLID_DRAWGLYPHLISTAA(DST)(SurfaceDataRasInfo *pRasInfo, \
0N/A ImageRef *glyphs, \
0N/A jint totalGlyphs, jint fgpixel, \
0N/A jint argbcolor, \
0N/A jint clipLeft, jint clipTop, \
0N/A jint clipRight, jint clipBottom, \
0N/A NativePrimitive *pPrim, \
0N/A CompositeInfo *pCompInfo) \
0N/A{ \
0N/A jint glyphCounter; \
0N/A jint scan = pRasInfo->scanStride; \
0N/A DST ## DataType *pPix; \
0N/A Declare ## DST ## PixelData(solidpix) \
0N/A DeclareAlphaVarFor ## STRATEGY(srcA) \
0N/A DeclareCompVarsFor ## STRATEGY(src) \
0N/A\
0N/A Declare ## DST ## LoadVars(pix) \
0N/A Declare ## DST ## StoreVars(pix) \
0N/A\
0N/A Init ## DST ## LoadVars(pix, pRasInfo); \
0N/A Init ## DST ## StoreVarsY(pix, pRasInfo); \
0N/A Init ## DST ## StoreVarsX(pix, pRasInfo); \
0N/A Extract ## STRATEGY ## CompsAndAlphaFromArgb(argbcolor, src); \
0N/A Extract ## DST ## PixelData(fgpixel, solidpix); \
0N/A\
0N/A for (glyphCounter = 0; glyphCounter < totalGlyphs; glyphCounter++) { \
0N/A DeclareDrawGlyphListClipVars(pixels, rowBytes, width, height, \
0N/A left, top, right, bottom) \
0N/A ClipDrawGlyphList(DST, pixels, 1, rowBytes, width, height, \
0N/A left, top, right, bottom, \
0N/A clipLeft, clipTop, clipRight, clipBottom, \
0N/A glyphs, glyphCounter, continue) \
0N/A pPix = PtrCoord(pRasInfo->rasBase,left,DST ## PixelStride,top,scan); \
0N/A\
0N/A Set ## DST ## StoreVarsYPos(pix, pRasInfo, top); \
0N/A do { \
0N/A int x = 0; \
0N/A Set ## DST ## StoreVarsXPos(pix, pRasInfo, left); \
0N/A do { \
0N/A GlyphListAABlend ## STRATEGY(DST, pixels, x, pPix, \
0N/A fgpixel, solidpix, src); \
0N/A Next ## DST ## StoreVarsX(pix); \
0N/A } while (++x < width); \
0N/A pPix = PtrAddBytes(pPix, scan); \
0N/A pixels += rowBytes; \
0N/A Next ## DST ## StoreVarsY(pix); \
0N/A } while (--height > 0); \
0N/A } \
0N/A}
0N/A
0N/A
0N/A#define GlyphListLCDBlend3ByteRgb(DST, GLYPH_PIXELS, PIXEL_INDEX, DST_PTR, \
0N/A FG_PIXEL, PREFIX, SRC_PREFIX) \
0N/A do { \
0N/A DeclareCompVarsFor3ByteRgb(dst) \
0N/A jint mixValSrcG = GLYPH_PIXELS[PIXEL_INDEX*3+1]; \
0N/A jint mixValSrcR, mixValSrcB; \
0N/A if (rgbOrder) { \
0N/A mixValSrcR = GLYPH_PIXELS[PIXEL_INDEX*3]; \
0N/A mixValSrcB = GLYPH_PIXELS[PIXEL_INDEX*3+2]; \
0N/A } else { \
0N/A mixValSrcR = GLYPH_PIXELS[PIXEL_INDEX*3+2]; \
0N/A mixValSrcB = GLYPH_PIXELS[PIXEL_INDEX*3]; \
0N/A } \
0N/A if ((mixValSrcR | mixValSrcG | mixValSrcB) != 0) { \
0N/A if ((mixValSrcR & mixValSrcG & mixValSrcB) < 255) { \
0N/A jint mixValDstR = 255 - mixValSrcR; \
0N/A jint mixValDstG = 255 - mixValSrcG; \
0N/A jint mixValDstB = 255 - mixValSrcB; \
0N/A Load ## DST ## To3ByteRgb(DST_PTR, pix, PIXEL_INDEX, \
0N/A dstR, dstG, dstB); \
0N/A dstR = invGammaLut[dstR]; \
0N/A dstG = invGammaLut[dstG]; \
0N/A dstB = invGammaLut[dstB]; \
0N/A MultMultAddAndStoreLCD3ByteRgbComps(dst, mixValDst, dst, \
0N/A mixValSrc, SRC_PREFIX); \
0N/A dstR = gammaLut[dstR]; \
0N/A dstG = gammaLut[dstG]; \
0N/A dstB = gammaLut[dstB]; \
0N/A Store ## DST ## From3ByteRgb(DST_PTR, pix, PIXEL_INDEX, \
0N/A dstR, dstG, dstB); \
0N/A } else { \
0N/A Store ## DST ## PixelData(DST_PTR, PIXEL_INDEX, \
0N/A FG_PIXEL, PREFIX); \
0N/A } \
0N/A } \
0N/A } while (0)
0N/A
0N/A
0N/A/* There is no alpha channel in the glyph data with which to interpolate
0N/A * between the src and dst alphas, but a reasonable approximation is to
0N/A * sum the coverage alphas of the colour channels and divide by 3.
0N/A * We can approximate division by 3 using mult and shift. See
0N/A * sun/font/scalerMethods.c for a detailed explanation of why "21931"
0N/A */
0N/A#define GlyphListLCDBlend4ByteArgb(DST, GLYPH_PIXELS, PIXEL_INDEX, DST_PTR, \
0N/A FG_PIXEL, PREFIX, SRC_PREFIX) \
0N/A do { \
0N/A DeclareAlphaVarFor4ByteArgb(dstA) \
0N/A DeclareCompVarsFor4ByteArgb(dst) \
0N/A jint mixValSrcG = GLYPH_PIXELS[PIXEL_INDEX*3+1]; \
0N/A jint mixValSrcR, mixValSrcB; \
0N/A if (rgbOrder) { \
0N/A mixValSrcR = GLYPH_PIXELS[PIXEL_INDEX*3]; \
0N/A mixValSrcB = GLYPH_PIXELS[PIXEL_INDEX*3+2]; \
0N/A } else { \
0N/A mixValSrcR = GLYPH_PIXELS[PIXEL_INDEX*3+2]; \
0N/A mixValSrcB = GLYPH_PIXELS[PIXEL_INDEX*3]; \
0N/A } \
0N/A if ((mixValSrcR | mixValSrcG | mixValSrcB) != 0) { \
0N/A if ((mixValSrcR & mixValSrcG & mixValSrcB) < 255) { \
0N/A jint mixValDstR = 255 - mixValSrcR; \
0N/A jint mixValDstG = 255 - mixValSrcG; \
0N/A jint mixValDstB = 255 - mixValSrcB; \
0N/A jint mixValSrcA = ((mixValSrcR + mixValSrcG + mixValSrcB) \
0N/A * 21931) >> 16;\
0N/A jint mixValDstA = 255 - mixValSrcA; \
0N/A Load ## DST ## To4ByteArgb(DST_PTR, pix, PIXEL_INDEX, \
0N/A dstA, dstR, dstG, dstB); \
0N/A dstR = invGammaLut[dstR]; \
0N/A dstG = invGammaLut[dstG]; \
0N/A dstB = invGammaLut[dstB]; \
0N/A dstA = MUL8(dstA, mixValDstA) + \
0N/A MUL8(SRC_PREFIX ## A, mixValSrcA); \
0N/A MultMultAddAndStoreLCD4ByteArgbComps(dst, mixValDst, dst, \
0N/A mixValSrc, SRC_PREFIX); \
0N/A dstR = gammaLut[dstR]; \
0N/A dstG = gammaLut[dstG]; \
0N/A dstB = gammaLut[dstB]; \
300N/A if (!(DST ## IsOpaque) && \
300N/A !(DST ## IsPremultiplied) && dstA && dstA < 255) { \
300N/A DivideAndStore4ByteArgbComps(dst, dst, dstA); \
300N/A } \
300N/A Store ## DST ## From4ByteArgbComps(DST_PTR, pix, \
300N/A PIXEL_INDEX, dst); \
0N/A } else { \
0N/A Store ## DST ## PixelData(DST_PTR, PIXEL_INDEX, \
0N/A FG_PIXEL, PREFIX); \
0N/A } \
0N/A } \
0N/A } while (0);
0N/A
0N/A#define DEFINE_SOLID_DRAWGLYPHLISTLCD(DST, STRATEGY) \
0N/Avoid NAME_SOLID_DRAWGLYPHLISTLCD(DST)(SurfaceDataRasInfo *pRasInfo, \
0N/A ImageRef *glyphs, \
0N/A jint totalGlyphs, jint fgpixel, \
0N/A jint argbcolor, \
0N/A jint clipLeft, jint clipTop, \
0N/A jint clipRight, jint clipBottom, \
0N/A jint rgbOrder, \
0N/A unsigned char *gammaLut, \
0N/A unsigned char * invGammaLut, \
0N/A NativePrimitive *pPrim, \
0N/A CompositeInfo *pCompInfo) \
0N/A{ \
0N/A jint glyphCounter, bpp; \
0N/A jint scan = pRasInfo->scanStride; \
0N/A DST ## DataType *pPix; \
0N/A Declare ## DST ## PixelData(solidpix) \
0N/A DeclareAlphaVarFor ## STRATEGY(srcA) \
0N/A DeclareCompVarsFor ## STRATEGY(src) \
0N/A\
0N/A Declare ## DST ## LoadVars(pix) \
0N/A Declare ## DST ## StoreVars(pix) \
0N/A\
0N/A Init ## DST ## LoadVars(pix, pRasInfo); \
0N/A Init ## DST ## StoreVarsY(pix, pRasInfo); \
0N/A Init ## DST ## StoreVarsX(pix, pRasInfo); \
0N/A Extract ## STRATEGY ## CompsAndAlphaFromArgb(argbcolor, src); \
0N/A Extract ## DST ## PixelData(fgpixel, solidpix); \
0N/A srcR = invGammaLut[srcR]; \
0N/A srcG = invGammaLut[srcG]; \
0N/A srcB = invGammaLut[srcB]; \
0N/A\
0N/A for (glyphCounter = 0; glyphCounter < totalGlyphs; glyphCounter++) { \
0N/A DeclareDrawGlyphListClipVars(pixels, rowBytes, width, height, \
0N/A left, top, right, bottom) \
0N/A bpp = \
0N/A (glyphs[glyphCounter].rowBytes == glyphs[glyphCounter].width) ? 1 : 3;\
0N/A ClipDrawGlyphList(DST, pixels, bpp, rowBytes, width, height, \
0N/A left, top, right, bottom, \
0N/A clipLeft, clipTop, clipRight, clipBottom, \
0N/A glyphs, glyphCounter, continue) \
0N/A pPix = PtrCoord(pRasInfo->rasBase,left,DST ## PixelStride,top,scan); \
0N/A\
0N/A Set ## DST ## StoreVarsYPos(pix, pRasInfo, top); \
0N/A if (bpp!=1) { \
0N/A /* subpixel positioning adjustment */ \
0N/A pixels += glyphs[glyphCounter].rowBytesOffset; \
0N/A } \
0N/A do { \
0N/A int x = 0; \
0N/A Set ## DST ## StoreVarsXPos(pix, pRasInfo, left); \
0N/A if (bpp==1) { \
0N/A do { \
0N/A if (pixels[x]) { \
0N/A Store ## DST ## PixelData(pPix, x, fgpixel, solidpix);\
0N/A } \
0N/A } while (++x < width); \
0N/A } else { \
0N/A do { \
0N/A GlyphListLCDBlend ## STRATEGY(DST, pixels, x, pPix, \
0N/A fgpixel, solidpix, src); \
0N/A Next ## DST ## StoreVarsX(pix); \
0N/A } while (++x < width); \
0N/A } \
0N/A pPix = PtrAddBytes(pPix, scan); \
0N/A pixels += rowBytes; \
0N/A Next ## DST ## StoreVarsY(pix); \
0N/A } while (--height > 0); \
0N/A } \
0N/A}
0N/A
0N/A#define DEFINE_XOR_DRAWGLYPHLIST(DST) \
0N/Avoid NAME_XOR_DRAWGLYPHLIST(DST)(SurfaceDataRasInfo *pRasInfo, \
0N/A ImageRef *glyphs, \
0N/A jint totalGlyphs, jint fgpixel, \
0N/A jint argbcolor, \
0N/A jint clipLeft, jint clipTop, \
0N/A jint clipRight, jint clipBottom, \
0N/A NativePrimitive *pPrim, \
0N/A CompositeInfo *pCompInfo) \
0N/A{ \
0N/A jint glyphCounter; \
0N/A jint scan = pRasInfo->scanStride; \
0N/A jint xorpixel = pCompInfo->details.xorPixel; \
0N/A juint alphamask = pCompInfo->alphaMask; \
0N/A Declare ## DST ## PixelData(xor) \
0N/A Declare ## DST ## PixelData(pix) \
0N/A Declare ## DST ## PixelData(mask) \
0N/A DST ## DataType *pPix; \
0N/A \
0N/A Extract ## DST ## PixelData(xorpixel, xor); \
0N/A Extract ## DST ## PixelData(fgpixel, pix); \
0N/A Extract ## DST ## PixelData(alphamask, mask); \
0N/A for (glyphCounter = 0; glyphCounter < totalGlyphs; glyphCounter++) { \
0N/A DeclareDrawGlyphListClipVars(pixels, rowBytes, width, height, \
0N/A left, top, right, bottom) \
0N/A ClipDrawGlyphList(DST, pixels, 1, rowBytes, width, height, \
0N/A left, top, right, bottom, \
0N/A clipLeft, clipTop, clipRight, clipBottom, \
0N/A glyphs, glyphCounter, continue) \
0N/A pPix = PtrCoord(pRasInfo->rasBase,left,DST ## PixelStride,top,scan); \
0N/A \
0N/A do { \
0N/A int x = 0; \
0N/A do { \
0N/A if (pixels[x]) { \
0N/A Xor ## DST ## PixelData(fgpixel, pix, pPix, x, \
0N/A xorpixel, xor, alphamask, mask); \
0N/A } \
0N/A } while (++x < width); \
0N/A pPix = PtrAddBytes(pPix, scan); \
0N/A pixels += rowBytes; \
0N/A } while (--height > 0); \
0N/A } \
0N/A}
0N/A
0N/A#define DEFINE_TRANSFORMHELPER_NN(SRC) \
0N/Avoid NAME_TRANSFORMHELPER_NN(SRC)(SurfaceDataRasInfo *pSrcInfo, \
0N/A jint *pRGB, jint numpix, \
0N/A jlong xlong, jlong dxlong, \
0N/A jlong ylong, jlong dylong) \
0N/A{ \
0N/A Declare ## SRC ## LoadVars(SrcRead) \
0N/A SRC ## DataType *pBase = pSrcInfo->rasBase; \
0N/A jint scan = pSrcInfo->scanStride; \
0N/A jint *pEnd = pRGB + numpix; \
0N/A \
0N/A xlong += IntToLong(pSrcInfo->bounds.x1); \
0N/A ylong += IntToLong(pSrcInfo->bounds.y1); \
0N/A \
0N/A Init ## SRC ## LoadVars(SrcRead, pSrcInfo); \
0N/A while (pRGB < pEnd) { \
0N/A SRC ## DataType *pRow = PtrAddBytes(pBase, WholeOfLong(ylong) * scan); \
0N/A Copy ## SRC ## ToIntArgbPre(pRGB, 0, \
0N/A SrcRead, pRow, WholeOfLong(xlong)); \
0N/A pRGB++; \
0N/A xlong += dxlong; \
0N/A ylong += dylong; \
0N/A } \
0N/A}
0N/A
0N/A#define DEFINE_TRANSFORMHELPER_BL(SRC) \
0N/Avoid NAME_TRANSFORMHELPER_BL(SRC)(SurfaceDataRasInfo *pSrcInfo, \
0N/A jint *pRGB, jint numpix, \
0N/A jlong xlong, jlong dxlong, \
0N/A jlong ylong, jlong dylong) \
0N/A{ \
0N/A Declare ## SRC ## LoadVars(SrcRead) \
0N/A jint scan = pSrcInfo->scanStride; \
0N/A jint cx, cy, cw, ch; \
0N/A jint *pEnd = pRGB + numpix*4; \
0N/A \
0N/A cx = pSrcInfo->bounds.x1; \
0N/A cw = pSrcInfo->bounds.x2-cx; \
0N/A \
0N/A cy = pSrcInfo->bounds.y1; \
0N/A ch = pSrcInfo->bounds.y2-cy; \
0N/A \
0N/A xlong -= LongOneHalf; \
0N/A ylong -= LongOneHalf; \
0N/A \
0N/A Init ## SRC ## LoadVars(SrcRead, pSrcInfo); \
0N/A while (pRGB < pEnd) { \
0N/A jint xwhole = WholeOfLong(xlong); \
0N/A jint ywhole = WholeOfLong(ylong); \
0N/A jint xdelta, ydelta, isneg; \
0N/A SRC ## DataType *pRow; \
0N/A \
0N/A xdelta = ((juint) (xwhole + 1 - cw)) >> 31; \
0N/A isneg = xwhole >> 31; \
0N/A xwhole -= isneg; \
0N/A xdelta += isneg; \
0N/A \
0N/A ydelta = ((ywhole + 1 - ch) >> 31); \
0N/A isneg = ywhole >> 31; \
0N/A ywhole -= isneg; \
0N/A ydelta -= isneg; \
0N/A ydelta &= scan; \
0N/A \
0N/A xwhole += cx; \
0N/A pRow = PtrAddBytes(pSrcInfo->rasBase, (ywhole + cy) * scan); \
0N/A Copy ## SRC ## ToIntArgbPre(pRGB, 0, SrcRead, pRow, xwhole); \
0N/A Copy ## SRC ## ToIntArgbPre(pRGB, 1, SrcRead, pRow, xwhole+xdelta); \
0N/A pRow = PtrAddBytes(pRow, ydelta); \
0N/A Copy ## SRC ## ToIntArgbPre(pRGB, 2, SrcRead, pRow, xwhole); \
0N/A Copy ## SRC ## ToIntArgbPre(pRGB, 3, SrcRead, pRow, xwhole+xdelta); \
0N/A \
0N/A pRGB += 4; \
0N/A xlong += dxlong; \
0N/A ylong += dylong; \
0N/A } \
0N/A}
0N/A
0N/A#define DEFINE_TRANSFORMHELPER_BC(SRC) \
0N/Avoid NAME_TRANSFORMHELPER_BC(SRC)(SurfaceDataRasInfo *pSrcInfo, \
0N/A jint *pRGB, jint numpix, \
0N/A jlong xlong, jlong dxlong, \
0N/A jlong ylong, jlong dylong) \
0N/A{ \
0N/A Declare ## SRC ## LoadVars(SrcRead) \
0N/A jint scan = pSrcInfo->scanStride; \
0N/A jint cx, cy, cw, ch; \
0N/A jint *pEnd = pRGB + numpix*16; \
0N/A \
0N/A cx = pSrcInfo->bounds.x1; \
0N/A cw = pSrcInfo->bounds.x2-cx; \
0N/A \
0N/A cy = pSrcInfo->bounds.y1; \
0N/A ch = pSrcInfo->bounds.y2-cy; \
0N/A \
0N/A xlong -= LongOneHalf; \
0N/A ylong -= LongOneHalf; \
0N/A \
0N/A Init ## SRC ## LoadVars(SrcRead, pSrcInfo); \
0N/A while (pRGB < pEnd) { \
0N/A jint xwhole = WholeOfLong(xlong); \
0N/A jint ywhole = WholeOfLong(ylong); \
0N/A jint xdelta0, xdelta1, xdelta2; \
0N/A jint ydelta0, ydelta1, ydelta2; \
0N/A jint isneg; \
0N/A SRC ## DataType *pRow; \
0N/A \
0N/A xdelta0 = (-xwhole) >> 31; \
0N/A xdelta1 = ((juint) (xwhole + 1 - cw)) >> 31; \
0N/A xdelta2 = ((juint) (xwhole + 2 - cw)) >> 31; \
0N/A isneg = xwhole >> 31; \
0N/A xwhole -= isneg; \
0N/A xdelta1 += isneg; \
0N/A xdelta2 += xdelta1; \
0N/A \
0N/A ydelta0 = ((-ywhole) >> 31) & (-scan); \
0N/A ydelta1 = ((ywhole + 1 - ch) >> 31) & scan; \
0N/A ydelta2 = ((ywhole + 2 - ch) >> 31) & scan; \
0N/A isneg = ywhole >> 31; \
0N/A ywhole -= isneg; \
0N/A ydelta1 += (isneg & -scan); \
0N/A \
0N/A xwhole += cx; \
0N/A pRow = PtrAddBytes(pSrcInfo->rasBase, (ywhole + cy) * scan); \
0N/A pRow = PtrAddBytes(pRow, ydelta0); \
0N/A Copy ## SRC ## ToIntArgbPre(pRGB, 0, SrcRead, pRow, xwhole+xdelta0); \
0N/A Copy ## SRC ## ToIntArgbPre(pRGB, 1, SrcRead, pRow, xwhole ); \
0N/A Copy ## SRC ## ToIntArgbPre(pRGB, 2, SrcRead, pRow, xwhole+xdelta1); \
0N/A Copy ## SRC ## ToIntArgbPre(pRGB, 3, SrcRead, pRow, xwhole+xdelta2); \
0N/A pRow = PtrAddBytes(pRow, -ydelta0); \
0N/A Copy ## SRC ## ToIntArgbPre(pRGB, 4, SrcRead, pRow, xwhole+xdelta0); \
0N/A Copy ## SRC ## ToIntArgbPre(pRGB, 5, SrcRead, pRow, xwhole ); \
0N/A Copy ## SRC ## ToIntArgbPre(pRGB, 6, SrcRead, pRow, xwhole+xdelta1); \
0N/A Copy ## SRC ## ToIntArgbPre(pRGB, 7, SrcRead, pRow, xwhole+xdelta2); \
0N/A pRow = PtrAddBytes(pRow, ydelta1); \
0N/A Copy ## SRC ## ToIntArgbPre(pRGB, 8, SrcRead, pRow, xwhole+xdelta0); \
0N/A Copy ## SRC ## ToIntArgbPre(pRGB, 9, SrcRead, pRow, xwhole ); \
0N/A Copy ## SRC ## ToIntArgbPre(pRGB, 10, SrcRead, pRow, xwhole+xdelta1); \
0N/A Copy ## SRC ## ToIntArgbPre(pRGB, 11, SrcRead, pRow, xwhole+xdelta2); \
0N/A pRow = PtrAddBytes(pRow, ydelta2); \
0N/A Copy ## SRC ## ToIntArgbPre(pRGB, 12, SrcRead, pRow, xwhole+xdelta0); \
0N/A Copy ## SRC ## ToIntArgbPre(pRGB, 13, SrcRead, pRow, xwhole ); \
0N/A Copy ## SRC ## ToIntArgbPre(pRGB, 14, SrcRead, pRow, xwhole+xdelta1); \
0N/A Copy ## SRC ## ToIntArgbPre(pRGB, 15, SrcRead, pRow, xwhole+xdelta2); \
0N/A \
0N/A pRGB += 16; \
0N/A xlong += dxlong; \
0N/A ylong += dylong; \
0N/A } \
0N/A}
0N/A
0N/A#define DEFINE_TRANSFORMHELPER_FUNCS(SRC) \
0N/A TransformHelperFuncs NAME_TRANSFORMHELPER_FUNCS(SRC) = { \
0N/A NAME_TRANSFORMHELPER_NN(SRC), \
0N/A NAME_TRANSFORMHELPER_BL(SRC), \
0N/A NAME_TRANSFORMHELPER_BC(SRC), \
0N/A };
0N/A
0N/A#define DEFINE_TRANSFORMHELPERS(SRC) \
0N/A DEFINE_TRANSFORMHELPER_NN(SRC) \
0N/A DEFINE_TRANSFORMHELPER_BL(SRC) \
0N/A DEFINE_TRANSFORMHELPER_BC(SRC) \
0N/A DEFINE_TRANSFORMHELPER_FUNCS(SRC)
0N/A
0N/A/*
0N/A * The macros defined above use the following macro definitions supplied
0N/A * for the various surface types to manipulate pixels and pixel data.
0N/A * The surface-specific macros are typically supplied by header files
0N/A * named after the SurfaceType name (i.e. IntArgb.h, ByteGray.h, etc.).
0N/A *
0N/A * In the macro names in the following definitions, the string <stype>
0N/A * is used as a place holder for the SurfaceType name (i.e. IntArgb).
0N/A * The macros above access these type specific macros using the ANSI
0N/A * CPP token concatenation operator "##".
0N/A *
0N/A * <stype>DataType A typedef for the type of the pointer
0N/A * that is used to access the raster data
0N/A * for the given surface type.
0N/A * <stype>PixelStride Pixel stride for the surface type.
0N/A *
0N/A * Declare<stype>LoadVars Declare the variables needed to control
0N/A * loading color information from an stype
0N/A * raster (i.e. lookup tables).
0N/A * Init<stype>LoadVars Init the lookup table variables.
0N/A * Declare<stype>StoreVars Declare the storage variables needed to
0N/A * control storing pixel data based on the
0N/A * pixel coordinate (i.e. dithering variables).
0N/A * Init<stype>StoreVarsY Init the dither variables for starting Y.
0N/A * Next<stype>StoreVarsY Increment the dither variables for next Y.
0N/A * Init<stype>StoreVarsX Init the dither variables for starting X.
0N/A * Next<stype>StoreVarsX Increment the dither variables for next X.
0N/A *
0N/A * Load<stype>To1IntRgb Load a pixel and form an INT_RGB integer.
0N/A * Store<stype>From1IntRgb Store a pixel from an INT_RGB integer.
0N/A * Load<stype>To1IntArgb Load a pixel and form an INT_ARGB integer.
0N/A * Store<stype>From1IntArgb Store a pixel from an INT_ARGB integer.
0N/A * Load<stype>To3ByteRgb Load a pixel into R, G, and B components.
0N/A * Store<stype>From3ByteRgb Store a pixel from R, G, and B components.
0N/A * Load<stype>To4ByteArgb Load a pixel into A, R, G, and B components.
0N/A * Store<stype>From4ByteArgb Store a pixel from A, R, G, and B components.
0N/A * Load<stype>To1ByteGray Load a pixel and form a BYTE_GRAY byte.
0N/A * Store<stype>From1ByteGray Store a pixel from a BYTE_GRAY byte.
0N/A *
0N/A * <stype>PixelType Typedef for a "single quantity pixel" (SQP)
0N/A * that can hold the data for one stype pixel.
0N/A * <stype>XparLutEntry An SQP that can be used to represent a
0N/A * transparent pixel for stype.
0N/A * Store<stype>NonXparFromArgb Store an SQP from an INT_ARGB integer in
0N/A * such a way that it would not be confused
0N/A * with the XparLutEntry value for stype.
0N/A * <stype>IsXparLutEntry Test an SQP for the XparLutEntry value.
0N/A * Store<stype>Pixel Store the pixel data from an SQP.
0N/A * <stype>PixelFromArgb Converts an INT_ARGB value into the specific
0N/A * pixel representation for the surface type.
0N/A *
0N/A * Declare<stype>PixelData Declare the pixel data variables (PDV) needed
0N/A * to hold the elements of pixel data ready to
0N/A * store into an stype raster (may be empty for
0N/A * stypes whose SQP format is their data format).
0N/A * Extract<stype>PixelData Extract an SQP value into the PDVs.
0N/A * Store<stype>PixelData Store the PDVs into an stype raster.
0N/A * XorCopy<stype>PixelData Xor the PDVs into an stype raster.
0N/A */
0N/A#endif /* LoopMacros_h_Included */