jdk/src/java.desktop/share/native/libmlib_image/mlib_c_ImageAffineIndex_BL.c
author chegar
Sun, 17 Aug 2014 15:54:13 +0100
changeset 25859 3317bb8137f4
parent 5506 jdk/src/share/native/sun/awt/medialib/mlib_c_ImageAffineIndex_BL.c@202f599c92aa
permissions -rw-r--r--
8054834: Modular Source Code Reviewed-by: alanb, chegar, ihse, mduigou Contributed-by: alan.bateman@oracle.com, alex.buckley@oracle.com, chris.hegarty@oracle.com, erik.joelsson@oracle.com, jonathan.gibbons@oracle.com, karen.kinnear@oracle.com, magnus.ihse.bursie@oracle.com, mandy.chung@oracle.com, mark.reinhold@oracle.com, paul.sandoz@oracle.com
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) 1998, 2003, 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
90ce3da70b43 Initial load
duke
parents:
diff changeset
    27
#include "mlib_image.h"
90ce3da70b43 Initial load
duke
parents:
diff changeset
    28
#include "mlib_ImageAffine.h"
90ce3da70b43 Initial load
duke
parents:
diff changeset
    29
#include "mlib_ImageColormap.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
#define MLIB_LIMIT  512
90ce3da70b43 Initial load
duke
parents:
diff changeset
    33
90ce3da70b43 Initial load
duke
parents:
diff changeset
    34
/***************************************************************/
90ce3da70b43 Initial load
duke
parents:
diff changeset
    35
#define DTYPE  MLIB_TYPE
90ce3da70b43 Initial load
duke
parents:
diff changeset
    36
90ce3da70b43 Initial load
duke
parents:
diff changeset
    37
/***************************************************************/
90ce3da70b43 Initial load
duke
parents:
diff changeset
    38
#define DECLAREVAR_IND()                                        \
90ce3da70b43 Initial load
duke
parents:
diff changeset
    39
  DECLAREVAR0();                                                \
90ce3da70b43 Initial load
duke
parents:
diff changeset
    40
  mlib_s32  *warp_tbl   = param -> warp_tbl;                    \
90ce3da70b43 Initial load
duke
parents:
diff changeset
    41
  mlib_s32  xSrc, ySrc;                                         \
90ce3da70b43 Initial load
duke
parents:
diff changeset
    42
  mlib_s32  srcYStride = param -> srcYStride;                   \
90ce3da70b43 Initial load
duke
parents:
diff changeset
    43
  mlib_s32  max_xsize  = param -> max_xsize;                    \
90ce3da70b43 Initial load
duke
parents:
diff changeset
    44
  MLIB_TYPE *sp0, *sp1;                                         \
90ce3da70b43 Initial load
duke
parents:
diff changeset
    45
  MLIB_TYPE *dl;                                                \
90ce3da70b43 Initial load
duke
parents:
diff changeset
    46
  mlib_d64  scale = 1.0 / 65536.0;                              \
90ce3da70b43 Initial load
duke
parents:
diff changeset
    47
  mlib_s32  i, size
90ce3da70b43 Initial load
duke
parents:
diff changeset
    48
90ce3da70b43 Initial load
duke
parents:
diff changeset
    49
/***************************************************************/
90ce3da70b43 Initial load
duke
parents:
diff changeset
    50
#define DECLARE_INTERNAL_VAR_3CH()                              \
90ce3da70b43 Initial load
duke
parents:
diff changeset
    51
  mlib_d64  fdx, fdy;                                           \
90ce3da70b43 Initial load
duke
parents:
diff changeset
    52
  mlib_d64  a00_0, a01_0, a10_0, a11_0;                         \
90ce3da70b43 Initial load
duke
parents:
diff changeset
    53
  mlib_d64  a00_1, a01_1, a10_1, a11_1;                         \
90ce3da70b43 Initial load
duke
parents:
diff changeset
    54
  mlib_d64  a00_2, a01_2, a10_2, a11_2;                         \
90ce3da70b43 Initial load
duke
parents:
diff changeset
    55
  mlib_d64  pix0_0, pix1_0, res0;                               \
90ce3da70b43 Initial load
duke
parents:
diff changeset
    56
  mlib_d64  pix0_1, pix1_1, res1;                               \
90ce3da70b43 Initial load
duke
parents:
diff changeset
    57
  mlib_d64  pix0_2, pix1_2, res2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    58
90ce3da70b43 Initial load
duke
parents:
diff changeset
    59
/***************************************************************/
90ce3da70b43 Initial load
duke
parents:
diff changeset
    60
#define DECLARE_INTERNAL_VAR_4CH()                              \
90ce3da70b43 Initial load
duke
parents:
diff changeset
    61
  mlib_d64  fdx, fdy;                                           \
90ce3da70b43 Initial load
duke
parents:
diff changeset
    62
  mlib_d64  a00_0, a01_0, a10_0, a11_0;                         \
90ce3da70b43 Initial load
duke
parents:
diff changeset
    63
  mlib_d64  a00_1, a01_1, a10_1, a11_1;                         \
90ce3da70b43 Initial load
duke
parents:
diff changeset
    64
  mlib_d64  a00_2, a01_2, a10_2, a11_2;                         \
90ce3da70b43 Initial load
duke
parents:
diff changeset
    65
  mlib_d64  a00_3, a01_3, a10_3, a11_3;                         \
90ce3da70b43 Initial load
duke
parents:
diff changeset
    66
  mlib_d64  pix0_0, pix1_0, res0;                               \
90ce3da70b43 Initial load
duke
parents:
diff changeset
    67
  mlib_d64  pix0_1, pix1_1, res1;                               \
90ce3da70b43 Initial load
duke
parents:
diff changeset
    68
  mlib_d64  pix0_2, pix1_2, res2;                               \
90ce3da70b43 Initial load
duke
parents:
diff changeset
    69
  mlib_d64  pix0_3, pix1_3, res3
90ce3da70b43 Initial load
duke
parents:
diff changeset
    70
90ce3da70b43 Initial load
duke
parents:
diff changeset
    71
/***************************************************************/
90ce3da70b43 Initial load
duke
parents:
diff changeset
    72
#define GET_PIXELS_POINTERS()                                   \
90ce3da70b43 Initial load
duke
parents:
diff changeset
    73
  fdx = (X & MLIB_MASK) * scale;                                \
90ce3da70b43 Initial load
duke
parents:
diff changeset
    74
  fdy = (Y & MLIB_MASK) * scale;                                \
90ce3da70b43 Initial load
duke
parents:
diff changeset
    75
  ySrc = MLIB_POINTER_SHIFT(Y);  Y += dY;                       \
90ce3da70b43 Initial load
duke
parents:
diff changeset
    76
  xSrc = X >> MLIB_SHIFT;  X += dX;                             \
90ce3da70b43 Initial load
duke
parents:
diff changeset
    77
  sp0 = MLIB_POINTER_GET(lineAddr, ySrc) + xSrc;                \
90ce3da70b43 Initial load
duke
parents:
diff changeset
    78
  sp1 = (MLIB_TYPE *)((mlib_u8 *)sp0 + srcYStride)
90ce3da70b43 Initial load
duke
parents:
diff changeset
    79
90ce3da70b43 Initial load
duke
parents:
diff changeset
    80
/***************************************************************/
90ce3da70b43 Initial load
duke
parents:
diff changeset
    81
#define GET_COLOR_POINTERS(ind)                                 \
90ce3da70b43 Initial load
duke
parents:
diff changeset
    82
  pcolor00 = (lut + sp0[0]*ind);                                \
90ce3da70b43 Initial load
duke
parents:
diff changeset
    83
  pcolor10 = (lut + sp1[0]*ind);                                \
90ce3da70b43 Initial load
duke
parents:
diff changeset
    84
  pcolor01 = (lut + sp0[1]*ind);                                \
90ce3da70b43 Initial load
duke
parents:
diff changeset
    85
  pcolor11 = (lut + sp1[1]*ind)
90ce3da70b43 Initial load
duke
parents:
diff changeset
    86
90ce3da70b43 Initial load
duke
parents:
diff changeset
    87
/***************************************************************/
90ce3da70b43 Initial load
duke
parents:
diff changeset
    88
#define COUNT_BL_U8(ind)                                        \
90ce3da70b43 Initial load
duke
parents:
diff changeset
    89
  pix0_##ind = a00_##ind + fdy * (a10_##ind - a00_##ind);       \
90ce3da70b43 Initial load
duke
parents:
diff changeset
    90
  pix1_##ind = a01_##ind + fdy * (a11_##ind - a01_##ind);       \
90ce3da70b43 Initial load
duke
parents:
diff changeset
    91
  res##ind = pix0_##ind + fdx * (pix1_##ind - pix0_##ind) + 0.5
90ce3da70b43 Initial load
duke
parents:
diff changeset
    92
90ce3da70b43 Initial load
duke
parents:
diff changeset
    93
/***************************************************************/
90ce3da70b43 Initial load
duke
parents:
diff changeset
    94
#define COUNT_BL_U8_3CH()                                       \
90ce3da70b43 Initial load
duke
parents:
diff changeset
    95
  COUNT_BL_U8(0);                                               \
90ce3da70b43 Initial load
duke
parents:
diff changeset
    96
  COUNT_BL_U8(1);                                               \
90ce3da70b43 Initial load
duke
parents:
diff changeset
    97
  COUNT_BL_U8(2);
90ce3da70b43 Initial load
duke
parents:
diff changeset
    98
90ce3da70b43 Initial load
duke
parents:
diff changeset
    99
/***************************************************************/
90ce3da70b43 Initial load
duke
parents:
diff changeset
   100
#define COUNT_BL_U8_4CH()                                       \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   101
  COUNT_BL_U8_3CH();                                            \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   102
  COUNT_BL_U8(3);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   103
90ce3da70b43 Initial load
duke
parents:
diff changeset
   104
/***************************************************************/
90ce3da70b43 Initial load
duke
parents:
diff changeset
   105
#define COUNT_BL_S16(ind)                                       \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   106
  pix0_##ind = a00_##ind + fdy * (a10_##ind - a00_##ind);       \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   107
  pix1_##ind = a01_##ind + fdy * (a11_##ind - a01_##ind);       \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   108
  res##ind = pix0_##ind + fdx * (pix1_##ind - pix0_##ind)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   109
90ce3da70b43 Initial load
duke
parents:
diff changeset
   110
/***************************************************************/
90ce3da70b43 Initial load
duke
parents:
diff changeset
   111
#define COUNT_BL_S16_3CH()                                      \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   112
  COUNT_BL_S16(0);                                              \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   113
  COUNT_BL_S16(1);                                              \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   114
  COUNT_BL_S16(2);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   115
90ce3da70b43 Initial load
duke
parents:
diff changeset
   116
/***************************************************************/
90ce3da70b43 Initial load
duke
parents:
diff changeset
   117
#define COUNT_BL_S16_4CH()                                      \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   118
  COUNT_BL_S16_3CH();                                           \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   119
  COUNT_BL_S16(3);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   120
90ce3da70b43 Initial load
duke
parents:
diff changeset
   121
/***************************************************************/
90ce3da70b43 Initial load
duke
parents:
diff changeset
   122
#define LOAD(ind)                                               \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   123
  a00_##ind = pcolor00[ind];                                    \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   124
  a01_##ind = pcolor01[ind];                                    \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   125
  a10_##ind = pcolor10[ind];                                    \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   126
  a11_##ind = pcolor11[ind]
90ce3da70b43 Initial load
duke
parents:
diff changeset
   127
90ce3da70b43 Initial load
duke
parents:
diff changeset
   128
/***************************************************************/
90ce3da70b43 Initial load
duke
parents:
diff changeset
   129
#define LOAD_3CH()                                              \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   130
  LOAD(0);                                                      \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   131
  LOAD(1);                                                      \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   132
  LOAD(2);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   133
90ce3da70b43 Initial load
duke
parents:
diff changeset
   134
/***************************************************************/
90ce3da70b43 Initial load
duke
parents:
diff changeset
   135
#define LOAD_4CH()                                              \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   136
  LOAD_3CH();                                                   \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   137
  LOAD(3);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   138
90ce3da70b43 Initial load
duke
parents:
diff changeset
   139
/***************************************************************/
90ce3da70b43 Initial load
duke
parents:
diff changeset
   140
#define STORE_INTO_INTERM_BUF_3CH(LTYPE)                        \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   141
  dp[0] = (mlib_##LTYPE)res0;                                   \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   142
  dp[1] = (mlib_##LTYPE)res1;                                   \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   143
  dp[2] = (mlib_##LTYPE)res2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   144
90ce3da70b43 Initial load
duke
parents:
diff changeset
   145
/***************************************************************/
90ce3da70b43 Initial load
duke
parents:
diff changeset
   146
#define STORE_INTO_INTERM_BUF_4CH(LTYPE)                        \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   147
  dp[0] = (mlib_##LTYPE)res0;                                   \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   148
  dp[1] = (mlib_##LTYPE)res1;                                   \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   149
  dp[2] = (mlib_##LTYPE)res2;                                   \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   150
  dp[3] = (mlib_##LTYPE)res3
90ce3da70b43 Initial load
duke
parents:
diff changeset
   151
90ce3da70b43 Initial load
duke
parents:
diff changeset
   152
/***************************************************************/
90ce3da70b43 Initial load
duke
parents:
diff changeset
   153
#undef  MLIB_TYPE
90ce3da70b43 Initial load
duke
parents:
diff changeset
   154
#define MLIB_TYPE mlib_u8
90ce3da70b43 Initial load
duke
parents:
diff changeset
   155
90ce3da70b43 Initial load
duke
parents:
diff changeset
   156
/***************************************************************/
90ce3da70b43 Initial load
duke
parents:
diff changeset
   157
#define mlib_U8  mlib_u8
90ce3da70b43 Initial load
duke
parents:
diff changeset
   158
#define mlib_S16 mlib_s16
90ce3da70b43 Initial load
duke
parents:
diff changeset
   159
90ce3da70b43 Initial load
duke
parents:
diff changeset
   160
/***************************************************************/
90ce3da70b43 Initial load
duke
parents:
diff changeset
   161
#define FUNC_AFFINEINDEX_BL_0(ITYPE, LTYPE, NCHAN)                                               \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   162
  mlib_status mlib_ImageAffineIndex_##ITYPE##_##LTYPE##_##NCHAN##CH_BL(mlib_affine_param *param, \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   163
                                                                       const void        *colormap) \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   164
  {                                                                                              \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   165
    DECLAREVAR_IND();                                                                            \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   166
    mlib_##LTYPE  *dp, buff_lcl[NCHAN*MLIB_LIMIT], *pbuff = buff_lcl;                            \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   167
    mlib_d64 *pcolor00, *pcolor10, *pcolor01, *pcolor11;                                         \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   168
    mlib_d64 *lut = mlib_ImageGetLutDoubleData(colormap);                                        \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   169
                                                                                                 \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   170
    lut -= NCHAN*mlib_ImageGetLutOffset(colormap);                                               \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   171
                                                                                                 \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   172
    if (max_xsize > MLIB_LIMIT) {                                                                \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   173
      pbuff = mlib_malloc(NCHAN * sizeof(mlib_##LTYPE) * max_xsize);                             \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   174
      if (pbuff == NULL) return MLIB_FAILURE;                                                    \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   175
    }                                                                                            \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   176
                                                                                                 \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   177
    for (j = yStart; j <= yFinish; j++) {                                                        \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   178
      DECLARE_INTERNAL_VAR_##NCHAN##CH();                                                        \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   179
                                                                                                 \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   180
      NEW_LINE(1);                                                                               \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   181
      dp = pbuff;                                                                                \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   182
                                                                                                 \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   183
      GET_PIXELS_POINTERS();                                                                     \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   184
      GET_COLOR_POINTERS(NCHAN);                                                                 \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   185
      LOAD_##NCHAN##CH();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   186
90ce3da70b43 Initial load
duke
parents:
diff changeset
   187
    /* pragma pipeloop(0) must be here */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   188
90ce3da70b43 Initial load
duke
parents:
diff changeset
   189
/***************************************************************/
90ce3da70b43 Initial load
duke
parents:
diff changeset
   190
#define FUNC_AFFINEINDEX_BL_1(ITYPE, LTYPE, NCHAN)                   \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   191
      for (i = 0; i < (xRight - xLeft); i++, dp += NCHAN) {          \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   192
        COUNT_BL_##LTYPE##_##NCHAN##CH();                            \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   193
                                                                     \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   194
        GET_PIXELS_POINTERS();                                       \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   195
        GET_COLOR_POINTERS(NCHAN);                                   \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   196
        LOAD_##NCHAN##CH();                                          \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   197
                                                                     \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   198
        STORE_INTO_INTERM_BUF_##NCHAN##CH(LTYPE);                    \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   199
      }                                                              \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   200
                                                                     \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   201
      COUNT_BL_##LTYPE##_##NCHAN##CH();                              \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   202
      STORE_INTO_INTERM_BUF_##NCHAN##CH(LTYPE);                      \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   203
                                                                     \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   204
      mlib_ImageColorTrue2IndexLine_##LTYPE##_##ITYPE##_##NCHAN      \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   205
                          (pbuff, dl, xRight - xLeft + 1, colormap); \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   206
    }                                                                \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   207
                                                                     \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   208
    if (pbuff != buff_lcl) mlib_free(pbuff);                         \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   209
                                                                     \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   210
    return MLIB_SUCCESS;                                             \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   211
  }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   212
90ce3da70b43 Initial load
duke
parents:
diff changeset
   213
/***************************************************************/
90ce3da70b43 Initial load
duke
parents:
diff changeset
   214
#undef  MLIB_TYPE
90ce3da70b43 Initial load
duke
parents:
diff changeset
   215
#define MLIB_TYPE mlib_u8
90ce3da70b43 Initial load
duke
parents:
diff changeset
   216
90ce3da70b43 Initial load
duke
parents:
diff changeset
   217
FUNC_AFFINEINDEX_BL_0(U8, U8, 3)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   218
#ifdef __SUNPRO_C
90ce3da70b43 Initial load
duke
parents:
diff changeset
   219
#pragma pipeloop(0)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   220
#endif /* __SUNPRO_C */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   221
FUNC_AFFINEINDEX_BL_1(U8, U8, 3)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   222
90ce3da70b43 Initial load
duke
parents:
diff changeset
   223
FUNC_AFFINEINDEX_BL_0(U8, S16, 3)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   224
#ifdef __SUNPRO_C
90ce3da70b43 Initial load
duke
parents:
diff changeset
   225
#pragma pipeloop(0)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   226
#endif /* __SUNPRO_C */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   227
FUNC_AFFINEINDEX_BL_1(U8, S16, 3)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   228
90ce3da70b43 Initial load
duke
parents:
diff changeset
   229
FUNC_AFFINEINDEX_BL_0(U8, U8, 4)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   230
#ifdef __SUNPRO_C
90ce3da70b43 Initial load
duke
parents:
diff changeset
   231
#pragma pipeloop(0)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   232
#endif /* __SUNPRO_C */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   233
FUNC_AFFINEINDEX_BL_1(U8, U8, 4)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   234
90ce3da70b43 Initial load
duke
parents:
diff changeset
   235
FUNC_AFFINEINDEX_BL_0(U8, S16, 4)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   236
#ifdef __SUNPRO_C
90ce3da70b43 Initial load
duke
parents:
diff changeset
   237
#pragma pipeloop(0)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   238
#endif /* __SUNPRO_C */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   239
FUNC_AFFINEINDEX_BL_1(U8, S16, 4)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   240
90ce3da70b43 Initial load
duke
parents:
diff changeset
   241
/***************************************************************/
90ce3da70b43 Initial load
duke
parents:
diff changeset
   242
#undef  MLIB_TYPE
90ce3da70b43 Initial load
duke
parents:
diff changeset
   243
#define MLIB_TYPE mlib_s16
90ce3da70b43 Initial load
duke
parents:
diff changeset
   244
90ce3da70b43 Initial load
duke
parents:
diff changeset
   245
FUNC_AFFINEINDEX_BL_0(S16, U8, 3)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   246
#ifdef __SUNPRO_C
90ce3da70b43 Initial load
duke
parents:
diff changeset
   247
#pragma pipeloop(0)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   248
#endif /* __SUNPRO_C */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   249
FUNC_AFFINEINDEX_BL_1(S16, U8, 3)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   250
90ce3da70b43 Initial load
duke
parents:
diff changeset
   251
FUNC_AFFINEINDEX_BL_0(S16, S16, 3)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   252
#ifdef __SUNPRO_C
90ce3da70b43 Initial load
duke
parents:
diff changeset
   253
#pragma pipeloop(0)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   254
#endif /* __SUNPRO_C */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   255
FUNC_AFFINEINDEX_BL_1(S16, S16, 3)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   256
90ce3da70b43 Initial load
duke
parents:
diff changeset
   257
FUNC_AFFINEINDEX_BL_0(S16, U8, 4)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   258
#ifdef __SUNPRO_C
90ce3da70b43 Initial load
duke
parents:
diff changeset
   259
#pragma pipeloop(0)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   260
#endif /* __SUNPRO_C */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   261
FUNC_AFFINEINDEX_BL_1(S16, U8, 4)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   262
90ce3da70b43 Initial load
duke
parents:
diff changeset
   263
FUNC_AFFINEINDEX_BL_0(S16, S16, 4)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   264
#ifdef __SUNPRO_C
90ce3da70b43 Initial load
duke
parents:
diff changeset
   265
#pragma pipeloop(0)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   266
#endif /* __SUNPRO_C */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   267
FUNC_AFFINEINDEX_BL_1(S16, S16, 4)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   268
90ce3da70b43 Initial load
duke
parents:
diff changeset
   269
/***************************************************************/
90ce3da70b43 Initial load
duke
parents:
diff changeset
   270
const type_affine_i_fun mlib_AffineFunArr_bl_i[] = {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   271
  mlib_ImageAffineIndex_U8_U8_3CH_BL,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   272
  mlib_ImageAffineIndex_U8_U8_4CH_BL,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   273
  mlib_ImageAffineIndex_S16_U8_3CH_BL,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   274
  mlib_ImageAffineIndex_S16_U8_4CH_BL,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   275
  mlib_ImageAffineIndex_U8_S16_3CH_BL,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   276
  mlib_ImageAffineIndex_U8_S16_4CH_BL,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   277
  mlib_ImageAffineIndex_S16_S16_3CH_BL,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   278
  mlib_ImageAffineIndex_S16_S16_4CH_BL
90ce3da70b43 Initial load
duke
parents:
diff changeset
   279
};
90ce3da70b43 Initial load
duke
parents:
diff changeset
   280
/***************************************************************/