jdk/src/java.desktop/share/native/libawt/java2d/loops/Index12Gray.c
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/Index12Gray.c@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) 2001, 2004, 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
#include <string.h>
90ce3da70b43 Initial load
duke
parents:
diff changeset
    27
90ce3da70b43 Initial load
duke
parents:
diff changeset
    28
#include "AnyShort.h"
90ce3da70b43 Initial load
duke
parents:
diff changeset
    29
#include "Index12Gray.h"
90ce3da70b43 Initial load
duke
parents:
diff changeset
    30
#include "AlphaMacros.h"
90ce3da70b43 Initial load
duke
parents:
diff changeset
    31
90ce3da70b43 Initial load
duke
parents:
diff changeset
    32
#include "IntArgb.h"
90ce3da70b43 Initial load
duke
parents:
diff changeset
    33
#include "IntArgbPre.h"
90ce3da70b43 Initial load
duke
parents:
diff changeset
    34
#include "IntRgb.h"
90ce3da70b43 Initial load
duke
parents:
diff changeset
    35
#include "ThreeByteBgr.h"
90ce3da70b43 Initial load
duke
parents:
diff changeset
    36
#include "ByteGray.h"
90ce3da70b43 Initial load
duke
parents:
diff changeset
    37
#include "ByteIndexed.h"
90ce3da70b43 Initial load
duke
parents:
diff changeset
    38
#include "Index8Gray.h"
90ce3da70b43 Initial load
duke
parents:
diff changeset
    39
90ce3da70b43 Initial load
duke
parents:
diff changeset
    40
/*
90ce3da70b43 Initial load
duke
parents:
diff changeset
    41
 * This file declares, registers, and defines the various graphics
90ce3da70b43 Initial load
duke
parents:
diff changeset
    42
 * primitive loops to manipulate surfaces of type "Index12Gray".
90ce3da70b43 Initial load
duke
parents:
diff changeset
    43
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    44
 * See also LoopMacros.h
90ce3da70b43 Initial load
duke
parents:
diff changeset
    45
 */
90ce3da70b43 Initial load
duke
parents:
diff changeset
    46
90ce3da70b43 Initial load
duke
parents:
diff changeset
    47
RegisterFunc RegisterIndex12Gray;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    48
90ce3da70b43 Initial load
duke
parents:
diff changeset
    49
DECLARE_CONVERT_BLIT(Index12Gray, IntArgb);
90ce3da70b43 Initial load
duke
parents:
diff changeset
    50
DECLARE_CONVERT_BLIT(IntArgb, Index12Gray);
90ce3da70b43 Initial load
duke
parents:
diff changeset
    51
DECLARE_CONVERT_BLIT(ThreeByteBgr, Index12Gray);
90ce3da70b43 Initial load
duke
parents:
diff changeset
    52
DECLARE_CONVERT_BLIT(ByteGray, Index12Gray);
90ce3da70b43 Initial load
duke
parents:
diff changeset
    53
DECLARE_CONVERT_BLIT(Index8Gray, Index12Gray);
90ce3da70b43 Initial load
duke
parents:
diff changeset
    54
DECLARE_CONVERT_BLIT(ByteIndexed, Index12Gray);
90ce3da70b43 Initial load
duke
parents:
diff changeset
    55
DECLARE_CONVERT_BLIT(Index12Gray, Index12Gray);
90ce3da70b43 Initial load
duke
parents:
diff changeset
    56
90ce3da70b43 Initial load
duke
parents:
diff changeset
    57
DECLARE_SCALE_BLIT(Index12Gray, Index12Gray);
90ce3da70b43 Initial load
duke
parents:
diff changeset
    58
DECLARE_SCALE_BLIT(Index12Gray, IntArgb);
90ce3da70b43 Initial load
duke
parents:
diff changeset
    59
DECLARE_SCALE_BLIT(IntArgb, Index12Gray);
90ce3da70b43 Initial load
duke
parents:
diff changeset
    60
DECLARE_SCALE_BLIT(ThreeByteBgr, Index12Gray);
90ce3da70b43 Initial load
duke
parents:
diff changeset
    61
DECLARE_SCALE_BLIT(UshortGray, Index12Gray);
90ce3da70b43 Initial load
duke
parents:
diff changeset
    62
DECLARE_SCALE_BLIT(ByteIndexed, Index12Gray);
90ce3da70b43 Initial load
duke
parents:
diff changeset
    63
DECLARE_SCALE_BLIT(ByteGray, Index12Gray);
90ce3da70b43 Initial load
duke
parents:
diff changeset
    64
DECLARE_SCALE_BLIT(Index8Gray, Index12Gray);
90ce3da70b43 Initial load
duke
parents:
diff changeset
    65
90ce3da70b43 Initial load
duke
parents:
diff changeset
    66
DECLARE_XPAR_CONVERT_BLIT(ByteIndexedBm, Index12Gray);
90ce3da70b43 Initial load
duke
parents:
diff changeset
    67
DECLARE_XPAR_BLITBG(ByteIndexedBm, Index12Gray);
90ce3da70b43 Initial load
duke
parents:
diff changeset
    68
90ce3da70b43 Initial load
duke
parents:
diff changeset
    69
DECLARE_XOR_BLIT(IntArgb, Index12Gray);
90ce3da70b43 Initial load
duke
parents:
diff changeset
    70
DECLARE_ALPHA_MASKFILL(Index12Gray);
90ce3da70b43 Initial load
duke
parents:
diff changeset
    71
DECLARE_ALPHA_MASKBLIT(IntArgb, Index12Gray);
90ce3da70b43 Initial load
duke
parents:
diff changeset
    72
DECLARE_ALPHA_MASKBLIT(IntArgbPre, Index12Gray);
90ce3da70b43 Initial load
duke
parents:
diff changeset
    73
DECLARE_ALPHA_MASKBLIT(IntRgb, Index12Gray);
90ce3da70b43 Initial load
duke
parents:
diff changeset
    74
DECLARE_SRCOVER_MASKFILL(Index12Gray);
90ce3da70b43 Initial load
duke
parents:
diff changeset
    75
DECLARE_SRCOVER_MASKBLIT(IntArgb, Index12Gray);
90ce3da70b43 Initial load
duke
parents:
diff changeset
    76
DECLARE_SRCOVER_MASKBLIT(IntArgbPre, Index12Gray);
90ce3da70b43 Initial load
duke
parents:
diff changeset
    77
DECLARE_SOLID_DRAWGLYPHLISTAA(Index12Gray);
90ce3da70b43 Initial load
duke
parents:
diff changeset
    78
90ce3da70b43 Initial load
duke
parents:
diff changeset
    79
DECLARE_TRANSFORMHELPER_FUNCS(Index12Gray);
90ce3da70b43 Initial load
duke
parents:
diff changeset
    80
90ce3da70b43 Initial load
duke
parents:
diff changeset
    81
NativePrimitive Index12GrayPrimitives[] = {
90ce3da70b43 Initial load
duke
parents:
diff changeset
    82
    REGISTER_CONVERT_BLIT(IntArgb, Index12Gray),
90ce3da70b43 Initial load
duke
parents:
diff changeset
    83
    REGISTER_CONVERT_BLIT_EQUIV(IntRgb, Index12Gray,
90ce3da70b43 Initial load
duke
parents:
diff changeset
    84
                                NAME_CONVERT_BLIT(IntArgb, Index12Gray)),
90ce3da70b43 Initial load
duke
parents:
diff changeset
    85
    REGISTER_CONVERT_BLIT(ThreeByteBgr, Index12Gray),
90ce3da70b43 Initial load
duke
parents:
diff changeset
    86
    REGISTER_CONVERT_BLIT(ByteGray, Index12Gray),
90ce3da70b43 Initial load
duke
parents:
diff changeset
    87
    REGISTER_CONVERT_BLIT(Index8Gray, Index12Gray),
90ce3da70b43 Initial load
duke
parents:
diff changeset
    88
    REGISTER_CONVERT_BLIT_FLAGS(Index12Gray, Index12Gray,
90ce3da70b43 Initial load
duke
parents:
diff changeset
    89
                                SD_LOCK_LUT,
90ce3da70b43 Initial load
duke
parents:
diff changeset
    90
                                SD_LOCK_LUT | SD_LOCK_INVGRAY),
90ce3da70b43 Initial load
duke
parents:
diff changeset
    91
    REGISTER_CONVERT_BLIT(ByteIndexed, Index12Gray),
90ce3da70b43 Initial load
duke
parents:
diff changeset
    92
90ce3da70b43 Initial load
duke
parents:
diff changeset
    93
    REGISTER_SCALE_BLIT(Index12Gray, IntArgb),
90ce3da70b43 Initial load
duke
parents:
diff changeset
    94
    REGISTER_SCALE_BLIT(IntArgb, Index12Gray),
90ce3da70b43 Initial load
duke
parents:
diff changeset
    95
    REGISTER_SCALE_BLIT_EQUIV(IntRgb, Index12Gray,
90ce3da70b43 Initial load
duke
parents:
diff changeset
    96
                              NAME_SCALE_BLIT(IntArgb, Index12Gray)),
90ce3da70b43 Initial load
duke
parents:
diff changeset
    97
    REGISTER_SCALE_BLIT(ThreeByteBgr, Index12Gray),
90ce3da70b43 Initial load
duke
parents:
diff changeset
    98
    REGISTER_SCALE_BLIT(UshortGray, Index12Gray),
90ce3da70b43 Initial load
duke
parents:
diff changeset
    99
    REGISTER_SCALE_BLIT(ByteIndexed, Index12Gray),
90ce3da70b43 Initial load
duke
parents:
diff changeset
   100
    REGISTER_SCALE_BLIT(ByteGray, Index12Gray),
90ce3da70b43 Initial load
duke
parents:
diff changeset
   101
    REGISTER_SCALE_BLIT(Index8Gray, Index12Gray),
90ce3da70b43 Initial load
duke
parents:
diff changeset
   102
    REGISTER_SCALE_BLIT_FLAGS(Index12Gray, Index12Gray, 0,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   103
                              SD_LOCK_LUT | SD_LOCK_INVGRAY),
90ce3da70b43 Initial load
duke
parents:
diff changeset
   104
90ce3da70b43 Initial load
duke
parents:
diff changeset
   105
    REGISTER_XPAR_CONVERT_BLIT(ByteIndexedBm, Index12Gray),
90ce3da70b43 Initial load
duke
parents:
diff changeset
   106
    REGISTER_XPAR_BLITBG(ByteIndexedBm, Index12Gray),
90ce3da70b43 Initial load
duke
parents:
diff changeset
   107
90ce3da70b43 Initial load
duke
parents:
diff changeset
   108
    REGISTER_XOR_BLIT(IntArgb, Index12Gray),
90ce3da70b43 Initial load
duke
parents:
diff changeset
   109
    REGISTER_ALPHA_MASKFILL(Index12Gray),
90ce3da70b43 Initial load
duke
parents:
diff changeset
   110
    REGISTER_ALPHA_MASKBLIT(IntArgb, Index12Gray),
90ce3da70b43 Initial load
duke
parents:
diff changeset
   111
    REGISTER_ALPHA_MASKBLIT(IntArgbPre, Index12Gray),
90ce3da70b43 Initial load
duke
parents:
diff changeset
   112
    REGISTER_ALPHA_MASKBLIT(IntRgb, Index12Gray),
90ce3da70b43 Initial load
duke
parents:
diff changeset
   113
    REGISTER_SRCOVER_MASKFILL(Index12Gray),
90ce3da70b43 Initial load
duke
parents:
diff changeset
   114
    REGISTER_SRCOVER_MASKBLIT(IntArgb, Index12Gray),
90ce3da70b43 Initial load
duke
parents:
diff changeset
   115
    REGISTER_SRCOVER_MASKBLIT(IntArgbPre, Index12Gray),
90ce3da70b43 Initial load
duke
parents:
diff changeset
   116
    REGISTER_SOLID_DRAWGLYPHLISTAA(Index12Gray),
90ce3da70b43 Initial load
duke
parents:
diff changeset
   117
90ce3da70b43 Initial load
duke
parents:
diff changeset
   118
    REGISTER_TRANSFORMHELPER_FUNCS(Index12Gray),
90ce3da70b43 Initial load
duke
parents:
diff changeset
   119
};
90ce3da70b43 Initial load
duke
parents:
diff changeset
   120
90ce3da70b43 Initial load
duke
parents:
diff changeset
   121
extern jboolean checkSameLut(jint *SrcReadLut, jint *DstReadLut,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   122
                             SurfaceDataRasInfo *pSrcInfo,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   123
                             SurfaceDataRasInfo *pDstInfo);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   124
90ce3da70b43 Initial load
duke
parents:
diff changeset
   125
jboolean RegisterIndex12Gray(JNIEnv *env)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   126
{
90ce3da70b43 Initial load
duke
parents:
diff changeset
   127
    return RegisterPrimitives(env, Index12GrayPrimitives,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   128
                              ArraySize(Index12GrayPrimitives));
90ce3da70b43 Initial load
duke
parents:
diff changeset
   129
}
90ce3da70b43 Initial load
duke
parents:
diff changeset
   130
90ce3da70b43 Initial load
duke
parents:
diff changeset
   131
jint PixelForIndex12Gray(SurfaceDataRasInfo *pRasInfo, jint rgb)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   132
{
90ce3da70b43 Initial load
duke
parents:
diff changeset
   133
    jint r, g, b, gray;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   134
    ExtractIntDcmComponentsX123(rgb, r, g, b);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   135
    gray = ComposeByteGrayFrom3ByteRgb(r, g, b);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   136
    return pRasInfo->invGrayTable[gray];
90ce3da70b43 Initial load
duke
parents:
diff changeset
   137
}
90ce3da70b43 Initial load
duke
parents:
diff changeset
   138
90ce3da70b43 Initial load
duke
parents:
diff changeset
   139
DEFINE_CONVERT_BLIT(IntArgb, Index12Gray, 3ByteRgb)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   140
90ce3da70b43 Initial load
duke
parents:
diff changeset
   141
DEFINE_CONVERT_BLIT(ThreeByteBgr, Index12Gray, 3ByteRgb)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   142
90ce3da70b43 Initial load
duke
parents:
diff changeset
   143
DEFINE_CONVERT_BLIT(ByteGray, Index12Gray, 1ByteGray)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   144
90ce3da70b43 Initial load
duke
parents:
diff changeset
   145
DEFINE_CONVERT_BLIT(Index8Gray, Index12Gray, 1ByteGray)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   146
90ce3da70b43 Initial load
duke
parents:
diff changeset
   147
DEFINE_CONVERT_BLIT(ByteIndexed, Index12Gray, 3ByteRgb)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   148
90ce3da70b43 Initial load
duke
parents:
diff changeset
   149
void NAME_CONVERT_BLIT(Index12Gray, Index12Gray)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   150
    (void *srcBase, void *dstBase,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   151
     juint width, juint height,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   152
     SurfaceDataRasInfo *pSrcInfo,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   153
     SurfaceDataRasInfo *pDstInfo,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   154
     NativePrimitive *pPrim,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   155
     CompositeInfo *pCompInfo)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   156
{
90ce3da70b43 Initial load
duke
parents:
diff changeset
   157
    DeclareIndex12GrayLoadVars(SrcRead)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   158
    DeclareIndex12GrayLoadVars(DstRead)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   159
    jint srcScan = pSrcInfo->scanStride;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   160
    jint dstScan = pDstInfo->scanStride;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   161
90ce3da70b43 Initial load
duke
parents:
diff changeset
   162
    InitIndex12GrayLoadVars(SrcRead, pSrcInfo);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   163
    InitIndex12GrayLoadVars(DstRead, pDstInfo);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   164
90ce3da70b43 Initial load
duke
parents:
diff changeset
   165
    if (checkSameLut(SrcReadLut, DstReadLut, pSrcInfo, pDstInfo)) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   166
        do {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   167
            memcpy(dstBase, srcBase, width);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   168
            srcBase = PtrAddBytes(srcBase, srcScan);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   169
            dstBase = PtrAddBytes(dstBase, dstScan);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   170
        } while (--height > 0);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   171
    } else {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   172
        DeclareIndex12GrayStoreVars(DstWrite);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   173
        InitIndex12GrayStoreVarsY(DstWrite, pDstInfo);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   174
90ce3da70b43 Initial load
duke
parents:
diff changeset
   175
        BlitLoopWidthHeight(Index12Gray, pSrc, srcBase, pSrcInfo,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   176
                            Index12Gray, pDst, dstBase, pDstInfo, DstWrite,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   177
                            width, height,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   178
                            ConvertVia1ByteGray
90ce3da70b43 Initial load
duke
parents:
diff changeset
   179
                                (pSrc, Index12Gray, SrcRead,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   180
                                 pDst, Index12Gray, DstWrite, 0, 0));
90ce3da70b43 Initial load
duke
parents:
diff changeset
   181
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   182
}
90ce3da70b43 Initial load
duke
parents:
diff changeset
   183
90ce3da70b43 Initial load
duke
parents:
diff changeset
   184
void NAME_SCALE_BLIT(Index12Gray, Index12Gray)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   185
    (void *srcBase, void *dstBase,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   186
     juint width, juint height,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   187
     jint sxloc, jint syloc,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   188
     jint sxinc, jint syinc, jint shift,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   189
     SurfaceDataRasInfo *pSrcInfo,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   190
     SurfaceDataRasInfo *pDstInfo,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   191
     NativePrimitive *pPrim,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   192
     CompositeInfo *pCompInfo)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   193
{
90ce3da70b43 Initial load
duke
parents:
diff changeset
   194
    DeclareIndex8GrayLoadVars(SrcRead)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   195
    DeclareIndex8GrayLoadVars(DstRead)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   196
    jint srcScan = pSrcInfo->scanStride;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   197
    jint dstScan = pDstInfo->scanStride;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   198
    DeclareIndex8GrayStoreVars(DstWrite)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   199
90ce3da70b43 Initial load
duke
parents:
diff changeset
   200
    InitIndex8GrayLoadVars(SrcRead, pSrcInfo);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   201
    InitIndex8GrayLoadVars(DstRead, pDstInfo);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   202
90ce3da70b43 Initial load
duke
parents:
diff changeset
   203
    if (checkSameLut(SrcReadLut, DstReadLut, pSrcInfo, pDstInfo)) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   204
        BlitLoopScaleWidthHeight(Index8Gray, pSrc, srcBase, pSrcInfo,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   205
                                 Index8Gray, pDst, dstBase, pDstInfo, DstWrite,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   206
                                 x, width, height,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   207
                                 sxloc, syloc, sxinc, syinc, shift,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   208
                                 pDst[0] = pSrc[x]);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   209
    } else {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   210
        DeclareIndex8GrayStoreVars(DstWrite);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   211
        InitIndex8GrayStoreVarsY(DstWrite, pDstInfo);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   212
        BlitLoopScaleWidthHeight(Index8Gray, pSrc, srcBase, pSrcInfo,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   213
                                 Index8Gray, pDst, dstBase, pDstInfo, DstWrite,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   214
                                 x, width, height,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   215
                                 sxloc, syloc, sxinc, syinc, shift,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   216
                                 ConvertVia1ByteGray(pSrc, Index8Gray, SrcRead,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   217
                                                     pDst, Index8Gray, DstWrite,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   218
                                                     x, 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
90ce3da70b43 Initial load
duke
parents:
diff changeset
   222
DEFINE_SCALE_BLIT(Index12Gray, IntArgb, 1IntArgb)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   223
90ce3da70b43 Initial load
duke
parents:
diff changeset
   224
DEFINE_SCALE_BLIT(IntArgb, Index12Gray, 3ByteRgb)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   225
90ce3da70b43 Initial load
duke
parents:
diff changeset
   226
DEFINE_SCALE_BLIT(ThreeByteBgr, Index12Gray, 3ByteRgb)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   227
90ce3da70b43 Initial load
duke
parents:
diff changeset
   228
DEFINE_SCALE_BLIT(UshortGray, Index12Gray, 1ByteGray)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   229
90ce3da70b43 Initial load
duke
parents:
diff changeset
   230
DEFINE_SCALE_BLIT_LUT8(ByteIndexed, Index12Gray, PreProcessLut)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   231
90ce3da70b43 Initial load
duke
parents:
diff changeset
   232
DEFINE_SCALE_BLIT(ByteGray, Index12Gray, 1ByteGray)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   233
90ce3da70b43 Initial load
duke
parents:
diff changeset
   234
DEFINE_SCALE_BLIT_LUT8(Index8Gray, Index12Gray, PreProcessLut)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   235
90ce3da70b43 Initial load
duke
parents:
diff changeset
   236
DEFINE_XPAR_CONVERT_BLIT_LUT8(ByteIndexedBm, Index12Gray, PreProcessLut)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   237
90ce3da70b43 Initial load
duke
parents:
diff changeset
   238
DEFINE_XPAR_BLITBG_LUT8(ByteIndexedBm, Index12Gray, PreProcessLut)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   239
90ce3da70b43 Initial load
duke
parents:
diff changeset
   240
DEFINE_XOR_BLIT(IntArgb, Index12Gray, AnyShort)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   241
90ce3da70b43 Initial load
duke
parents:
diff changeset
   242
DEFINE_ALPHA_MASKFILL(Index12Gray, 1ByteGray)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   243
90ce3da70b43 Initial load
duke
parents:
diff changeset
   244
DEFINE_ALPHA_MASKBLIT(IntArgb, Index12Gray, 1ByteGray)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   245
90ce3da70b43 Initial load
duke
parents:
diff changeset
   246
DEFINE_ALPHA_MASKBLIT(IntArgbPre, Index12Gray, 1ByteGray)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   247
90ce3da70b43 Initial load
duke
parents:
diff changeset
   248
DEFINE_ALPHA_MASKBLIT(IntRgb, Index12Gray, 1ByteGray)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   249
90ce3da70b43 Initial load
duke
parents:
diff changeset
   250
DEFINE_SRCOVER_MASKFILL(Index12Gray, 1ByteGray)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   251
90ce3da70b43 Initial load
duke
parents:
diff changeset
   252
DEFINE_SRCOVER_MASKBLIT(IntArgb, Index12Gray, 1ByteGray)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   253
90ce3da70b43 Initial load
duke
parents:
diff changeset
   254
DEFINE_SRCOVER_MASKBLIT(IntArgbPre, Index12Gray, 1ByteGray)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   255
90ce3da70b43 Initial load
duke
parents:
diff changeset
   256
DEFINE_SOLID_DRAWGLYPHLISTAA(Index12Gray, 1ByteGray)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   257
90ce3da70b43 Initial load
duke
parents:
diff changeset
   258
DEFINE_TRANSFORMHELPERS(Index12Gray)