src/java.desktop/share/native/libawt/java2d/loops/IntArgbBm.h
author ihse
Mon, 11 Jun 2018 11:23:20 +0200
branchihse-remove-mapfiles-branch
changeset 56721 01b558efd286
parent 47216 71c04702a3d5
permissions -rw-r--r--
Merge
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
     1
/*
37800
518e44c93fbb 8015070: Antialiased text on translucent backgrounds gets bright artifacts
ntv
parents: 26751
diff changeset
     2
 * Copyright (c) 2001, 2016, 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: 715
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: 715
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: 715
diff changeset
    21
 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 715
diff changeset
    22
 * or visit www.oracle.com if you need additional information or have any
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 715
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 IntArgbBm_h_Included
90ce3da70b43 Initial load
duke
parents:
diff changeset
    27
#define IntArgbBm_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
#include "ByteGray.h"
90ce3da70b43 Initial load
duke
parents:
diff changeset
    31
#include "UshortGray.h"
90ce3da70b43 Initial load
duke
parents:
diff changeset
    32
90ce3da70b43 Initial load
duke
parents:
diff changeset
    33
/*
90ce3da70b43 Initial load
duke
parents:
diff changeset
    34
 * This file contains macro and type definitions used by the macros in
90ce3da70b43 Initial load
duke
parents:
diff changeset
    35
 * LoopMacros.h to manipulate a surface of type "IntArgbBm".
90ce3da70b43 Initial load
duke
parents:
diff changeset
    36
 */
90ce3da70b43 Initial load
duke
parents:
diff changeset
    37
90ce3da70b43 Initial load
duke
parents:
diff changeset
    38
typedef jint    IntArgbBmPixelType;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    39
typedef jint    IntArgbBmDataType;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    40
549
4273b1234967 6679308: Poor text rendering on translucent image.
prr
parents: 2
diff changeset
    41
#define IntArgbBmIsOpaque 0
4273b1234967 6679308: Poor text rendering on translucent image.
prr
parents: 2
diff changeset
    42
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    43
#define IntArgbBmPixelStride    4
90ce3da70b43 Initial load
duke
parents:
diff changeset
    44
90ce3da70b43 Initial load
duke
parents:
diff changeset
    45
#define DeclareIntArgbBmLoadVars(PREFIX)
90ce3da70b43 Initial load
duke
parents:
diff changeset
    46
#define DeclareIntArgbBmStoreVars(PREFIX)
90ce3da70b43 Initial load
duke
parents:
diff changeset
    47
#define InitIntArgbBmLoadVars(PREFIX, pRasInfo)
90ce3da70b43 Initial load
duke
parents:
diff changeset
    48
#define SetIntArgbBmStoreVarsYPos(PREFIX, pRasInfo, y)
90ce3da70b43 Initial load
duke
parents:
diff changeset
    49
#define SetIntArgbBmStoreVarsXPos(PREFIX, pRasInfo, x)
90ce3da70b43 Initial load
duke
parents:
diff changeset
    50
#define InitIntArgbBmStoreVarsY(PREFIX, pRasInfo)
90ce3da70b43 Initial load
duke
parents:
diff changeset
    51
#define InitIntArgbBmStoreVarsX(PREFIX, pRasInfo)
90ce3da70b43 Initial load
duke
parents:
diff changeset
    52
#define NextIntArgbBmStoreVarsX(PREFIX)
90ce3da70b43 Initial load
duke
parents:
diff changeset
    53
#define NextIntArgbBmStoreVarsY(PREFIX)
90ce3da70b43 Initial load
duke
parents:
diff changeset
    54
#define DeclareIntArgbBmInitialLoadVars(pRasInfo, pRas, PREFIX, x)
90ce3da70b43 Initial load
duke
parents:
diff changeset
    55
#define InitialLoadIntArgbBm(pRas, PREFIX)
90ce3da70b43 Initial load
duke
parents:
diff changeset
    56
#define ShiftBitsIntArgbBm(PREFIX)
90ce3da70b43 Initial load
duke
parents:
diff changeset
    57
#define FinalStoreIntArgbBm(pRas, PREFIX)
90ce3da70b43 Initial load
duke
parents:
diff changeset
    58
90ce3da70b43 Initial load
duke
parents:
diff changeset
    59
#define IntArgbBmXparLutEntry           0
90ce3da70b43 Initial load
duke
parents:
diff changeset
    60
#define IntArgbBmIsXparLutEntry(pix)    (pix == 0)
90ce3da70b43 Initial load
duke
parents:
diff changeset
    61
#define StoreIntArgbBmNonXparFromArgb(pRas, PREFIX, x, argb) \
90ce3da70b43 Initial load
duke
parents:
diff changeset
    62
    StoreIntArgbBmFrom1IntArgb(pRas, PREFIX, x, argb)
90ce3da70b43 Initial load
duke
parents:
diff changeset
    63
90ce3da70b43 Initial load
duke
parents:
diff changeset
    64
#define DeclareIntArgbBmData(PREFIX) \
90ce3da70b43 Initial load
duke
parents:
diff changeset
    65
    jint PREFIX;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    66
90ce3da70b43 Initial load
duke
parents:
diff changeset
    67
#define LoadIntArgbBmData(pRas, LOADPREFIX, x, DATAPREFIX) \
90ce3da70b43 Initial load
duke
parents:
diff changeset
    68
    (DATAPREFIX) = (pRas)[x]
90ce3da70b43 Initial load
duke
parents:
diff changeset
    69
90ce3da70b43 Initial load
duke
parents:
diff changeset
    70
#define IsIntArgbBmDataTransparent(DATAPREFIX) \
90ce3da70b43 Initial load
duke
parents:
diff changeset
    71
    (((DATAPREFIX) >> 24) == 0)
90ce3da70b43 Initial load
duke
parents:
diff changeset
    72
90ce3da70b43 Initial load
duke
parents:
diff changeset
    73
#define ConvertIntArgbBmDataTo1IntRgb(DATAPREFIX, rgb) \
90ce3da70b43 Initial load
duke
parents:
diff changeset
    74
    (rgb) = (DATAPREFIX)
90ce3da70b43 Initial load
duke
parents:
diff changeset
    75
90ce3da70b43 Initial load
duke
parents:
diff changeset
    76
#define IntArgbBmPixelFromArgb(pixel, rgb, pRasInfo) \
90ce3da70b43 Initial load
duke
parents:
diff changeset
    77
    (pixel) = ((rgb) | (((rgb) >> 31) << 24))
90ce3da70b43 Initial load
duke
parents:
diff changeset
    78
90ce3da70b43 Initial load
duke
parents:
diff changeset
    79
#define StoreIntArgbBmPixel(pRas, x, pixel) \
90ce3da70b43 Initial load
duke
parents:
diff changeset
    80
    (pRas)[x] = (pixel)
90ce3da70b43 Initial load
duke
parents:
diff changeset
    81
90ce3da70b43 Initial load
duke
parents:
diff changeset
    82
#define DeclareIntArgbBmPixelData(PREFIX)
90ce3da70b43 Initial load
duke
parents:
diff changeset
    83
90ce3da70b43 Initial load
duke
parents:
diff changeset
    84
#define ExtractIntArgbBmPixelData(PIXEL, PREFIX)
90ce3da70b43 Initial load
duke
parents:
diff changeset
    85
90ce3da70b43 Initial load
duke
parents:
diff changeset
    86
#define StoreIntArgbBmPixelData(pPix, x, pixel, PREFIX) \
90ce3da70b43 Initial load
duke
parents:
diff changeset
    87
    (pPix)[x] = (pixel)
90ce3da70b43 Initial load
duke
parents:
diff changeset
    88
90ce3da70b43 Initial load
duke
parents:
diff changeset
    89
90ce3da70b43 Initial load
duke
parents:
diff changeset
    90
#define LoadIntArgbBmTo1IntRgb(pRas, PREFIX, x, rgb) \
90ce3da70b43 Initial load
duke
parents:
diff changeset
    91
    (rgb) = (pRas)[x]
90ce3da70b43 Initial load
duke
parents:
diff changeset
    92
90ce3da70b43 Initial load
duke
parents:
diff changeset
    93
#define LoadIntArgbBmTo1IntArgb(pRas, PREFIX, x, argb) \
90ce3da70b43 Initial load
duke
parents:
diff changeset
    94
    do { \
90ce3da70b43 Initial load
duke
parents:
diff changeset
    95
        (argb) = (pRas)[x]; \
90ce3da70b43 Initial load
duke
parents:
diff changeset
    96
        (argb) = (((argb) << 7) >> 7); \
90ce3da70b43 Initial load
duke
parents:
diff changeset
    97
    } while (0)
90ce3da70b43 Initial load
duke
parents:
diff changeset
    98
90ce3da70b43 Initial load
duke
parents:
diff changeset
    99
#define LoadIntArgbBmTo3ByteRgb(pRas, PREFIX, x, r, g, b) \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   100
    do { \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   101
        jint pixel = (pRas)[x]; \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   102
        ExtractIntDcmComponentsX123(pixel, r, g, b); \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   103
    } while (0)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   104
90ce3da70b43 Initial load
duke
parents:
diff changeset
   105
#define LoadIntArgbBmTo4ByteArgb(pRas, PREFIX, x, a, r, g, b) \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   106
    do { \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   107
        jint pixel = (pRas)[x]; \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   108
        pixel = ((pixel << 7) >> 7); \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   109
        ExtractIntDcmComponents1234(pixel, a, r, g, b); \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   110
    } while (0)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   111
90ce3da70b43 Initial load
duke
parents:
diff changeset
   112
#define StoreIntArgbBmFrom1IntRgb(pRas, PREFIX, x, rgb) \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   113
    (pRas)[x] = 0x01000000 | (rgb)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   114
90ce3da70b43 Initial load
duke
parents:
diff changeset
   115
#define StoreIntArgbBmFrom1IntArgb(pRas, PREFIX, x, argb) \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   116
    (pRas)[x] = ((argb) | (((argb) >> 31) << 24))
90ce3da70b43 Initial load
duke
parents:
diff changeset
   117
90ce3da70b43 Initial load
duke
parents:
diff changeset
   118
#define StoreIntArgbBmFrom3ByteRgb(pRas, PREFIX, x, r, g, b) \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   119
    StoreIntArgbBmFrom4ByteArgb(pRas, PREFIX, x, 0x01, r, g, b)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   120
90ce3da70b43 Initial load
duke
parents:
diff changeset
   121
#define StoreIntArgbBmFrom4ByteArgb(pRas, PREFIX, x, a, r, g, b) \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   122
    (pRas)[x] = ComposeIntDcmComponents1234((a >> 7), r, g, b)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   123
90ce3da70b43 Initial load
duke
parents:
diff changeset
   124
#define CopyIntArgbBmToIntArgbPre(pRGB, i, PREFIX, pRow, x) \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   125
    do { \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   126
        jint argb = (pRow)[x]; \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   127
        argb = ((argb << 7) >> 7); /* Propagate alpha bit */ \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   128
        argb &= (argb >> 24); /* Mask off colors if alpha=0 */ \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   129
        (pRGB)[i] = argb; \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   130
    } while (0)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   131
90ce3da70b43 Initial load
duke
parents:
diff changeset
   132
90ce3da70b43 Initial load
duke
parents:
diff changeset
   133
#define DeclareIntArgbBmAlphaLoadData(PREFIX) \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   134
    jint PREFIX;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   135
15970
068f2b5c2145 8005796: [parfait] Possible uninitialised variable at jdk/src/share/native/sun/java2d/loops/ByteBinary1Bit.c
jgodinez
parents: 5506
diff changeset
   136
#define InitIntArgbBmAlphaLoadData(PREFIX, pRasInfo) \
068f2b5c2145 8005796: [parfait] Possible uninitialised variable at jdk/src/share/native/sun/java2d/loops/ByteBinary1Bit.c
jgodinez
parents: 5506
diff changeset
   137
    PREFIX = 0
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   138
90ce3da70b43 Initial load
duke
parents:
diff changeset
   139
#define LoadAlphaFromIntArgbBmFor4ByteArgb(pRas, PREFIX, COMP_PREFIX) \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   140
    do { \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   141
        PREFIX = (pRas)[0]; \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   142
        PREFIX = ((PREFIX << 7) >> 7); \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   143
        COMP_PREFIX ## A = ((juint) PREFIX) >> 24; \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   144
    } while (0)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   145
90ce3da70b43 Initial load
duke
parents:
diff changeset
   146
#define LoadAlphaFromIntArgbBmFor1ByteGray(pRas, PREFIX, COMP_PREFIX) \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   147
    LoadAlphaFromIntArgbBmFor4ByteArgb(pRas, PREFIX, COMP_PREFIX)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   148
90ce3da70b43 Initial load
duke
parents:
diff changeset
   149
#define LoadAlphaFromIntArgbBmFor1ShortGray(pRas, PREFIX, COMP_PREFIX) \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   150
    do { \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   151
        LoadAlphaFromIntArgbBmFor4ByteArgb(pRas, PREFIX, COMP_PREFIX); \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   152
        COMP_PREFIX ## A = (COMP_PREFIX ## A << 8) + COMP_PREFIX ## A; \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   153
    } while (0)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   154
90ce3da70b43 Initial load
duke
parents:
diff changeset
   155
#define Postload4ByteArgbFromIntArgbBm(pRas, PREFIX, COMP_PREFIX) \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   156
    do { \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   157
        COMP_PREFIX ## R = (PREFIX >> 16) & 0xff; \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   158
        COMP_PREFIX ## G = (PREFIX >>  8) & 0xff; \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   159
        COMP_PREFIX ## B = (PREFIX >>  0) & 0xff; \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   160
    } while (0)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   161
90ce3da70b43 Initial load
duke
parents:
diff changeset
   162
#define Postload1ByteGrayFromIntArgb(pRas, PREFIX, COMP_PREFIX) \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   163
    do { \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   164
        int r, g, b; \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   165
        ExtractIntDcmComponentsX123(PREFIX, r, g, b); \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   166
        COMP_PREFIX ## G = ComposeByteGrayFrom3ByteRgb(r, g, b); \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   167
    } while (0)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   168
90ce3da70b43 Initial load
duke
parents:
diff changeset
   169
#define Postload1ShortGrayFromIntArgb(pRas, PREFIX, COMP_PREFIX) \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   170
    do { \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   171
        int r, g, b; \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   172
        ExtractIntDcmComponentsX123(PREFIX, r, g, b); \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   173
        COMP_PREFIX ## G = ComposeUshortGrayFrom3ByteRgb(r, g, b); \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   174
    } while (0)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   175
90ce3da70b43 Initial load
duke
parents:
diff changeset
   176
90ce3da70b43 Initial load
duke
parents:
diff changeset
   177
#define IntArgbBmIsPremultiplied        0
90ce3da70b43 Initial load
duke
parents:
diff changeset
   178
90ce3da70b43 Initial load
duke
parents:
diff changeset
   179
#define StoreIntArgbBmFrom4ByteArgbComps(pRas, PREFIX, x, COMP_PREFIX) \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   180
    StoreIntArgbBmFrom4ByteArgb(pRas, PREFIX, x, \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   181
                                COMP_PREFIX ## A, COMP_PREFIX ## R, \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   182
                                COMP_PREFIX ## G, COMP_PREFIX ## B)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   183
90ce3da70b43 Initial load
duke
parents:
diff changeset
   184
/*
90ce3da70b43 Initial load
duke
parents:
diff changeset
   185
 * Extract ## STRATEGY ## CompsAndAlphaFromArgb(pixel, COMP_PREFIX)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   186
 */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   187
#define Extract3ByteRgbCompsAndAlphaFromArgb(pixel, COMP_PREFIX) \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   188
    ExtractIntDcmComponents1234(pixel, COMP_PREFIX ## A, COMP_PREFIX ## R, \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   189
                                COMP_PREFIX ## G, COMP_PREFIX ## B)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   190
90ce3da70b43 Initial load
duke
parents:
diff changeset
   191
#define Extract4ByteArgbCompsAndAlphaFromArgb(pixel, COMP_PREFIX) \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   192
    Extract3ByteRgbCompsAndAlphaFromArgb(pixel, COMP_PREFIX)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   193
90ce3da70b43 Initial load
duke
parents:
diff changeset
   194
#define Extract1ByteGrayCompsAndAlphaFromArgb(pixel, COMP_PREFIX) \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   195
    do { \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   196
        int r, g, b; \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   197
        ExtractIntDcmComponents1234(pixel, COMP_PREFIX ## A, r, g, b); \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   198
        COMP_PREFIX ## G = ComposeByteGrayFrom3ByteRgb(r, g, b); \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   199
    } while (0)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   200
90ce3da70b43 Initial load
duke
parents:
diff changeset
   201
#define Extract1ShortGrayCompsAndAlphaFromArgb(pixel, COMP_PREFIX) \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   202
    do { \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   203
        int r, g, b; \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   204
        ExtractIntDcmComponents1234(pixel, COMP_PREFIX ## A, r, g, b); \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   205
        COMP_PREFIX ## G = ComposeUshortGrayFrom3ByteRgb(r, g, b); \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   206
        COMP_PREFIX ## A = (COMP_PREFIX ## A << 8) + COMP_PREFIX ## A; \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   207
    } while (0)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   208
37800
518e44c93fbb 8015070: Antialiased text on translucent backgrounds gets bright artifacts
ntv
parents: 26751
diff changeset
   209
/*
518e44c93fbb 8015070: Antialiased text on translucent backgrounds gets bright artifacts
ntv
parents: 26751
diff changeset
   210
 * SrcOver ## TYPE ## BlendFactor
518e44c93fbb 8015070: Antialiased text on translucent backgrounds gets bright artifacts
ntv
parents: 26751
diff changeset
   211
 * Returns appropriate blend value for use in blending calculations.
518e44c93fbb 8015070: Antialiased text on translucent backgrounds gets bright artifacts
ntv
parents: 26751
diff changeset
   212
 */
518e44c93fbb 8015070: Antialiased text on translucent backgrounds gets bright artifacts
ntv
parents: 26751
diff changeset
   213
#define SrcOverIntArgbBmBlendFactor(dF, dA) \
518e44c93fbb 8015070: Antialiased text on translucent backgrounds gets bright artifacts
ntv
parents: 26751
diff changeset
   214
    (dA)
518e44c93fbb 8015070: Antialiased text on translucent backgrounds gets bright artifacts
ntv
parents: 26751
diff changeset
   215
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   216
#endif /* IntArgbBm_h_Included */