jdk/src/java.desktop/share/native/libawt/java2d/loops/ByteBinary4Bit.h
author prr
Fri, 19 Sep 2014 09:41:05 -0700
changeset 26751 70bac69b37c9
parent 25859 jdk/src/java.desktop/share/native/libawt/sun/java2d/loops/ByteBinary4Bit.h@3317bb8137f4
permissions -rw-r--r--
8056216: Remove "sun" directory layer from libawt and common Reviewed-by: erikj, ihse, coffeys
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
     1
/*
5506
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 2
diff changeset
     2
 * Copyright (c) 2000, 2005, Oracle and/or its affiliates. All rights reserved.
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
     3
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
90ce3da70b43 Initial load
duke
parents:
diff changeset
     4
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
     5
 * This code is free software; you can redistribute it and/or modify it
90ce3da70b43 Initial load
duke
parents:
diff changeset
     6
 * under the terms of the GNU General Public License version 2 only, as
5506
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 2
diff changeset
     7
 * published by the Free Software Foundation.  Oracle designates this
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
     8
 * particular file as subject to the "Classpath" exception as provided
5506
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 2
diff changeset
     9
 * by Oracle in the LICENSE file that accompanied this code.
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    10
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    11
 * This code is distributed in the hope that it will be useful, but WITHOUT
90ce3da70b43 Initial load
duke
parents:
diff changeset
    12
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
90ce3da70b43 Initial load
duke
parents:
diff changeset
    13
 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
90ce3da70b43 Initial load
duke
parents:
diff changeset
    14
 * version 2 for more details (a copy is included in the LICENSE file that
90ce3da70b43 Initial load
duke
parents:
diff changeset
    15
 * accompanied this code).
90ce3da70b43 Initial load
duke
parents:
diff changeset
    16
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    17
 * You should have received a copy of the GNU General Public License version
90ce3da70b43 Initial load
duke
parents:
diff changeset
    18
 * 2 along with this work; if not, write to the Free Software Foundation,
90ce3da70b43 Initial load
duke
parents:
diff changeset
    19
 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    20
 *
5506
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 2
diff changeset
    21
 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 2
diff changeset
    22
 * or visit www.oracle.com if you need additional information or have any
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 2
diff changeset
    23
 * questions.
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    24
 */
90ce3da70b43 Initial load
duke
parents:
diff changeset
    25
90ce3da70b43 Initial load
duke
parents:
diff changeset
    26
#ifndef ByteBinary4Bit_h_Included
90ce3da70b43 Initial load
duke
parents:
diff changeset
    27
#define ByteBinary4Bit_h_Included
90ce3da70b43 Initial load
duke
parents:
diff changeset
    28
90ce3da70b43 Initial load
duke
parents:
diff changeset
    29
#include "AnyByteBinary.h"
90ce3da70b43 Initial load
duke
parents:
diff changeset
    30
90ce3da70b43 Initial load
duke
parents:
diff changeset
    31
/*
90ce3da70b43 Initial load
duke
parents:
diff changeset
    32
 * This file contains macro and type definitions used by the macros in
90ce3da70b43 Initial load
duke
parents:
diff changeset
    33
 * LoopMacros.h to manipulate a surface of type "ByteBinary4Bit".
90ce3da70b43 Initial load
duke
parents:
diff changeset
    34
 */
90ce3da70b43 Initial load
duke
parents:
diff changeset
    35
90ce3da70b43 Initial load
duke
parents:
diff changeset
    36
typedef jubyte  ByteBinary4BitPixelType;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    37
typedef jubyte  ByteBinary4BitDataType;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    38
90ce3da70b43 Initial load
duke
parents:
diff changeset
    39
#define ByteBinary4BitPixelStride      0
90ce3da70b43 Initial load
duke
parents:
diff changeset
    40
#define ByteBinary4BitPixelsPerByte    2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    41
#define ByteBinary4BitBitsPerPixel     4
90ce3da70b43 Initial load
duke
parents:
diff changeset
    42
#define ByteBinary4BitMaxBitOffset     4
90ce3da70b43 Initial load
duke
parents:
diff changeset
    43
#define ByteBinary4BitPixelMask        0xf
90ce3da70b43 Initial load
duke
parents:
diff changeset
    44
90ce3da70b43 Initial load
duke
parents:
diff changeset
    45
#define DeclareByteBinary4BitLoadVars     DeclareByteBinaryLoadVars
90ce3da70b43 Initial load
duke
parents:
diff changeset
    46
#define DeclareByteBinary4BitStoreVars    DeclareByteBinaryStoreVars
90ce3da70b43 Initial load
duke
parents:
diff changeset
    47
#define SetByteBinary4BitStoreVarsYPos    SetByteBinaryStoreVarsYPos
90ce3da70b43 Initial load
duke
parents:
diff changeset
    48
#define SetByteBinary4BitStoreVarsXPos    SetByteBinaryStoreVarsXPos
90ce3da70b43 Initial load
duke
parents:
diff changeset
    49
#define InitByteBinary4BitLoadVars        InitByteBinaryLoadVars
90ce3da70b43 Initial load
duke
parents:
diff changeset
    50
#define InitByteBinary4BitStoreVarsY      InitByteBinaryStoreVarsY
90ce3da70b43 Initial load
duke
parents:
diff changeset
    51
#define InitByteBinary4BitStoreVarsX      InitByteBinaryStoreVarsX
90ce3da70b43 Initial load
duke
parents:
diff changeset
    52
#define NextByteBinary4BitStoreVarsY      NextByteBinaryStoreVarsY
90ce3da70b43 Initial load
duke
parents:
diff changeset
    53
#define NextByteBinary4BitStoreVarsX      NextByteBinaryStoreVarsX
90ce3da70b43 Initial load
duke
parents:
diff changeset
    54
90ce3da70b43 Initial load
duke
parents:
diff changeset
    55
#define DeclareByteBinary4BitInitialLoadVars(pRasInfo, pRas, PREFIX, x) \
90ce3da70b43 Initial load
duke
parents:
diff changeset
    56
    DeclareByteBinaryInitialLoadVars(ByteBinary4Bit, pRasInfo, pRas, PREFIX, x)
90ce3da70b43 Initial load
duke
parents:
diff changeset
    57
90ce3da70b43 Initial load
duke
parents:
diff changeset
    58
#define InitialLoadByteBinary4Bit(pRas, PREFIX) \
90ce3da70b43 Initial load
duke
parents:
diff changeset
    59
    InitialLoadByteBinary(ByteBinary4Bit, pRas, PREFIX)
90ce3da70b43 Initial load
duke
parents:
diff changeset
    60
90ce3da70b43 Initial load
duke
parents:
diff changeset
    61
#define ShiftBitsByteBinary4Bit(PREFIX) \
90ce3da70b43 Initial load
duke
parents:
diff changeset
    62
    ShiftBitsByteBinary(ByteBinary4Bit, PREFIX)
90ce3da70b43 Initial load
duke
parents:
diff changeset
    63
90ce3da70b43 Initial load
duke
parents:
diff changeset
    64
#define FinalStoreByteBinary4Bit(pRas, PREFIX) \
90ce3da70b43 Initial load
duke
parents:
diff changeset
    65
    FinalStoreByteBinary(ByteBinary4Bit, pRas, PREFIX)
90ce3da70b43 Initial load
duke
parents:
diff changeset
    66
90ce3da70b43 Initial load
duke
parents:
diff changeset
    67
#define CurrentPixelByteBinary4Bit(PREFIX) \
90ce3da70b43 Initial load
duke
parents:
diff changeset
    68
    CurrentPixelByteBinary(ByteBinary4Bit, PREFIX)
90ce3da70b43 Initial load
duke
parents:
diff changeset
    69
90ce3da70b43 Initial load
duke
parents:
diff changeset
    70
90ce3da70b43 Initial load
duke
parents:
diff changeset
    71
#define StoreByteBinary4BitPixel(pRas, x, pixel) \
90ce3da70b43 Initial load
duke
parents:
diff changeset
    72
    StoreByteBinaryPixel(ByteBinary4Bit, pRas, x, pixel)
90ce3da70b43 Initial load
duke
parents:
diff changeset
    73
90ce3da70b43 Initial load
duke
parents:
diff changeset
    74
#define StoreByteBinary4BitPixelData(pPix, x, pixel, PREFIX) \
90ce3da70b43 Initial load
duke
parents:
diff changeset
    75
    StoreByteBinaryPixelData(ByteBinary4Bit, pPix, x, pixel, PREFIX)
90ce3da70b43 Initial load
duke
parents:
diff changeset
    76
90ce3da70b43 Initial load
duke
parents:
diff changeset
    77
#define ByteBinary4BitPixelFromArgb(pixel, rgb, pRasInfo) \
90ce3da70b43 Initial load
duke
parents:
diff changeset
    78
    ByteBinaryPixelFromArgb(ByteBinary4Bit, pixel, rgb, pRasInfo)
90ce3da70b43 Initial load
duke
parents:
diff changeset
    79
90ce3da70b43 Initial load
duke
parents:
diff changeset
    80
#define XorByteBinary4BitPixelData(pDst, x, PREFIX, srcpixel, xorpixel, mask)\
90ce3da70b43 Initial load
duke
parents:
diff changeset
    81
    XorByteBinaryPixelData(ByteBinary4Bit, pDst, x, PREFIX, \
90ce3da70b43 Initial load
duke
parents:
diff changeset
    82
                           srcpixel, xorpixel, mask)
90ce3da70b43 Initial load
duke
parents:
diff changeset
    83
90ce3da70b43 Initial load
duke
parents:
diff changeset
    84
90ce3da70b43 Initial load
duke
parents:
diff changeset
    85
#define LoadByteBinary4BitTo1IntRgb(pRas, PREFIX, x, rgb) \
90ce3da70b43 Initial load
duke
parents:
diff changeset
    86
    LoadByteBinaryTo1IntRgb(ByteBinary4Bit, pRas, PREFIX, x, rgb)
90ce3da70b43 Initial load
duke
parents:
diff changeset
    87
90ce3da70b43 Initial load
duke
parents:
diff changeset
    88
#define LoadByteBinary4BitTo1IntArgb(pRas, PREFIX, x, argb) \
90ce3da70b43 Initial load
duke
parents:
diff changeset
    89
    LoadByteBinaryTo1IntArgb(ByteBinary4Bit, pRas, PREFIX, x, argb)
90ce3da70b43 Initial load
duke
parents:
diff changeset
    90
90ce3da70b43 Initial load
duke
parents:
diff changeset
    91
#define LoadByteBinary4BitTo3ByteRgb(pRas, PREFIX, x, r, g, b) \
90ce3da70b43 Initial load
duke
parents:
diff changeset
    92
    LoadByteBinaryTo3ByteRgb(ByteBinary4Bit, pRas, PREFIX, x, r, g, b)
90ce3da70b43 Initial load
duke
parents:
diff changeset
    93
90ce3da70b43 Initial load
duke
parents:
diff changeset
    94
#define LoadByteBinary4BitTo4ByteArgb(pRas, PREFIX, x, a, r, g, b) \
90ce3da70b43 Initial load
duke
parents:
diff changeset
    95
    LoadByteBinaryTo4ByteArgb(ByteBinary4Bit, pRas, PREFIX, x, a, r, g, b)
90ce3da70b43 Initial load
duke
parents:
diff changeset
    96
90ce3da70b43 Initial load
duke
parents:
diff changeset
    97
#define StoreByteBinary4BitFrom1IntRgb(pRas, PREFIX, x, rgb) \
90ce3da70b43 Initial load
duke
parents:
diff changeset
    98
    StoreByteBinaryFrom1IntRgb(ByteBinary4Bit, pRas, PREFIX, x, rgb)
90ce3da70b43 Initial load
duke
parents:
diff changeset
    99
90ce3da70b43 Initial load
duke
parents:
diff changeset
   100
#define StoreByteBinary4BitFrom1IntArgb(pRas, PREFIX, x, argb) \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   101
    StoreByteBinaryFrom1IntArgb(ByteBinary4Bit, pRas, PREFIX, x, argb)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   102
90ce3da70b43 Initial load
duke
parents:
diff changeset
   103
#define StoreByteBinary4BitFrom3ByteRgb(pRas, PREFIX, x, r, g, b) \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   104
    StoreByteBinaryFrom3ByteRgb(ByteBinary4Bit, pRas, PREFIX, x, r, g, b)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   105
90ce3da70b43 Initial load
duke
parents:
diff changeset
   106
#define StoreByteBinary4BitFrom4ByteArgb(pRas, PREFIX, x, a, r, g, b) \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   107
    StoreByteBinaryFrom4ByteArgb(ByteBinary4Bit, pRas, PREFIX, x, a, r, g, b)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   108
90ce3da70b43 Initial load
duke
parents:
diff changeset
   109
90ce3da70b43 Initial load
duke
parents:
diff changeset
   110
#define DeclareByteBinary4BitAlphaLoadData(PREFIX) \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   111
    DeclareByteBinaryAlphaLoadData(ByteBinary4Bit, PREFIX)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   112
90ce3da70b43 Initial load
duke
parents:
diff changeset
   113
#define InitByteBinary4BitAlphaLoadData(PREFIX, pRasInfo) \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   114
    InitByteBinaryAlphaLoadData(ByteBinary4Bit, PREFIX, pRasInfo)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   115
90ce3da70b43 Initial load
duke
parents:
diff changeset
   116
#define LoadAlphaFromByteBinary4BitFor4ByteArgb(pRas, PREFIX, COMP_PREFIX) \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   117
    LoadAlphaFromByteBinaryFor4ByteArgb(ByteBinary4Bit, pRas, PREFIX, \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   118
                                        COMP_PREFIX)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   119
90ce3da70b43 Initial load
duke
parents:
diff changeset
   120
#define Postload4ByteArgbFromByteBinary4Bit(pRas, PREFIX, COMP_PREFIX) \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   121
    Postload4ByteArgbFromByteBinary(ByteBinary4Bit, pRas, PREFIX, COMP_PREFIX)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   122
90ce3da70b43 Initial load
duke
parents:
diff changeset
   123
90ce3da70b43 Initial load
duke
parents:
diff changeset
   124
#define ByteBinary4BitIsPremultiplied    ByteBinaryIsPremultiplied
90ce3da70b43 Initial load
duke
parents:
diff changeset
   125
90ce3da70b43 Initial load
duke
parents:
diff changeset
   126
#define StoreByteBinary4BitFrom4ByteArgbComps(pRas, PREFIX, x, COMP_PREFIX) \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   127
    StoreByteBinaryFrom4ByteArgbComps(ByteBinary4Bit, pRas, \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   128
                                      PREFIX, x, COMP_PREFIX)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   129
90ce3da70b43 Initial load
duke
parents:
diff changeset
   130
#endif /* ByteBinary4Bit_h_Included */