Path: blob/aarch64-shenandoah-jdk8u272-b10/jdk/src/solaris/native/sun/awt/img_util_md.h
32287 views
/*1* Copyright (c) 1996, 2014, Oracle and/or its affiliates. All rights reserved.2* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.3*4* This code is free software; you can redistribute it and/or modify it5* under the terms of the GNU General Public License version 2 only, as6* published by the Free Software Foundation. Oracle designates this7* particular file as subject to the "Classpath" exception as provided8* by Oracle in the LICENSE file that accompanied this code.9*10* This code is distributed in the hope that it will be useful, but WITHOUT11* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or12* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License13* version 2 for more details (a copy is included in the LICENSE file that14* accompanied this code).15*16* You should have received a copy of the GNU General Public License version17* 2 along with this work; if not, write to the Free Software Foundation,18* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.19*20* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA21* or visit www.oracle.com if you need additional information or have any22* questions.23*/2425#include "color.h"2627#if !defined(HEADLESS) && !defined(MACOSX)28typedef struct {29ImgConvertData cvdata; /* The data needed by ImgConvertFcn's */30struct Hsun_awt_image_ImageRepresentation *hJavaObject; /* backptr */31XID pixmap; /* The X11 pixmap containing the image */32XID mask; /* The X11 pixmap with the transparency mask */33int bgcolor; /* The current bg color installed in pixmap */3435int depth; /* The depth of the destination image */36int dstW; /* The width of the destination pixmap */37int dstH; /* The height of the destination pixmap */3839XImage *xim; /* The Ximage structure for the temp buffer */40XImage *maskim; /* The Ximage structure for the mask */4142int hints; /* The delivery hints from the producer */4344Region curpixels; /* The region of randomly converted pixels */45struct {46int num; /* The last fully delivered scanline */47char *seen; /* The lines which have been delivered */48} curlines; /* For hints=COMPLETESCANLINES */49} IRData;5051typedef unsigned int MaskBits;5253extern int image_Done(IRData *ird, int x1, int y1, int x2, int y2);5455extern void *image_InitMask(IRData *ird, int x1, int y1, int x2, int y2);5657#define BufComplete(cvdata, dstX1, dstY1, dstX2, dstY2) \58image_Done((IRData *) cvdata, dstX1, dstY1, dstX2, dstY2)5960#define SendRow(ird, dstY, dstX1, dstX2)6162#define ImgInitMask(cvdata, x1, y1, x2, y2) \63image_InitMask((IRData *)cvdata, x1, y1, x2, y2)6465#define ScanBytes(cvdata) (((IRData *)cvdata)->xim->bytes_per_line)6667#define MaskScan(cvdata) \68((((IRData *)cvdata)->maskim->bytes_per_line) >> 2)6970#endif /* !HEADLESS && !MACOSX */7172#define MaskOffset(x) ((x) >> 5)7374#define MaskInit(x) (1U << (31 - ((x) & 31)))7576#define SetOpaqueBit(mask, bit) ((mask) |= (bit))77#define SetTransparentBit(mask, bit) ((mask) &= ~(bit))7879#define UCHAR_ARG(uc) ((unsigned char)(uc))80#define ColorCubeFSMap(r, g, b) \81cData->img_clr_tbl [ ((UCHAR_ARG(r)>>3)<<10) | \82((UCHAR_ARG(g)>>3)<<5) | (UCHAR_ARG(b)>>3)]8384#define ColorCubeOrdMapSgn(r, g, b) \85((dstLockInfo.inv_cmap)[ ((UCHAR_ARG(r)>>3)<<10) | \86((UCHAR_ARG(g)>>3)<<5) | (UCHAR_ARG(b)>>3)])8788#define GetPixelRGB(pixel, red, green, blue) \89do { \90ColorEntry *cp = &awt_Colors[pixel]; \91red = cp->r; \92green = cp->g; \93blue = cp->b; \94} while (0)9596#define CUBEMAP(r,g,b) ColorCubeOrdMapSgn(r, g, b)97#define cubemapArray 19899extern uns_ordered_dither_array img_oda_alpha;100101extern void freeICMColorData(ColorData *pData);102103extern void initInverseGrayLut(int* prgb, int rgbsize, ColorData* cData);104extern unsigned char* initCubemap(int* cmap, int cmap_len, int cube_dim);105extern void initDitherTables(ColorData* cData);106107#define SET_CUBEMAPARRAY \108lockInfo->inv_cmap = (const char*)lockInfo->colorData->img_clr_tbl109110111