0N/A/*
2362N/A * Copyright (c) 1996, 2001, 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#include "color.h"
0N/A
0N/A#ifndef HEADLESS
0N/Atypedef struct {
0N/A ImgConvertData cvdata; /* The data needed by ImgConvertFcn's */
0N/A struct Hsun_awt_image_ImageRepresentation *hJavaObject; /* backptr */
0N/A XID pixmap; /* The X11 pixmap containing the image */
0N/A XID mask; /* The X11 pixmap with the transparency mask */
0N/A int bgcolor; /* The current bg color installed in pixmap */
0N/A
0N/A int depth; /* The depth of the destination image */
0N/A int dstW; /* The width of the destination pixmap */
0N/A int dstH; /* The height of the destination pixmap */
0N/A
0N/A XImage *xim; /* The Ximage structure for the temp buffer */
0N/A XImage *maskim; /* The Ximage structure for the mask */
0N/A
0N/A int hints; /* The delivery hints from the producer */
0N/A
0N/A Region curpixels; /* The region of randomly converted pixels */
0N/A struct {
0N/A int num; /* The last fully delivered scanline */
0N/A char *seen; /* The lines which have been delivered */
0N/A } curlines; /* For hints=COMPLETESCANLINES */
0N/A} IRData;
0N/A
0N/Atypedef unsigned int MaskBits;
0N/A
0N/Aextern int image_Done(IRData *ird, int x1, int y1, int x2, int y2);
0N/A
0N/Aextern void *image_InitMask(IRData *ird, int x1, int y1, int x2, int y2);
0N/A
0N/A#define BufComplete(cvdata, dstX1, dstY1, dstX2, dstY2) \
0N/A image_Done((IRData *) cvdata, dstX1, dstY1, dstX2, dstY2)
0N/A
0N/A#define SendRow(ird, dstY, dstX1, dstX2)
0N/A
0N/A#define ImgInitMask(cvdata, x1, y1, x2, y2) \
0N/A image_InitMask((IRData *)cvdata, x1, y1, x2, y2)
0N/A
0N/A#define ScanBytes(cvdata) (((IRData *)cvdata)->xim->bytes_per_line)
0N/A
0N/A#define MaskScan(cvdata) \
0N/A ((((IRData *)cvdata)->maskim->bytes_per_line) >> 2)
0N/A
0N/A#endif /* !HEADLESS */
0N/A
0N/A#define MaskOffset(x) ((x) >> 5)
0N/A
0N/A#define MaskInit(x) (1U << (31 - ((x) & 31)))
0N/A
0N/A#define SetOpaqueBit(mask, bit) ((mask) |= (bit))
0N/A#define SetTransparentBit(mask, bit) ((mask) &= ~(bit))
0N/A
0N/A#define UCHAR_ARG(uc) ((unsigned char)(uc))
0N/A#define ColorCubeFSMap(r, g, b) \
0N/A cData->img_clr_tbl [ ((UCHAR_ARG(r)>>3)<<10) | \
0N/A ((UCHAR_ARG(g)>>3)<<5) | (UCHAR_ARG(b)>>3)]
0N/A
0N/A#define ColorCubeOrdMapSgn(r, g, b) \
0N/A ((dstLockInfo.inv_cmap)[ ((UCHAR_ARG(r)>>3)<<10) | \
0N/A ((UCHAR_ARG(g)>>3)<<5) | (UCHAR_ARG(b)>>3)])
0N/A
0N/A#define GetPixelRGB(pixel, red, green, blue) \
0N/A do { \
0N/A ColorEntry *cp = &awt_Colors[pixel]; \
0N/A red = cp->r; \
0N/A green = cp->g; \
0N/A blue = cp->b; \
0N/A } while (0)
0N/A
0N/A#define CUBEMAP(r,g,b) ColorCubeOrdMapSgn(r, g, b)
0N/A#define cubemapArray 1
0N/A
0N/Aextern uns_ordered_dither_array img_oda_alpha;
0N/A
0N/Aextern void freeICMColorData(ColorData *pData);
0N/A
0N/Aextern void initInverseGrayLut(int* prgb, int rgbsize, ColorData* cData);
0N/Aextern unsigned char* initCubemap(int* cmap, int cmap_len, int cube_dim);
0N/Aextern void initDitherTables(ColorData* cData);
0N/A
0N/A#define SET_CUBEMAPARRAY \
0N/A lockInfo->inv_cmap = (const char*)lockInfo->colorData->img_clr_tbl