0N/A/*
2362N/A * Copyright (c) 2000, 2008, 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 Ushort555Rgbx_h_Included
0N/A#define Ushort555Rgbx_h_Included
0N/A
0N/A/*
0N/A * This file contains macro and type definitions used by the macros in
0N/A * LoopMacros.h to manipulate a surface of type "Ushort555Rgbx".
0N/A */
0N/A
0N/Atypedef jushort Ushort555RgbxPixelType;
0N/Atypedef jushort Ushort555RgbxDataType;
0N/A
300N/A#define Ushort555RgbxIsOpaque 1
300N/A
0N/A#define Ushort555RgbxPixelStride 2
0N/A
0N/A#define DeclareUshort555RgbxLoadVars(PREFIX)
0N/A#define DeclareUshort555RgbxStoreVars(PREFIX)
0N/A#define SetUshort555RgbxStoreVarsYPos(PREFIX, pRasInfo, y)
0N/A#define SetUshort555RgbxStoreVarsXPos(PREFIX, pRasInfo, x)
0N/A#define InitUshort555RgbxLoadVars(PREFIX, pRasInfo)
0N/A#define InitUshort555RgbxStoreVarsY(PREFIX, pRasInfo)
0N/A#define InitUshort555RgbxStoreVarsX(PREFIX, pRasInfo)
0N/A#define NextUshort555RgbxStoreVarsX(PREFIX)
0N/A#define NextUshort555RgbxStoreVarsY(PREFIX)
0N/A#define DeclareUshort555RgbxPixelData(PREFIX)
0N/A#define ExtractUshort555RgbxPixelData(PIXEL, PREFIX)
0N/A
0N/A#define Ushort555RgbxXparLutEntry -1
0N/A#define Ushort555RgbxIsXparLutEntry(pix) (pix < 0)
0N/A#define StoreUshort555RgbxNonXparFromArgb StoreUshort555RgbxFrom1IntArgb
0N/A
0N/A
0N/A#define IntArgbToUshort555Rgbx(rgb) \
0N/A (Ushort555RgbxPixelType)((((rgb) >> (16 + 3 - 11)) & 0xf800) | \
0N/A (((rgb) >> ( 8 + 3 - 6)) & 0x07c0) | \
0N/A (((rgb) >> ( 0 + 3 - 1)) & 0x003e))
0N/A
0N/A#define Ushort555RgbxPixelFromArgb(pixel, rgb, pRasInfo) \
0N/A (pixel) = IntArgbToUshort555Rgbx(rgb)
0N/A
0N/A#define StoreUshort555RgbxPixel(pRas, x, pixel) \
0N/A ((pRas)[x] = (jushort) (pixel))
0N/A
0N/A#define StoreUshort555RgbxPixelData(pPix, x, pixel, PREFIX) \
0N/A StoreUshort555RgbxPixel(pPix, x, pixel)
0N/A
0N/A
0N/A#define LoadUshort555RgbxTo3ByteRgb(pRas, PREFIX, x, r, g, b) \
0N/A do { \
0N/A jushort pixel = (pRas)[x]; \
0N/A (r) = ((pixel) >> 11) & 0x1f; \
0N/A (r) = ((r) << 3) | ((r) >> 2); \
0N/A (g) = ((pixel) >> 6) & 0x1f; \
0N/A (g) = ((g) << 3) | ((g) >> 2); \
0N/A (b) = ((pixel) >> 1) & 0x1f; \
0N/A (b) = ((b) << 3) | ((b) >> 2); \
0N/A } while (0)
0N/A
0N/A#define LoadUshort555RgbxTo4ByteArgb(pRas, PREFIX, x, a, r, g, b) \
0N/A do { \
0N/A LoadUshort555RgbxTo3ByteRgb(pRas, PREFIX, x, r, g, b) \
0N/A (a) = 0xff; \
0N/A } while (0)
0N/A
0N/A#define StoreUshort555RgbxFrom1IntArgb(pRas, PREFIX, x, rgb) \
0N/A (pRas)[x] = IntArgbToUshort555Rgbx(rgb)
0N/A
0N/A#define StoreUshort555RgbxFrom1IntRgb(pRas, PREFIX, x, rgb) \
0N/A StoreUshort555RgbxFrom1IntArgb(pRas, PREFIX, x, rgb)
0N/A
0N/A#define StoreUshort555RgbxFrom3ByteRgb(pRas, PREFIX, x, r, g, b) \
0N/A (pRas)[x] = (jushort) ((((r) >> 3) << 11) | \
0N/A (((g) >> 3) << 6) | \
0N/A (((b) >> 3) << 1))
0N/A
0N/A#define StoreUshort555RgbxFrom4ByteArgb(pRas, PREFIX, x, a, r, g, b) \
0N/A StoreUshort555RgbxFrom3ByteRgb(pRas, PREFIX, x, r, g, b)
0N/A
0N/A#endif /* Ushort555Rgbx_h_Included */