jdk/src/share/native/sun/awt/medialib/mlib_c_ImageLookUp.c
author bae
Fri, 25 Mar 2011 12:50:59 +0300
changeset 8939 04615dca2a76
parent 5506 202f599c92aa
permissions -rw-r--r--
6989717: media native code compiler warnings 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) 1997, 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
/*
90ce3da70b43 Initial load
duke
parents:
diff changeset
    28
 * FUNCTION
90ce3da70b43 Initial load
duke
parents:
diff changeset
    29
 *      mlib_ImageLookUp - table lookup
90ce3da70b43 Initial load
duke
parents:
diff changeset
    30
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    31
 * SYNOPSIS
90ce3da70b43 Initial load
duke
parents:
diff changeset
    32
 *      mlib_status mlib_ImageLookUp(mlib_image       *dst,
90ce3da70b43 Initial load
duke
parents:
diff changeset
    33
 *                                   const mlib_image *src,
90ce3da70b43 Initial load
duke
parents:
diff changeset
    34
 *                                   const void       **table)
90ce3da70b43 Initial load
duke
parents:
diff changeset
    35
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    36
 * ARGUMENT
90ce3da70b43 Initial load
duke
parents:
diff changeset
    37
 *      dst      Pointer to destination image.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    38
 *      src      Pointer to source image.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    39
 *      table    Lookup table.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    40
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    41
 * DESCRIPTION
90ce3da70b43 Initial load
duke
parents:
diff changeset
    42
 *      The mlib_ImageLookUp function performs general table lookup on an
90ce3da70b43 Initial load
duke
parents:
diff changeset
    43
 *      image. The destination image is obtained by passing a source image
90ce3da70b43 Initial load
duke
parents:
diff changeset
    44
 *      through a lookup table.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    45
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    46
 *      The source image may be 1-, 2-, 3-, or 4-channeled of data types
90ce3da70b43 Initial load
duke
parents:
diff changeset
    47
 *      MLIB_BIT, MLIB_BYTE, MLIB_SHORT, MLIB_USHORT, or MLIB_INT. The lookup
90ce3da70b43 Initial load
duke
parents:
diff changeset
    48
 *      table may be 1-, 2-, 3-, or 4-channeled of data types MLIB_BYTE,
90ce3da70b43 Initial load
duke
parents:
diff changeset
    49
 *      MLIB_SHORT, MLIB_USHORT, MLIB_INT, MLIB_FLOAT, or MLIB_DOUBLE.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    50
 *      The destination image must have the same
90ce3da70b43 Initial load
duke
parents:
diff changeset
    51
 *      number of channels as either source image or the lookup table,
90ce3da70b43 Initial load
duke
parents:
diff changeset
    52
 *      whichever is greater, and the same data type as the lookup table.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    53
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    54
 *      It is the user's responsibility to make sure that the lookup table
90ce3da70b43 Initial load
duke
parents:
diff changeset
    55
 *      supplied is suitable for the source image. Specifically, the table
90ce3da70b43 Initial load
duke
parents:
diff changeset
    56
 *      entries cover the entire range of source data. Otherwise, the result
90ce3da70b43 Initial load
duke
parents:
diff changeset
    57
 *      of this function is undefined.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    58
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    59
 *      The pixel values of the destination image are defined as the following:
90ce3da70b43 Initial load
duke
parents:
diff changeset
    60
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    61
 *      If the source image is single-channeled and the destination image is
90ce3da70b43 Initial load
duke
parents:
diff changeset
    62
 *      multi-channeled, then the lookup table has the same number of channels
90ce3da70b43 Initial load
duke
parents:
diff changeset
    63
 *      as the destination image:
90ce3da70b43 Initial load
duke
parents:
diff changeset
    64
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    65
 *          dst[x][y][c] = table[c][src[x][y][0]]
90ce3da70b43 Initial load
duke
parents:
diff changeset
    66
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    67
 *      If the source image is multi-channeled and the destination image is
90ce3da70b43 Initial load
duke
parents:
diff changeset
    68
 *      multi-channeled, with the same number of channels as the source image,
90ce3da70b43 Initial load
duke
parents:
diff changeset
    69
 *      then the lookup table will have the same number of channels as
90ce3da70b43 Initial load
duke
parents:
diff changeset
    70
 *      the source image:
90ce3da70b43 Initial load
duke
parents:
diff changeset
    71
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    72
 *          dst[x][y][c] = table[c][src[x][y][c]]
90ce3da70b43 Initial load
duke
parents:
diff changeset
    73
 */
90ce3da70b43 Initial load
duke
parents:
diff changeset
    74
90ce3da70b43 Initial load
duke
parents:
diff changeset
    75
#include "mlib_image.h"
90ce3da70b43 Initial load
duke
parents:
diff changeset
    76
#include "mlib_ImageCheck.h"
90ce3da70b43 Initial load
duke
parents:
diff changeset
    77
#include "mlib_ImageLookUp.h"
90ce3da70b43 Initial load
duke
parents:
diff changeset
    78
#include "mlib_c_ImageLookUp.h"
90ce3da70b43 Initial load
duke
parents:
diff changeset
    79
90ce3da70b43 Initial load
duke
parents:
diff changeset
    80
/***************************************************************/
90ce3da70b43 Initial load
duke
parents:
diff changeset
    81
mlib_status mlib_ImageLookUp(mlib_image       *dst,
90ce3da70b43 Initial load
duke
parents:
diff changeset
    82
                             const mlib_image *src,
90ce3da70b43 Initial load
duke
parents:
diff changeset
    83
                             const void       **table)
90ce3da70b43 Initial load
duke
parents:
diff changeset
    84
{
90ce3da70b43 Initial load
duke
parents:
diff changeset
    85
  mlib_s32   slb, dlb, xsize, ysize, nchan, ichan, bitoff_src;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    86
  mlib_type  stype, dtype;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    87
  void       *sa, *da;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    88
90ce3da70b43 Initial load
duke
parents:
diff changeset
    89
  MLIB_IMAGE_CHECK(src);
90ce3da70b43 Initial load
duke
parents:
diff changeset
    90
  MLIB_IMAGE_CHECK(dst);
90ce3da70b43 Initial load
duke
parents:
diff changeset
    91
  MLIB_IMAGE_SIZE_EQUAL(src, dst);
90ce3da70b43 Initial load
duke
parents:
diff changeset
    92
  MLIB_IMAGE_CHAN_SRC1_OR_EQ(src, dst);
90ce3da70b43 Initial load
duke
parents:
diff changeset
    93
90ce3da70b43 Initial load
duke
parents:
diff changeset
    94
  stype = mlib_ImageGetType(src);
90ce3da70b43 Initial load
duke
parents:
diff changeset
    95
  dtype = mlib_ImageGetType(dst);
90ce3da70b43 Initial load
duke
parents:
diff changeset
    96
  ichan = mlib_ImageGetChannels(src);
90ce3da70b43 Initial load
duke
parents:
diff changeset
    97
  nchan = mlib_ImageGetChannels(dst);
90ce3da70b43 Initial load
duke
parents:
diff changeset
    98
  xsize = mlib_ImageGetWidth(src);
90ce3da70b43 Initial load
duke
parents:
diff changeset
    99
  ysize = mlib_ImageGetHeight(src);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   100
  slb   = mlib_ImageGetStride(src);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   101
  dlb   = mlib_ImageGetStride(dst);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   102
  sa    = mlib_ImageGetData(src);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   103
  da    = mlib_ImageGetData(dst);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   104
90ce3da70b43 Initial load
duke
parents:
diff changeset
   105
  if (ichan == nchan) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   106
    if (dtype == MLIB_BYTE) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   107
      if (stype == MLIB_BYTE) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   108
90ce3da70b43 Initial load
duke
parents:
diff changeset
   109
        mlib_c_ImageLookUp_U8_U8(sa, slb,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   110
                                 da, dlb,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   111
                                 xsize, ysize, nchan,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   112
                                 (const mlib_u8 **) table);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   113
90ce3da70b43 Initial load
duke
parents:
diff changeset
   114
        return MLIB_SUCCESS;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   115
90ce3da70b43 Initial load
duke
parents:
diff changeset
   116
      } else if (stype == MLIB_SHORT) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   117
90ce3da70b43 Initial load
duke
parents:
diff changeset
   118
        mlib_c_ImageLookUp_S16_U8(sa, slb/2,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   119
                                  da, dlb,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   120
                                  xsize, ysize, nchan,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   121
                                  (const mlib_u8 **) table);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   122
        return MLIB_SUCCESS;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   123
90ce3da70b43 Initial load
duke
parents:
diff changeset
   124
      } else if (stype == MLIB_USHORT) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   125
90ce3da70b43 Initial load
duke
parents:
diff changeset
   126
        mlib_c_ImageLookUp_U16_U8(sa, slb/2,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   127
                                  da, dlb,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   128
                                  xsize, ysize, nchan,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   129
                                  (const mlib_u8 **) table);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   130
        return MLIB_SUCCESS;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   131
90ce3da70b43 Initial load
duke
parents:
diff changeset
   132
      } else if (stype == MLIB_INT) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   133
90ce3da70b43 Initial load
duke
parents:
diff changeset
   134
        mlib_c_ImageLookUp_S32_U8(sa, slb/4,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   135
                                  da, dlb,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   136
                                  xsize, ysize, nchan,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   137
                                  (const mlib_u8 **) table);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   138
        return MLIB_SUCCESS;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   139
90ce3da70b43 Initial load
duke
parents:
diff changeset
   140
      } else if (stype == MLIB_BIT) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   141
90ce3da70b43 Initial load
duke
parents:
diff changeset
   142
        if (nchan != 1) return MLIB_FAILURE;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   143
90ce3da70b43 Initial load
duke
parents:
diff changeset
   144
        bitoff_src = mlib_ImageGetBitOffset(src);   /* bits to first byte */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   145
        return mlib_ImageLookUp_Bit_U8_1(sa, slb,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   146
                                da, dlb,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   147
                                xsize, ysize, nchan, bitoff_src,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   148
                                (const mlib_u8 **) table);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   149
      }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   150
90ce3da70b43 Initial load
duke
parents:
diff changeset
   151
    } else if (dtype == MLIB_SHORT) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   152
90ce3da70b43 Initial load
duke
parents:
diff changeset
   153
      if (stype == MLIB_BYTE) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   154
90ce3da70b43 Initial load
duke
parents:
diff changeset
   155
        mlib_c_ImageLookUp_U8_S16(sa, slb,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   156
                                  da, dlb/2,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   157
                                  xsize, ysize, nchan,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   158
                                  (const mlib_s16 **) table);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   159
90ce3da70b43 Initial load
duke
parents:
diff changeset
   160
        return MLIB_SUCCESS;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   161
90ce3da70b43 Initial load
duke
parents:
diff changeset
   162
      } else if (stype == MLIB_SHORT) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   163
90ce3da70b43 Initial load
duke
parents:
diff changeset
   164
        mlib_c_ImageLookUp_S16_S16(sa, slb/2,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   165
                                   da, dlb/2,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   166
                                   xsize, ysize, nchan,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   167
                                   (const mlib_s16 **) table);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   168
        return MLIB_SUCCESS;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   169
90ce3da70b43 Initial load
duke
parents:
diff changeset
   170
      } else if (stype == MLIB_USHORT) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   171
90ce3da70b43 Initial load
duke
parents:
diff changeset
   172
        mlib_c_ImageLookUp_U16_S16(sa, slb/2,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   173
                                   da, dlb/2,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   174
                                   xsize, ysize, nchan,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   175
                                   (const mlib_s16 **) table);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   176
        return MLIB_SUCCESS;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   177
90ce3da70b43 Initial load
duke
parents:
diff changeset
   178
      } else if (stype == MLIB_INT) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   179
90ce3da70b43 Initial load
duke
parents:
diff changeset
   180
        mlib_c_ImageLookUp_S32_S16(sa, slb/4,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   181
                                   da, dlb/2,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   182
                                   xsize, ysize, nchan,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   183
                                   (const mlib_s16 **) table);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   184
        return MLIB_SUCCESS;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   185
      }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   186
90ce3da70b43 Initial load
duke
parents:
diff changeset
   187
    } else if (dtype == MLIB_USHORT) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   188
90ce3da70b43 Initial load
duke
parents:
diff changeset
   189
      if (stype == MLIB_BYTE) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   190
90ce3da70b43 Initial load
duke
parents:
diff changeset
   191
        mlib_c_ImageLookUp_U8_U16(sa, slb,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   192
                                  da, dlb/2,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   193
                                  xsize, ysize, nchan,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   194
                                  (const mlib_s16 **) table);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   195
90ce3da70b43 Initial load
duke
parents:
diff changeset
   196
        return MLIB_SUCCESS;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   197
90ce3da70b43 Initial load
duke
parents:
diff changeset
   198
      } else if (stype == MLIB_SHORT) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   199
90ce3da70b43 Initial load
duke
parents:
diff changeset
   200
        mlib_c_ImageLookUp_S16_U16(sa, slb/2,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   201
                                   da, dlb/2,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   202
                                   xsize, ysize, nchan,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   203
                                   (const mlib_s16 **) table);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   204
        return MLIB_SUCCESS;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   205
90ce3da70b43 Initial load
duke
parents:
diff changeset
   206
      } else if (stype == MLIB_USHORT) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   207
90ce3da70b43 Initial load
duke
parents:
diff changeset
   208
        mlib_c_ImageLookUp_U16_U16(sa, slb/2,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   209
                                   da, dlb/2,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   210
                                   xsize, ysize, nchan,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   211
                                   (const mlib_s16 **) table);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   212
        return MLIB_SUCCESS;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   213
90ce3da70b43 Initial load
duke
parents:
diff changeset
   214
      } else if (stype == MLIB_INT) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   215
90ce3da70b43 Initial load
duke
parents:
diff changeset
   216
        mlib_c_ImageLookUp_S32_U16(sa, slb/4,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   217
                                   da, dlb/2,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   218
                                   xsize, ysize, nchan,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   219
                                   (const mlib_s16 **) table);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   220
        return MLIB_SUCCESS;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   221
      }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   222
90ce3da70b43 Initial load
duke
parents:
diff changeset
   223
    } else if (dtype == MLIB_INT) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   224
90ce3da70b43 Initial load
duke
parents:
diff changeset
   225
      if (stype == MLIB_BYTE) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   226
90ce3da70b43 Initial load
duke
parents:
diff changeset
   227
        mlib_c_ImageLookUp_U8_S32(sa, slb,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   228
                                  da, dlb/4,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   229
                                  xsize, ysize, nchan,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   230
                                  (const mlib_s32 **) table);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   231
90ce3da70b43 Initial load
duke
parents:
diff changeset
   232
        return MLIB_SUCCESS;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   233
90ce3da70b43 Initial load
duke
parents:
diff changeset
   234
      } else if (stype == MLIB_SHORT) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   235
90ce3da70b43 Initial load
duke
parents:
diff changeset
   236
        mlib_c_ImageLookUp_S16_S32(sa, slb/2,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   237
                                   da, dlb/4,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   238
                                   xsize, ysize, nchan,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   239
                                   (const mlib_s32 **) table);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   240
        return MLIB_SUCCESS;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   241
90ce3da70b43 Initial load
duke
parents:
diff changeset
   242
      } else if (stype == MLIB_USHORT) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   243
90ce3da70b43 Initial load
duke
parents:
diff changeset
   244
        mlib_c_ImageLookUp_U16_S32(sa, slb/2,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   245
                                   da, dlb/4,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   246
                                   xsize, ysize, nchan,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   247
                                   (const mlib_s32 **) table);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   248
        return MLIB_SUCCESS;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   249
90ce3da70b43 Initial load
duke
parents:
diff changeset
   250
      } else if (stype == MLIB_INT) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   251
90ce3da70b43 Initial load
duke
parents:
diff changeset
   252
        mlib_c_ImageLookUp_S32_S32(sa, slb/4,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   253
                                   da, dlb/4,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   254
                                   xsize, ysize, nchan,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   255
                                   (const mlib_s32 **) table);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   256
        return MLIB_SUCCESS;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   257
      }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   258
90ce3da70b43 Initial load
duke
parents:
diff changeset
   259
    } else if (dtype == MLIB_FLOAT) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   260
90ce3da70b43 Initial load
duke
parents:
diff changeset
   261
      if (stype == MLIB_BYTE) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   262
90ce3da70b43 Initial load
duke
parents:
diff changeset
   263
        mlib_c_ImageLookUp_U8_S32(sa, slb,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   264
                                  da, dlb/4,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   265
                                  xsize, ysize, nchan,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   266
                                  (const mlib_s32 **) table);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   267
90ce3da70b43 Initial load
duke
parents:
diff changeset
   268
        return MLIB_SUCCESS;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   269
90ce3da70b43 Initial load
duke
parents:
diff changeset
   270
      } else if (stype == MLIB_SHORT) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   271
90ce3da70b43 Initial load
duke
parents:
diff changeset
   272
        mlib_c_ImageLookUp_S16_S32(sa, slb/2,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   273
                                   da, dlb/4,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   274
                                   xsize, ysize, nchan,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   275
                                   (const mlib_s32 **) table);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   276
        return MLIB_SUCCESS;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   277
90ce3da70b43 Initial load
duke
parents:
diff changeset
   278
      } else if (stype == MLIB_USHORT) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   279
90ce3da70b43 Initial load
duke
parents:
diff changeset
   280
        mlib_c_ImageLookUp_U16_S32(sa, slb/2,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   281
                                   da, dlb/4,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   282
                                   xsize, ysize, nchan,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   283
                                   (const mlib_s32 **) table);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   284
        return MLIB_SUCCESS;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   285
90ce3da70b43 Initial load
duke
parents:
diff changeset
   286
      } else if (stype == MLIB_INT) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   287
90ce3da70b43 Initial load
duke
parents:
diff changeset
   288
        mlib_c_ImageLookUp_S32_S32(sa, slb/4,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   289
                                   da, dlb/4,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   290
                                   xsize, ysize, nchan,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   291
                                   (const mlib_s32 **) table);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   292
        return MLIB_SUCCESS;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   293
      }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   294
90ce3da70b43 Initial load
duke
parents:
diff changeset
   295
    } else if (dtype == MLIB_DOUBLE) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   296
90ce3da70b43 Initial load
duke
parents:
diff changeset
   297
      if (stype == MLIB_BYTE) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   298
90ce3da70b43 Initial load
duke
parents:
diff changeset
   299
        mlib_ImageLookUp_U8_D64(sa, slb,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   300
                                da, dlb/8,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   301
                                xsize, ysize, nchan,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   302
                                (const mlib_d64 **) table);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   303
90ce3da70b43 Initial load
duke
parents:
diff changeset
   304
        return MLIB_SUCCESS;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   305
90ce3da70b43 Initial load
duke
parents:
diff changeset
   306
      } else if (stype == MLIB_SHORT) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   307
90ce3da70b43 Initial load
duke
parents:
diff changeset
   308
        mlib_ImageLookUp_S16_D64(sa, slb/2,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   309
                                 da, dlb/8,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   310
                                 xsize, ysize, nchan,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   311
                                 (const mlib_d64 **) table);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   312
        return MLIB_SUCCESS;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   313
90ce3da70b43 Initial load
duke
parents:
diff changeset
   314
      } else if (stype == MLIB_USHORT) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   315
90ce3da70b43 Initial load
duke
parents:
diff changeset
   316
        mlib_ImageLookUp_U16_D64(sa, slb/2,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   317
                                 da, dlb/8,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   318
                                 xsize, ysize, nchan,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   319
                                 (const mlib_d64 **) table);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   320
        return MLIB_SUCCESS;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   321
90ce3da70b43 Initial load
duke
parents:
diff changeset
   322
      } else if (stype == MLIB_INT) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   323
90ce3da70b43 Initial load
duke
parents:
diff changeset
   324
        mlib_ImageLookUp_S32_D64(sa, slb/4,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   325
                                 da, dlb/8,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   326
                                 xsize, ysize, nchan,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   327
                                 (const mlib_d64 **) table);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   328
        return MLIB_SUCCESS;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   329
      }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   330
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   331
90ce3da70b43 Initial load
duke
parents:
diff changeset
   332
  } else if (ichan == 1) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   333
90ce3da70b43 Initial load
duke
parents:
diff changeset
   334
    if (dtype == MLIB_BYTE) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   335
90ce3da70b43 Initial load
duke
parents:
diff changeset
   336
      if (stype == MLIB_BYTE) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   337
90ce3da70b43 Initial load
duke
parents:
diff changeset
   338
        mlib_c_ImageLookUpSI_U8_U8(sa, slb,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   339
                                   da, dlb,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   340
                                   xsize, ysize, nchan,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   341
                                   (const mlib_u8 **) table);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   342
90ce3da70b43 Initial load
duke
parents:
diff changeset
   343
        return MLIB_SUCCESS;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   344
90ce3da70b43 Initial load
duke
parents:
diff changeset
   345
      } else if (stype == MLIB_SHORT) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   346
90ce3da70b43 Initial load
duke
parents:
diff changeset
   347
        mlib_c_ImageLookUpSI_S16_U8(sa, slb/2,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   348
                                    da, dlb,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   349
                                    xsize, ysize, nchan,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   350
                                    (const mlib_u8 **) table);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   351
        return MLIB_SUCCESS;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   352
90ce3da70b43 Initial load
duke
parents:
diff changeset
   353
      } else if (stype == MLIB_USHORT) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   354
90ce3da70b43 Initial load
duke
parents:
diff changeset
   355
        mlib_c_ImageLookUpSI_U16_U8(sa, slb/2,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   356
                                    da, dlb,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   357
                                    xsize, ysize, nchan,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   358
                                    (const mlib_u8 **) table);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   359
        return MLIB_SUCCESS;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   360
90ce3da70b43 Initial load
duke
parents:
diff changeset
   361
      } else if (stype == MLIB_INT) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   362
90ce3da70b43 Initial load
duke
parents:
diff changeset
   363
        mlib_c_ImageLookUpSI_S32_U8(sa, slb/4,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   364
                                    da, dlb,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   365
                                    xsize, ysize, nchan,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   366
                                    (const mlib_u8 **) table);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   367
        return MLIB_SUCCESS;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   368
90ce3da70b43 Initial load
duke
parents:
diff changeset
   369
      } else if (stype == MLIB_BIT) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   370
90ce3da70b43 Initial load
duke
parents:
diff changeset
   371
        bitoff_src = mlib_ImageGetBitOffset(src);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   372
90ce3da70b43 Initial load
duke
parents:
diff changeset
   373
        if (nchan == 2) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   374
90ce3da70b43 Initial load
duke
parents:
diff changeset
   375
        return mlib_ImageLookUp_Bit_U8_2(sa, slb,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   376
                                da, dlb,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   377
                                xsize, ysize, nchan, bitoff_src,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   378
                                (const mlib_u8 **) table);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   379
        } else  if (nchan == 3) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   380
90ce3da70b43 Initial load
duke
parents:
diff changeset
   381
        return mlib_ImageLookUp_Bit_U8_3(sa, slb,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   382
                                da, dlb,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   383
                                xsize, ysize, nchan, bitoff_src,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   384
                                (const mlib_u8 **) table);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   385
90ce3da70b43 Initial load
duke
parents:
diff changeset
   386
        } else /* (nchan == 4) */ {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   387
90ce3da70b43 Initial load
duke
parents:
diff changeset
   388
        return mlib_ImageLookUp_Bit_U8_4(sa, slb,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   389
                                da, dlb,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   390
                                xsize, ysize, nchan, bitoff_src,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   391
                                (const mlib_u8 **) table);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   392
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   393
      }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   394
90ce3da70b43 Initial load
duke
parents:
diff changeset
   395
    } else if (dtype == MLIB_SHORT) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   396
90ce3da70b43 Initial load
duke
parents:
diff changeset
   397
      if (stype == MLIB_BYTE) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   398
90ce3da70b43 Initial load
duke
parents:
diff changeset
   399
        mlib_c_ImageLookUpSI_U8_S16(sa, slb,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   400
                                    da, dlb/2,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   401
                                    xsize, ysize, nchan,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   402
                                    (const mlib_s16 **) table);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   403
90ce3da70b43 Initial load
duke
parents:
diff changeset
   404
        return MLIB_SUCCESS;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   405
90ce3da70b43 Initial load
duke
parents:
diff changeset
   406
      } else if (stype == MLIB_SHORT) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   407
90ce3da70b43 Initial load
duke
parents:
diff changeset
   408
        mlib_c_ImageLookUpSI_S16_S16(sa, slb/2,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   409
                                     da, dlb/2,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   410
                                     xsize, ysize, nchan,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   411
                                     (const mlib_s16 **) table);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   412
        return MLIB_SUCCESS;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   413
90ce3da70b43 Initial load
duke
parents:
diff changeset
   414
      } else if (stype == MLIB_USHORT) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   415
90ce3da70b43 Initial load
duke
parents:
diff changeset
   416
        mlib_c_ImageLookUpSI_U16_S16(sa, slb/2,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   417
                                     da, dlb/2,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   418
                                     xsize, ysize, nchan,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   419
                                     (const mlib_s16 **) table);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   420
        return MLIB_SUCCESS;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   421
90ce3da70b43 Initial load
duke
parents:
diff changeset
   422
      } else if (stype == MLIB_INT) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   423
90ce3da70b43 Initial load
duke
parents:
diff changeset
   424
        mlib_c_ImageLookUpSI_S32_S16(sa, slb/4,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   425
                                     da, dlb/2,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   426
                                     xsize, ysize, nchan,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   427
                                     (const mlib_s16 **) table);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   428
        return MLIB_SUCCESS;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   429
      }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   430
90ce3da70b43 Initial load
duke
parents:
diff changeset
   431
    } else if (dtype == MLIB_USHORT) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   432
90ce3da70b43 Initial load
duke
parents:
diff changeset
   433
      if (stype == MLIB_BYTE) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   434
90ce3da70b43 Initial load
duke
parents:
diff changeset
   435
        mlib_c_ImageLookUpSI_U8_U16(sa, slb,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   436
                                    da, dlb/2,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   437
                                    xsize, ysize, nchan,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   438
                                    (const mlib_s16 **) table);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   439
90ce3da70b43 Initial load
duke
parents:
diff changeset
   440
        return MLIB_SUCCESS;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   441
90ce3da70b43 Initial load
duke
parents:
diff changeset
   442
      } else if (stype == MLIB_SHORT) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   443
90ce3da70b43 Initial load
duke
parents:
diff changeset
   444
        mlib_c_ImageLookUpSI_S16_U16(sa, slb/2,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   445
                                     da, dlb/2,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   446
                                     xsize, ysize, nchan,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   447
                                     (const mlib_u16 **) table);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   448
        return MLIB_SUCCESS;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   449
90ce3da70b43 Initial load
duke
parents:
diff changeset
   450
      } else if (stype == MLIB_USHORT) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   451
90ce3da70b43 Initial load
duke
parents:
diff changeset
   452
        mlib_c_ImageLookUpSI_U16_U16(sa, slb/2,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   453
                                     da, dlb/2,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   454
                                     xsize, ysize, nchan,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   455
                                     (const mlib_u16 **) table);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   456
        return MLIB_SUCCESS;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   457
90ce3da70b43 Initial load
duke
parents:
diff changeset
   458
      } else if (stype == MLIB_INT) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   459
90ce3da70b43 Initial load
duke
parents:
diff changeset
   460
        mlib_c_ImageLookUpSI_S32_U16(sa, slb/4,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   461
                                     da, dlb/2,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   462
                                     xsize, ysize, nchan,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   463
                                     (const mlib_u16 **) table);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   464
        return MLIB_SUCCESS;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   465
      }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   466
90ce3da70b43 Initial load
duke
parents:
diff changeset
   467
    } else if (dtype == MLIB_INT) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   468
90ce3da70b43 Initial load
duke
parents:
diff changeset
   469
      if (stype == MLIB_BYTE) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   470
90ce3da70b43 Initial load
duke
parents:
diff changeset
   471
        mlib_c_ImageLookUpSI_U8_S32(sa, slb,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   472
                                    da, dlb/4,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   473
                                    xsize, ysize, nchan,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   474
                                    (const mlib_s32 **) table);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   475
90ce3da70b43 Initial load
duke
parents:
diff changeset
   476
        return MLIB_SUCCESS;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   477
90ce3da70b43 Initial load
duke
parents:
diff changeset
   478
      } else if (stype == MLIB_SHORT) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   479
90ce3da70b43 Initial load
duke
parents:
diff changeset
   480
        mlib_c_ImageLookUpSI_S16_S32(sa, slb/2,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   481
                                     da, dlb/4,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   482
                                     xsize, ysize, nchan,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   483
                                     (const mlib_s32 **) table);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   484
        return MLIB_SUCCESS;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   485
90ce3da70b43 Initial load
duke
parents:
diff changeset
   486
      } else if (stype == MLIB_USHORT) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   487
90ce3da70b43 Initial load
duke
parents:
diff changeset
   488
        mlib_c_ImageLookUpSI_U16_S32(sa, slb/2,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   489
                                     da, dlb/4,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   490
                                     xsize, ysize, nchan,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   491
                                     (const mlib_s32 **) table);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   492
        return MLIB_SUCCESS;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   493
90ce3da70b43 Initial load
duke
parents:
diff changeset
   494
      } else if (stype == MLIB_INT) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   495
90ce3da70b43 Initial load
duke
parents:
diff changeset
   496
        mlib_c_ImageLookUpSI_S32_S32(sa, slb/4,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   497
                                     da, dlb/4,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   498
                                     xsize, ysize, nchan,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   499
                                     (const mlib_s32 **) table);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   500
        return MLIB_SUCCESS;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   501
      }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   502
90ce3da70b43 Initial load
duke
parents:
diff changeset
   503
    } else if (dtype == MLIB_FLOAT) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   504
90ce3da70b43 Initial load
duke
parents:
diff changeset
   505
      if (stype == MLIB_BYTE) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   506
90ce3da70b43 Initial load
duke
parents:
diff changeset
   507
        mlib_c_ImageLookUpSI_U8_S32(sa, slb,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   508
                                    da, dlb/4,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   509
                                    xsize, ysize, nchan,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   510
                                    (const mlib_s32 **) table);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   511
90ce3da70b43 Initial load
duke
parents:
diff changeset
   512
        return MLIB_SUCCESS;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   513
90ce3da70b43 Initial load
duke
parents:
diff changeset
   514
      } else if (stype == MLIB_SHORT) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   515
90ce3da70b43 Initial load
duke
parents:
diff changeset
   516
        mlib_c_ImageLookUpSI_S16_S32(sa, slb/2,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   517
                                     da, dlb/4,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   518
                                     xsize, ysize, nchan,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   519
                                     (const mlib_s32 **) table);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   520
        return MLIB_SUCCESS;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   521
90ce3da70b43 Initial load
duke
parents:
diff changeset
   522
      } else if (stype == MLIB_USHORT) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   523
90ce3da70b43 Initial load
duke
parents:
diff changeset
   524
        mlib_c_ImageLookUpSI_U16_S32(sa, slb/2,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   525
                                     da, dlb/4,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   526
                                     xsize, ysize, nchan,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   527
                                     (const mlib_s32 **) table);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   528
        return MLIB_SUCCESS;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   529
90ce3da70b43 Initial load
duke
parents:
diff changeset
   530
      } else if (stype == MLIB_INT) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   531
90ce3da70b43 Initial load
duke
parents:
diff changeset
   532
        mlib_c_ImageLookUpSI_S32_S32(sa, slb/4,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   533
                                     da, dlb/4,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   534
                                     xsize, ysize, nchan,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   535
                                     (const mlib_s32 **) table);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   536
        return MLIB_SUCCESS;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   537
      }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   538
90ce3da70b43 Initial load
duke
parents:
diff changeset
   539
    } else if (dtype == MLIB_DOUBLE) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   540
90ce3da70b43 Initial load
duke
parents:
diff changeset
   541
      if (stype == MLIB_BYTE) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   542
90ce3da70b43 Initial load
duke
parents:
diff changeset
   543
        mlib_ImageLookUpSI_U8_D64(sa, slb,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   544
                                  da, dlb/8,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   545
                                  xsize, ysize, nchan,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   546
                                  (const mlib_d64 **) table);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   547
90ce3da70b43 Initial load
duke
parents:
diff changeset
   548
        return MLIB_SUCCESS;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   549
90ce3da70b43 Initial load
duke
parents:
diff changeset
   550
      } else if (stype == MLIB_SHORT) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   551
90ce3da70b43 Initial load
duke
parents:
diff changeset
   552
        mlib_ImageLookUpSI_S16_D64(sa, slb/2,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   553
                                   da, dlb/8,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   554
                                   xsize, ysize, nchan,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   555
                                   (const mlib_d64 **) table);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   556
        return MLIB_SUCCESS;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   557
90ce3da70b43 Initial load
duke
parents:
diff changeset
   558
      } else if (stype == MLIB_USHORT) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   559
90ce3da70b43 Initial load
duke
parents:
diff changeset
   560
        mlib_ImageLookUpSI_U16_D64(sa, slb/2,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   561
                                   da, dlb/8,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   562
                                   xsize, ysize, nchan,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   563
                                   (const mlib_d64 **) table);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   564
        return MLIB_SUCCESS;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   565
90ce3da70b43 Initial load
duke
parents:
diff changeset
   566
      } else if (stype == MLIB_INT) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   567
90ce3da70b43 Initial load
duke
parents:
diff changeset
   568
        mlib_ImageLookUpSI_S32_D64(sa, slb/4,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   569
                                   da, dlb/8,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   570
                                   xsize, ysize, nchan,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   571
                                   (const mlib_d64 **) table);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   572
        return MLIB_SUCCESS;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   573
      }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   574
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   575
  }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   576
90ce3da70b43 Initial load
duke
parents:
diff changeset
   577
  return MLIB_FAILURE;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   578
}
90ce3da70b43 Initial load
duke
parents:
diff changeset
   579
90ce3da70b43 Initial load
duke
parents:
diff changeset
   580
/***************************************************************/