jdk/src/share/native/sun/java2d/loops/ByteIndexed.h
author flar
Mon, 06 Dec 2010 21:45:48 -0800
changeset 7487 9b031d062ede
parent 5506 202f599c92aa
child 15970 068f2b5c2145
permissions -rw-r--r--
6775317: Improve performance of non-AA transformed rectangles and single wide lines in software pipelines Reviewed-by: jgodinez, prr
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, 2006, 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 ByteIndexed_h_Included
90ce3da70b43 Initial load
duke
parents:
diff changeset
    27
#define ByteIndexed_h_Included
90ce3da70b43 Initial load
duke
parents:
diff changeset
    28
90ce3da70b43 Initial load
duke
parents:
diff changeset
    29
#include "IntDcm.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 "ByteIndexed".
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  ByteIndexedPixelType;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    37
typedef jubyte  ByteIndexedDataType;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    38
90ce3da70b43 Initial load
duke
parents:
diff changeset
    39
#define ByteIndexedPixelStride          1
90ce3da70b43 Initial load
duke
parents:
diff changeset
    40
#define ByteIndexedBitsPerPixel         8
90ce3da70b43 Initial load
duke
parents:
diff changeset
    41
90ce3da70b43 Initial load
duke
parents:
diff changeset
    42
#define DeclareByteIndexedLoadVars(PREFIX) \
90ce3da70b43 Initial load
duke
parents:
diff changeset
    43
    jint *PREFIX ## Lut;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    44
90ce3da70b43 Initial load
duke
parents:
diff changeset
    45
#define DeclareByteIndexedStoreVars(PREFIX) \
90ce3da70b43 Initial load
duke
parents:
diff changeset
    46
    int PREFIX ## XDither, PREFIX ## YDither; \
90ce3da70b43 Initial load
duke
parents:
diff changeset
    47
    char *PREFIX ## rerr, *PREFIX ## gerr, *PREFIX ## berr; \
90ce3da70b43 Initial load
duke
parents:
diff changeset
    48
    unsigned char *PREFIX ## InvLut;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    49
90ce3da70b43 Initial load
duke
parents:
diff changeset
    50
#define SetByteIndexedStoreVarsYPos(PREFIX, pRasInfo, LOC) \
90ce3da70b43 Initial load
duke
parents:
diff changeset
    51
    do { \
90ce3da70b43 Initial load
duke
parents:
diff changeset
    52
         PREFIX ## YDither = ((LOC & 7) << 3); \
90ce3da70b43 Initial load
duke
parents:
diff changeset
    53
    } while (0)
90ce3da70b43 Initial load
duke
parents:
diff changeset
    54
90ce3da70b43 Initial load
duke
parents:
diff changeset
    55
#define SetByteIndexedStoreVarsXPos(PREFIX, pRasInfo, LOC) \
90ce3da70b43 Initial load
duke
parents:
diff changeset
    56
    do { \
90ce3da70b43 Initial load
duke
parents:
diff changeset
    57
        PREFIX ## rerr = (pRasInfo)->redErrTable + PREFIX ## YDither; \
90ce3da70b43 Initial load
duke
parents:
diff changeset
    58
        PREFIX ## gerr = (pRasInfo)->grnErrTable + PREFIX ## YDither; \
90ce3da70b43 Initial load
duke
parents:
diff changeset
    59
        PREFIX ## berr = (pRasInfo)->bluErrTable + PREFIX ## YDither; \
90ce3da70b43 Initial load
duke
parents:
diff changeset
    60
        PREFIX ## XDither = (LOC & 7); \
90ce3da70b43 Initial load
duke
parents:
diff changeset
    61
    } while (0)
90ce3da70b43 Initial load
duke
parents:
diff changeset
    62
90ce3da70b43 Initial load
duke
parents:
diff changeset
    63
#define InitByteIndexedLoadVars(PREFIX, pRasInfo) \
90ce3da70b43 Initial load
duke
parents:
diff changeset
    64
    PREFIX ## Lut = (pRasInfo)->lutBase
90ce3da70b43 Initial load
duke
parents:
diff changeset
    65
90ce3da70b43 Initial load
duke
parents:
diff changeset
    66
/* REMIND Could collapse Init..Store..X and Init..Store..Y into one Init
90ce3da70b43 Initial load
duke
parents:
diff changeset
    67
 * and factor out the Set.. macros.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    68
 */
90ce3da70b43 Initial load
duke
parents:
diff changeset
    69
#define InitByteIndexedStoreVarsY(PREFIX, pRasInfo) \
90ce3da70b43 Initial load
duke
parents:
diff changeset
    70
    do { \
90ce3da70b43 Initial load
duke
parents:
diff changeset
    71
        SetByteIndexedStoreVarsYPos(PREFIX, pRasInfo, (pRasInfo)->bounds.y1); \
90ce3da70b43 Initial load
duke
parents:
diff changeset
    72
        PREFIX ## InvLut = (pRasInfo)->invColorTable; \
90ce3da70b43 Initial load
duke
parents:
diff changeset
    73
    } while (0)
90ce3da70b43 Initial load
duke
parents:
diff changeset
    74
90ce3da70b43 Initial load
duke
parents:
diff changeset
    75
#define InitByteIndexedStoreVarsX(PREFIX, pRasInfo) \
90ce3da70b43 Initial load
duke
parents:
diff changeset
    76
    SetByteIndexedStoreVarsXPos(PREFIX, pRasInfo, (pRasInfo)->bounds.x1);
90ce3da70b43 Initial load
duke
parents:
diff changeset
    77
90ce3da70b43 Initial load
duke
parents:
diff changeset
    78
90ce3da70b43 Initial load
duke
parents:
diff changeset
    79
#define NextByteIndexedStoreVarsX(PREFIX) \
90ce3da70b43 Initial load
duke
parents:
diff changeset
    80
    PREFIX ## XDither = (PREFIX ## XDither + 1) & 7
90ce3da70b43 Initial load
duke
parents:
diff changeset
    81
90ce3da70b43 Initial load
duke
parents:
diff changeset
    82
#define NextByteIndexedStoreVarsY(PREFIX) \
90ce3da70b43 Initial load
duke
parents:
diff changeset
    83
    PREFIX ## YDither = (PREFIX ## YDither + (1 << 3)) & (7 << 3)
90ce3da70b43 Initial load
duke
parents:
diff changeset
    84
90ce3da70b43 Initial load
duke
parents:
diff changeset
    85
typedef jubyte  ByteIndexedBmPixelType;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    86
typedef jubyte  ByteIndexedBmDataType;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    87
90ce3da70b43 Initial load
duke
parents:
diff changeset
    88
#define ByteIndexedBmPixelStride        1
90ce3da70b43 Initial load
duke
parents:
diff changeset
    89
#define ByteIndexedBmBitsPerPixel       8
90ce3da70b43 Initial load
duke
parents:
diff changeset
    90
90ce3da70b43 Initial load
duke
parents:
diff changeset
    91
#define DeclareByteIndexedBmLoadVars    DeclareByteIndexedLoadVars
90ce3da70b43 Initial load
duke
parents:
diff changeset
    92
#define DeclareByteIndexedBmStoreVars   DeclareByteIndexedStoreVars
90ce3da70b43 Initial load
duke
parents:
diff changeset
    93
#define InitByteIndexedBmLoadVars       InitByteIndexedLoadVars
90ce3da70b43 Initial load
duke
parents:
diff changeset
    94
#define InitByteIndexedBmStoreVarsY     InitByteIndexedStoreVarsY
90ce3da70b43 Initial load
duke
parents:
diff changeset
    95
#define InitByteIndexedBmStoreVarsX     InitByteIndexedStoreVarsX
90ce3da70b43 Initial load
duke
parents:
diff changeset
    96
#define NextByteIndexedBmStoreVarsX     NextByteIndexedStoreVarsX
90ce3da70b43 Initial load
duke
parents:
diff changeset
    97
#define NextByteIndexedBmStoreVarsY     NextByteIndexedStoreVarsY
90ce3da70b43 Initial load
duke
parents:
diff changeset
    98
90ce3da70b43 Initial load
duke
parents:
diff changeset
    99
#define LoadByteIndexedBmTo1IntArgb     LoadByteIndexedTo1IntArgb
90ce3da70b43 Initial load
duke
parents:
diff changeset
   100
90ce3da70b43 Initial load
duke
parents:
diff changeset
   101
#define CopyByteIndexedBmToIntArgbPre(pRGB, i, PREFIX, pRow, x) \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   102
    do { \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   103
        jint argb = PREFIX ## Lut[pRow[x]]; \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   104
        (pRGB)[i] = argb & (argb >> 24); \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   105
    } while (0)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   106
90ce3da70b43 Initial load
duke
parents:
diff changeset
   107
90ce3da70b43 Initial load
duke
parents:
diff changeset
   108
#define ByteIndexedXparLutEntry                 -1
90ce3da70b43 Initial load
duke
parents:
diff changeset
   109
#define ByteIndexedIsXparLutEntry(pix)          (pix < 0)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   110
#define StoreByteIndexedNonXparFromArgb         StoreByteIndexedFrom1IntArgb
90ce3da70b43 Initial load
duke
parents:
diff changeset
   111
90ce3da70b43 Initial load
duke
parents:
diff changeset
   112
#define StoreByteIndexedPixel(pRas, x, pixel) \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   113
    ((pRas)[x] = (jubyte) (pixel))
90ce3da70b43 Initial load
duke
parents:
diff changeset
   114
90ce3da70b43 Initial load
duke
parents:
diff changeset
   115
#define DeclareByteIndexedPixelData(PREFIX)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   116
#define ExtractByteIndexedPixelData(PIXEL, PREFIX)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   117
90ce3da70b43 Initial load
duke
parents:
diff changeset
   118
#define StoreByteIndexedPixelData(pPix, x, pixel, PREFIX) \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   119
    (pPix)[x] = (jubyte) (pixel)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   120
90ce3da70b43 Initial load
duke
parents:
diff changeset
   121
#define ByteIndexedPixelFromArgb(pixel, rgb, pRasInfo) \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   122
    do { \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   123
        jint r, g, b; \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   124
        ExtractIntDcmComponentsX123(rgb, r, g, b); \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   125
        (pixel) = SurfaceData_InvColorMap((pRasInfo)->invColorTable, \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   126
                                          r, g, b); \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   127
    } while (0)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   128
90ce3da70b43 Initial load
duke
parents:
diff changeset
   129
#define LoadByteIndexedTo1IntRgb(pRas, PREFIX, x, rgb) \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   130
    (rgb) = PREFIX ## Lut[pRas[x]]
90ce3da70b43 Initial load
duke
parents:
diff changeset
   131
90ce3da70b43 Initial load
duke
parents:
diff changeset
   132
#define LoadByteIndexedTo1IntArgb(pRas, PREFIX, x, argb) \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   133
    (argb) = PREFIX ## Lut[pRas[x]]
90ce3da70b43 Initial load
duke
parents:
diff changeset
   134
90ce3da70b43 Initial load
duke
parents:
diff changeset
   135
#define LoadByteIndexedTo3ByteRgb(pRas, PREFIX, x, r, g, b) \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   136
    do { \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   137
        jint rgb = PREFIX ## Lut[pRas[x]]; \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   138
        ExtractIntDcmComponentsX123(rgb, r, g, b); \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   139
    } while (0)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   140
90ce3da70b43 Initial load
duke
parents:
diff changeset
   141
#define LoadByteIndexedTo4ByteArgb(pRas, PREFIX, x, a, r, g, b) \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   142
    do { \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   143
        jint argb = PREFIX ## Lut[pRas[x]]; \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   144
        ExtractIntDcmComponents1234(argb, a, r, g, b); \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   145
    } while (0)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   146
90ce3da70b43 Initial load
duke
parents:
diff changeset
   147
#define ByteClamp1Component(X)  \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   148
    do { if (((X) >> 8) != 0) {X = (~(X >> 31)) & 255; } } while (0)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   149
90ce3da70b43 Initial load
duke
parents:
diff changeset
   150
#define ByteClamp3Components(R, G, B) \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   151
    do { \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   152
        if (((R|G|B) >> 8) != 0) { \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   153
            ByteClamp1Component(R); \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   154
            ByteClamp1Component(G); \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   155
            ByteClamp1Component(B); \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   156
        } \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   157
    } while (0)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   158
90ce3da70b43 Initial load
duke
parents:
diff changeset
   159
#define StoreByteIndexedFrom1IntRgb(pRas, PREFIX, x, rgb) \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   160
    do { \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   161
        int r, g, b; \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   162
        ExtractIntDcmComponentsX123(rgb, r, g, b); \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   163
        StoreByteIndexedFrom3ByteRgb(pRas, PREFIX, x, r, g, b); \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   164
    } while (0)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   165
90ce3da70b43 Initial load
duke
parents:
diff changeset
   166
#define StoreByteIndexedFrom1IntArgb(pRas, PREFIX, x, argb) \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   167
    StoreByteIndexedFrom1IntRgb(pRas, PREFIX, x, argb)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   168
90ce3da70b43 Initial load
duke
parents:
diff changeset
   169
#define StoreByteIndexedFrom3ByteRgb(pRas, PREFIX, x, r, g, b) \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   170
    do { \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   171
        r += PREFIX ## rerr[PREFIX ## XDither]; \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   172
        g += PREFIX ## gerr[PREFIX ## XDither]; \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   173
        b += PREFIX ## berr[PREFIX ## XDither]; \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   174
        ByteClamp3Components(r, g, b); \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   175
        (pRas)[x] = SurfaceData_InvColorMap(PREFIX ## InvLut, r, g, b); \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   176
    } while (0)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   177
90ce3da70b43 Initial load
duke
parents:
diff changeset
   178
#define StoreByteIndexedFrom4ByteArgb(pRas, PREFIX, x, a, r, g, b) \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   179
    StoreByteIndexedFrom3ByteRgb(pRas, PREFIX, x, r, g, b)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   180
90ce3da70b43 Initial load
duke
parents:
diff changeset
   181
#define CopyByteIndexedToIntArgbPre(pRGB, i, PREFIX, pRow, x) \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   182
    do { \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   183
        jint argb = PREFIX ## Lut[pRow[x]]; \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   184
        jint a = URShift(argb, 24); \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   185
        if (a == 0) { \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   186
            argb = 0; \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   187
        } else if (a < 0xff) { \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   188
            jint r = (argb >> 16) & 0xff; \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   189
            jint g = (argb >>  8) & 0xff; \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   190
            jint b = (argb      ) & 0xff; \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   191
            r = MUL8(a, r); \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   192
            g = MUL8(a, g); \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   193
            b = MUL8(a, b); \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   194
            argb = ComposeIntDcmComponents1234(a, r, g, b); \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   195
        } \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   196
        (pRGB)[i] = argb; \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   197
    } while (0)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   198
90ce3da70b43 Initial load
duke
parents:
diff changeset
   199
90ce3da70b43 Initial load
duke
parents:
diff changeset
   200
#define DeclareByteIndexedAlphaLoadData(PREFIX) \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   201
    jint *PREFIX ## Lut; \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   202
    jint PREFIX ## rgb;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   203
90ce3da70b43 Initial load
duke
parents:
diff changeset
   204
#define InitByteIndexedAlphaLoadData(PREFIX, pRasInfo) \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   205
    PREFIX ## Lut = (pRasInfo)->lutBase
90ce3da70b43 Initial load
duke
parents:
diff changeset
   206
90ce3da70b43 Initial load
duke
parents:
diff changeset
   207
#define LoadAlphaFromByteIndexedFor4ByteArgb(pRas, PREFIX, COMP_PREFIX) \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   208
    do { \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   209
        PREFIX ## rgb = PREFIX ## Lut[(pRas)[0]]; \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   210
        COMP_PREFIX ## A = ((juint) PREFIX ## rgb) >> 24; \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   211
    } while (0)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   212
90ce3da70b43 Initial load
duke
parents:
diff changeset
   213
#define Postload4ByteArgbFromByteIndexed(pRas, PREFIX, COMP_PREFIX) \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   214
    do { \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   215
        COMP_PREFIX ## R = (PREFIX ## rgb >> 16) & 0xff; \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   216
        COMP_PREFIX ## G = (PREFIX ## rgb >>  8) & 0xff; \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   217
        COMP_PREFIX ## B = (PREFIX ## rgb >>  0) & 0xff; \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   218
    } while (0)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   219
90ce3da70b43 Initial load
duke
parents:
diff changeset
   220
90ce3da70b43 Initial load
duke
parents:
diff changeset
   221
#define ByteIndexedIsPremultiplied      0
90ce3da70b43 Initial load
duke
parents:
diff changeset
   222
90ce3da70b43 Initial load
duke
parents:
diff changeset
   223
#define StoreByteIndexedFrom4ByteArgbComps(pRas, PREFIX, x, COMP_PREFIX) \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   224
    StoreByteIndexedFrom4ByteArgb(pRas, PREFIX, x, \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   225
                                  COMP_PREFIX ## A, COMP_PREFIX ## R, \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   226
                                  COMP_PREFIX ## G, COMP_PREFIX ## B)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   227
90ce3da70b43 Initial load
duke
parents:
diff changeset
   228
#endif /* ByteIndexed_h_Included */