0N/A/*
0N/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
0N/A * published by the Free Software Foundation. Oracle designates this
0N/A * particular file as subject to the "Classpath" exception as provided
0N/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 *
0N/A * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
0N/A * or visit www.oracle.com if you need additional information or have any
0N/A * questions.
0N/A */
0N/A
0N/A#ifndef Ushort565Rgb_h_Included
0N/A#define Ushort565Rgb_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 "Ushort565Rgb".
0N/A */
0N/A
0N/Atypedef jushort Ushort565RgbPixelType;
0N/Atypedef jushort Ushort565RgbDataType;
0N/A
0N/A#define Ushort565RgbIsOpaque 1
0N/A
0N/A#define Ushort565RgbPixelStride 2
0N/A
0N/A#define DeclareUshort565RgbLoadVars(PREFIX)
0N/A#define DeclareUshort565RgbStoreVars(PREFIX)
0N/A#define SetUshort565RgbStoreVarsYPos(PREFIX, pRasInfo, y)
0N/A#define SetUshort565RgbStoreVarsXPos(PREFIX, pRasInfo, x)
0N/A#define InitUshort565RgbLoadVars(PREFIX, pRasInfo)
0N/A#define InitUshort565RgbStoreVarsY(PREFIX, pRasInfo)
0N/A#define InitUshort565RgbStoreVarsX(PREFIX, pRasInfo)
0N/A#define NextUshort565RgbStoreVarsX(PREFIX)
0N/A#define NextUshort565RgbStoreVarsY(PREFIX)
0N/A#define DeclareUshort565RgbPixelData(PREFIX)
0N/A#define ExtractUshort565RgbPixelData(PIXEL, PREFIX)
0N/A
0N/A#define Ushort565RgbXparLutEntry -1
0N/A#define Ushort565RgbIsXparLutEntry(pix) (pix < 0)
0N/A#define StoreUshort565RgbNonXparFromArgb StoreUshort565RgbFrom1IntArgb
0N/A
0N/A
0N/A#define ComposeUshort565RgbFrom3ByteRgb(r, g, b) \
0N/A (Ushort565RgbPixelType)((((r) >> 3) << 11) | \
0N/A (((g) >> 2) << 5) | \
0N/A (((b) >> 3) << 0))
0N/A
0N/A#define IntArgbToUshort565Rgb(rgb) \
0N/A (Ushort565RgbPixelType)((((rgb) >> (16 + 3 - 11)) & 0xf800) | \
0N/A (((rgb) >> ( 8 + 2 - 5)) & 0x07e0) | \
0N/A (((rgb) >> ( 0 + 3 - 0)) & 0x001f))
0N/A
0N/A#define Ushort565RgbPixelFromArgb(pixel, rgb, pRasInfo) \
0N/A (pixel) = IntArgbToUshort565Rgb(rgb)
0N/A
0N/A#define StoreUshort565RgbPixel(pRas, x, pixel) \
0N/A ((pRas)[x] = (jushort) (pixel))
0N/A
0N/A#define StoreUshort565RgbPixelData(pPix, x, pixel, PREFIX) \
0N/A StoreUshort565RgbPixel(pPix, x, pixel)
0N/A
0N/A
0N/A#define LoadUshort565RgbTo3ByteRgb(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) >> 5) & 0x3f; \
0N/A (g) = ((g) << 2) | ((g) >> 4); \
0N/A (b) = ((pixel) >> 0) & 0x1f; \
0N/A (b) = ((b) << 3) | ((b) >> 2); \
0N/A } while (0)
0N/A
0N/A#define LoadUshort565RgbTo4ByteArgb(pRas, PREFIX, x, a, r, g, b) \
0N/A do { \
0N/A LoadUshort565RgbTo3ByteRgb(pRas, PREFIX, x, r, g, b) \
0N/A (a) = 0xff; \
0N/A } while (0)
0N/A
0N/A#define StoreUshort565RgbFrom1IntArgb(pRas, PREFIX, x, rgb) \
0N/A (pRas)[x] = IntArgbToUshort565Rgb(rgb)
0N/A
0N/A#define StoreUshort565RgbFrom1IntRgb(pRas, PREFIX, x, rgb) \
0N/A StoreUshort565RgbFrom1IntArgb(pRas, PREFIX, x, rgb)
0N/A
0N/A#define StoreUshort565RgbFrom3ByteRgb(pRas, PREFIX, x, r, g, b) \
0N/A (pRas)[x] = (jushort) ComposeUshort565RgbFrom3ByteRgb(r, g, b)
0N/A
0N/A#define StoreUshort565RgbFrom4ByteArgb(pRas, PREFIX, x, a, r, g, b) \
0N/A StoreUshort565RgbFrom3ByteRgb(pRas, PREFIX, x, r, g, b)
0N/A
0N/A
0N/A#define DeclareUshort565RgbAlphaLoadData(PREFIX)
0N/A#define InitUshort565RgbAlphaLoadData(PREFIX, pRasInfo)
0N/A
0N/A#define LoadAlphaFromUshort565RgbFor4ByteArgb(pRas, PREFIX, COMP_PREFIX) \
0N/A COMP_PREFIX ## A = 0xff
0N/A
0N/A#define Postload4ByteArgbFromUshort565Rgb(pRas, PREFIX, COMP_PREFIX) \
0N/A LoadUshort565RgbTo3ByteRgb(pRas, PREFIX, 0, COMP_PREFIX ## R, \
0N/A COMP_PREFIX ## G, COMP_PREFIX ## B)
0N/A
0N/A
#define Ushort565RgbIsPremultiplied 0
#define DeclareUshort565RgbBlendFillVars(PREFIX) \
jushort PREFIX;
#define ClearUshort565RgbBlendFillVars(PREFIX, argb) \
PREFIX = 0
#define InitUshort565RgbBlendFillVarsNonPre(PREFIX, argb, COMP_PREFIX) \
PREFIX = (jushort) ComposeUshort565RgbFrom3ByteRgb(COMP_PREFIX ## R, \
COMP_PREFIX ## G, \
COMP_PREFIX ## B)
#define InitUshort565RgbBlendFillVarsPre(PREFIX, argb, COMP_PREFIX)
#define StoreUshort565RgbBlendFill(pRas, PREFIX, x, argb, COMP_PREFIX) \
(pRas)[x] = PREFIX
#define StoreUshort565RgbFrom4ByteArgbComps(pRas, PREFIX, x, COMP_PREFIX) \
StoreUshort565RgbFrom4ByteArgb(pRas, PREFIX, x, \
COMP_PREFIX ## A, COMP_PREFIX ## R, \
COMP_PREFIX ## G, COMP_PREFIX ## B)
#endif /* Ushort565Rgb_h_Included */