/*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
* particular file as subject to the "Classpath" exception as provided
* by Oracle in the LICENSE file that accompanied this code.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
/*
* FUNCTION
* mlib_ImageLookUp - table lookup
*
* SYNOPSIS
* mlib_status mlib_ImageLookUp(mlib_image *dst,
* const mlib_image *src,
* const void **table)
*
* ARGUMENT
* dst Pointer to destination image.
* src Pointer to source image.
* table Lookup table.
*
* DESCRIPTION
* The mlib_ImageLookUp function performs general table lookup on an
* image. The destination image is obtained by passing a source image
* through a lookup table.
*
* The source image may be 1-, 2-, 3-, or 4-channeled of data types
* MLIB_BIT, MLIB_BYTE, MLIB_SHORT, MLIB_USHORT, or MLIB_INT. The lookup
* table may be 1-, 2-, 3-, or 4-channeled of data types MLIB_BYTE,
* MLIB_SHORT, MLIB_USHORT, MLIB_INT, MLIB_FLOAT, or MLIB_DOUBLE.
* The destination image must have the same
* number of channels as either source image or the lookup table,
* whichever is greater, and the same data type as the lookup table.
*
* It is the user's responsibility to make sure that the lookup table
* supplied is suitable for the source image. Specifically, the table
* entries cover the entire range of source data. Otherwise, the result
* of this function is undefined.
*
* The pixel values of the destination image are defined as the following:
*
* If the source image is single-channeled and the destination image is
* multi-channeled, then the lookup table has the same number of channels
* as the destination image:
*
* dst[x][y][c] = table[c][src[x][y][0]]
*
* If the source image is multi-channeled and the destination image is
* multi-channeled, with the same number of channels as the source image,
* then the lookup table will have the same number of channels as
* the source image:
*
* dst[x][y][c] = table[c][src[x][y][c]]
*/
#include "mlib_image.h"
#include "mlib_ImageCheck.h"
#include "mlib_ImageLookUp.h"
#include "mlib_c_ImageLookUp.h"
/***************************************************************/
const mlib_image *src,
const void **table)
{
return MLIB_SUCCESS;
} else if (stype == MLIB_SHORT) {
return MLIB_SUCCESS;
} else if (stype == MLIB_USHORT) {
return MLIB_SUCCESS;
return MLIB_SUCCESS;
}
} else if (dtype == MLIB_SHORT) {
return MLIB_SUCCESS;
} else if (stype == MLIB_SHORT) {
return MLIB_SUCCESS;
} else if (stype == MLIB_USHORT) {
return MLIB_SUCCESS;
return MLIB_SUCCESS;
}
} else if (dtype == MLIB_USHORT) {
return MLIB_SUCCESS;
} else if (stype == MLIB_SHORT) {
return MLIB_SUCCESS;
} else if (stype == MLIB_USHORT) {
return MLIB_SUCCESS;
return MLIB_SUCCESS;
}
return MLIB_SUCCESS;
} else if (stype == MLIB_SHORT) {
return MLIB_SUCCESS;
} else if (stype == MLIB_USHORT) {
return MLIB_SUCCESS;
return MLIB_SUCCESS;
}
} else if (dtype == MLIB_FLOAT) {
return MLIB_SUCCESS;
} else if (stype == MLIB_SHORT) {
return MLIB_SUCCESS;
} else if (stype == MLIB_USHORT) {
return MLIB_SUCCESS;
return MLIB_SUCCESS;
}
} else if (dtype == MLIB_DOUBLE) {
return MLIB_SUCCESS;
} else if (stype == MLIB_SHORT) {
return MLIB_SUCCESS;
} else if (stype == MLIB_USHORT) {
return MLIB_SUCCESS;
return MLIB_SUCCESS;
}
}
} else if (ichan == 1) {
return MLIB_SUCCESS;
} else if (stype == MLIB_SHORT) {
return MLIB_SUCCESS;
} else if (stype == MLIB_USHORT) {
return MLIB_SUCCESS;
return MLIB_SUCCESS;
if (nchan == 2) {
} else if (nchan == 3) {
} else /* (nchan == 4) */ {
}
}
} else if (dtype == MLIB_SHORT) {
return MLIB_SUCCESS;
} else if (stype == MLIB_SHORT) {
return MLIB_SUCCESS;
} else if (stype == MLIB_USHORT) {
return MLIB_SUCCESS;
return MLIB_SUCCESS;
}
} else if (dtype == MLIB_USHORT) {
return MLIB_SUCCESS;
} else if (stype == MLIB_SHORT) {
return MLIB_SUCCESS;
} else if (stype == MLIB_USHORT) {
return MLIB_SUCCESS;
return MLIB_SUCCESS;
}
return MLIB_SUCCESS;
} else if (stype == MLIB_SHORT) {
return MLIB_SUCCESS;
} else if (stype == MLIB_USHORT) {
return MLIB_SUCCESS;
return MLIB_SUCCESS;
}
} else if (dtype == MLIB_FLOAT) {
return MLIB_SUCCESS;
} else if (stype == MLIB_SHORT) {
return MLIB_SUCCESS;
} else if (stype == MLIB_USHORT) {
return MLIB_SUCCESS;
return MLIB_SUCCESS;
}
} else if (dtype == MLIB_DOUBLE) {
return MLIB_SUCCESS;
} else if (stype == MLIB_SHORT) {
return MLIB_SUCCESS;
} else if (stype == MLIB_USHORT) {
return MLIB_SUCCESS;
return MLIB_SUCCESS;
}
}
}
return MLIB_FAILURE;
}
/***************************************************************/