/*
* 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_ImageAffineEdgeZero - implementation of MLIB_EDGE_DST_FILL_ZERO
* edge condition
* mlib_ImageAffineEdgeNearest - implementation of MLIB_EDGE_OP_NEAREST
* edge condition
* void mlib_ImageAffineEdgeExtend_BL - implementation of MLIB_EDGE_SRC_EXTEND
* edge condition for MLIB_BILINEAR filter
* void mlib_ImageAffineEdgeExtend_BC - implementation of MLIB_EDGE_SRC_EXTEND
* edge condition for MLIB_BICUBIC filter
* void mlib_ImageAffineEdgeExtend_BC2 - implementation of MLIB_EDGE_SRC_EXTEND
* edge condition for MLIB_BICUBIC2 filter
*
* DESCRIPTION
* mlib_ImageAffineEdgeZero:
* This function fills the edge pixels (i.e. thouse one which can not
* be interpolated with given resampling filter because their prototypes
* in the source image lie too close to the border) in the destination
* image with zeroes.
*
* mlib_ImageAffineEdgeNearest:
* This function fills the edge pixels (i.e. thouse one which can not
* be interpolated with given resampling filter because their prototypes
* in the source image lie too close to the border) in the destination
* image according to the nearest neighbour interpolation.
*
* mlib_ImageAffineEdgeExtend_BL:
* This function fills the edge pixels (i.e. thouse one which can not
* be interpolated with given resampling filter because their prototypes
* in the source image lie too close to the border) in the destination
* image according to the bilinear interpolation with border pixels extend
* of source image.
*
* mlib_ImageAffineEdgeExtend_BC:
* This function fills the edge pixels (i.e. thouse one which can not
* be interpolated with given resampling filter because their prototypes
* in the source image lie too close to the border) in the destination
* image according to the bicubic interpolation with border pixels extend
* of source image.
*
* mlib_ImageAffineEdgeExtend_BC2:
* This function fills the edge pixels (i.e. thouse one which can not
* be interpolated with given resampling filter because their prototypes
* in the source image lie too close to the border) in the destination
* image according to the bicubic2 interpolation with border pixels extend
* of source image.
*/
#include "mlib_image.h"
#include "mlib_ImageColormap.h"
#include "mlib_ImageAffine.h"
/***************************************************************/
/***************************************************************/
/***************************************************************/
#ifdef MLIB_USE_FTOI_CLAMPING
#else
if (val0 >= MLIB_S32_MAX) \
val0 = MLIB_S32_MAX; \
if (val0 <= MLIB_S32_MIN) \
val0 = MLIB_S32_MIN; \
if (val0 >= MLIB_S32_MAX) \
val0 = MLIB_S32_MAX; \
if (val0 <= MLIB_S32_MIN) \
val0 = MLIB_S32_MIN; \
if (val0 >= MLIB_S32_MAX) \
val0 = MLIB_S32_MAX; \
if (val0 <= MLIB_S32_MIN) \
val0 = MLIB_S32_MIN; \
if (val0 >= MLIB_S32_MAX) \
val0 = MLIB_S32_MAX; \
if (val0 <= MLIB_S32_MIN) \
val0 = MLIB_S32_MIN; \
#endif
/***************************************************************/
/***************************************************************/
/***************************************************************/
\
}
/***************************************************************/
\
for (j = 0; j < size; j++) { \
ySrc = Y >> MLIB_SHIFT; \
xSrc = X >> MLIB_SHIFT; \
\
\
Y += dY; \
X += dX; \
}
/***************************************************************/
\
for (j = 0; j < size; j++) { \
\
\
\
\
\
\
for (k = 0; k < channels; k++) { \
\
sp++; \
} \
\
X += dX; \
Y += dY; \
}
/***************************************************************/
/***************************************************************/
for (j = 0; j < size; j++) { \
\
\
\
\
\
\
for (k = 0; k < channels; k++) { \
\
} \
\
X += dX; \
Y += dY; \
}
/***************************************************************/
\
\
\
\
if (channels == 3) { \
if (sizeof(ITYPE) == 1) { \
} else { \
} \
} else { \
if (sizeof(ITYPE) == 1) { \
} else { \
} \
} \
}
/***************************************************************/
\
\
\
\
if (channels == 3) { \
if (sizeof(ITYPE) == 1) { \
} else { \
} \
} else { \
if (sizeof(ITYPE) == 1) { \
} else { \
} \
} \
}
/***************************************************************/
\
/***************************************************************/
\
/***************************************************************/
\
/***************************************************************/
\
\
\
/***************************************************************/
\
for (j = 0; j < size; j++) { \
\
\
\
for (k = 0; k < channels; k++) { \
\
\
\
\
\
\
sp++; \
} \
\
X += dX; \
Y += dY; \
}
/***************************************************************/
/***************************************************************/
/***************************************************************/
/***************************************************************/
for (j = 0; j < size; j++) { \
\
\
\
for (k = 0; k < channels; k++) { \
\
\
\
\
\
} \
\
X += dX; \
Y += dY; \
}
/***************************************************************/
\
xLeftE = leftEdgesE[i]; \
\
} \
\
for (; i <= yFinish; i++) { \
xLeftE = leftEdgesE[i]; \
\
} else { \
} \
\
} \
\
for (; i <= yFinishE; i++) { \
xLeftE = leftEdgesE[i]; \
\
} \
}
/***************************************************************/
\
xLeftE = leftEdgesE[i]; \
X = xStartsE[i]; \
Y = yStartsE[i]; \
\
} \
\
for (; i <= yFinish; i++) { \
xLeftE = leftEdgesE[i]; \
X = xStartsE[i]; \
Y = yStartsE[i]; \
\
} else { \
} \
\
} \
\
for (; i <= yFinishE; i++) { \
xLeftE = leftEdgesE[i]; \
X = xStartsE[i]; \
Y = yStartsE[i]; \
\
} \
}
/***************************************************************/
#define GET_EDGE_PARAMS_ZERO() \
mlib_s32 i
/***************************************************************/
#define GET_EDGE_PARAMS_NN() \
GET_EDGE_PARAMS_ZERO(); \
mlib_s32 j
/***************************************************************/
#define GET_EDGE_PARAMS() \
GET_EDGE_PARAMS_NN(); \
/***************************************************************/
const void *colormap)
{
}
switch (type) {
case MLIB_BYTE:
break;
case MLIB_SHORT:
case MLIB_USHORT:
break;
case MLIB_INT:
case MLIB_FLOAT:
break;
case MLIB_DOUBLE:{
break;
}
default:
/* Image type MLIB_BIT is not used in java, so we can ignore it. */
break;
}
}
/***************************************************************/
{
switch (type) {
case MLIB_BYTE:
break;
case MLIB_SHORT:
case MLIB_USHORT:
break;
case MLIB_INT:
case MLIB_FLOAT:
break;
case MLIB_DOUBLE:
break;
default:
/* Image type MLIB_BIT is not used in java, so we can ignore it. */
break;
}
}
/***************************************************************/
const void *colormap)
{
void *buff;
if (max_xsize == 0) {
return MLIB_SUCCESS;
}
}
else if (ltype == MLIB_SHORT) {
} else {
/* Unsupported type of lookup table. Report a failure */
return MLIB_FAILURE;
}
return MLIB_FAILURE;
switch (ltype) {
case MLIB_BYTE:
switch (type) {
case MLIB_BYTE:
break;
case MLIB_SHORT:
srcStride >>= 1;
break;
default:
/* Incompatible image type. Ignore it for now. */
break;
}
break;
case MLIB_SHORT:
switch (type) {
case MLIB_BYTE:
break;
case MLIB_SHORT:
srcStride >>= 1;
break;
default:
/* Incompatible image type. Ignore it for now. */
break;
}
break;
default:
/* Unsupported type of lookup table.
* Can not be here due to check on line 685,
* so just ignore it.
*/
break;
}
return MLIB_SUCCESS;
}
switch (type) {
case MLIB_BYTE:
break;
case MLIB_SHORT:
srcStride >>= 1;
break;
case MLIB_USHORT:
srcStride >>= 1;
break;
case MLIB_INT:
srcStride >>= 2;
break;
case MLIB_FLOAT:
srcStride >>= 2;
break;
case MLIB_DOUBLE:
srcStride >>= 3;
break;
default:
/* Image type MLIB_BIT is not supported, ignore it. */
break;
}
return MLIB_SUCCESS;
}
/***************************************************************/
const void *colormap)
{
}
else {
}
void *buff;
if (max_xsize == 0) {
return MLIB_SUCCESS;
}
}
else if (ltype == MLIB_SHORT) {
} else {
/* Unsupported type of lookup table. */
return MLIB_FAILURE;
}
return MLIB_FAILURE;
switch (ltype) {
case MLIB_BYTE:
switch (type) {
case MLIB_BYTE:
break;
case MLIB_SHORT:
srcStride >>= 1;
break;
default:
/* Ignore incomatible image type. */
break;
}
break;
case MLIB_SHORT:
switch (type) {
case MLIB_BYTE:
break;
case MLIB_SHORT:
srcStride >>= 1;
break;
default:
/* Ignore incomatible image type. */
break;
}
break;
default:
/* Unsupported type of lookup table.
* Can not be here due to check on line 836,
* so just ignore it.
*/
break;
}
return MLIB_SUCCESS;
}
switch (type) {
case MLIB_BYTE:
break;
case MLIB_SHORT:
srcStride >>= 1;
break;
case MLIB_USHORT:
srcStride >>= 1;
break;
case MLIB_INT:
srcStride >>= 2;
if (filter == MLIB_BICUBIC) {
}
else {
}
break;
case MLIB_FLOAT:
srcStride >>= 2;
if (filter == MLIB_BICUBIC) {
}
else {
}
break;
case MLIB_DOUBLE:
srcStride >>= 3;
if (filter == MLIB_BICUBIC) {
}
else {
}
break;
default:
/* Ignore unsupported image type MLIB_BIT */
break;
}
return MLIB_SUCCESS;
}
/***************************************************************/