/*
* 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.
*/
#include "vis_proto.h"
#include "mlib_image.h"
#include "mlib_ImageColormap.h"
#include "mlib_ImageAffine.h"
#include "mlib_v_ImageFilters.h"
/***************************************************************/
/***************************************************************/
#define DECLAREVAR() \
DECLAREVAR0(); \
MLIB_TYPE *srcIndexPtr; \
MLIB_TYPE *dstIndexPtr; \
mlib_d64 *dstPixelPtr; \
mlib_s32 i
/***************************************************************/
#define DECLAREVAR_U8() \
/***************************************************************/
#define DECLAREVAR_S16() \
/***************************************************************/
#define CLIP() \
dstData += dstYStride; \
xRight = rightEdges[j]; \
X = xStarts[j]; \
Y = yStarts[j]; \
continue; \
/***************************************************************/
#define FADD_4BC_U8() \
/***************************************************************/
X += dX; \
Y += dY; \
srcIndexPtr += srcYStride; \
srcIndexPtr += srcYStride; \
srcIndexPtr += srcYStride; \
/***************************************************************/
#define NEXT_PIXEL_4BC() \
/***************************************************************/
/***************************************************************/
filterposy = (Y >> FILTER_SHIFT); \
filterposx = (X >> FILTER_SHIFT); \
srcIndexPtr += srcYStride; \
X += dX; \
srcIndexPtr += srcYStride; \
Y += dY; \
filterposy &= FILTER_MASK; \
srcIndexPtr += srcYStride; \
filterposx &= FILTER_MASK; \
/***************************************************************/
srcIndexPtr += srcYStride; \
srcIndexPtr += srcYStride; \
srcIndexPtr += srcYStride; \
X += dX; \
Y += dY
/***************************************************************/
#define RESULT_4BC_S16_1PIXEL() \
/***************************************************************/
filterposy = (Y >> FILTER_SHIFT); \
filterposx = (X >> FILTER_SHIFT); \
srcIndexPtr += srcYStride; \
X += dX; \
srcIndexPtr += srcYStride; \
Y += dY; \
filterposy &= FILTER_MASK; \
srcIndexPtr += srcYStride; \
filterposx &= FILTER_MASK; \
/***************************************************************/
#define FADD_4BC_S16() \
/***************************************************************/
/***************************************************************/
/***************************************************************/
const void *colormap)
{
DECLAREVAR();
if (filter == MLIB_BICUBIC) {
} else {
}
if (max_xsize > MLIB_LIMIT) {
}
CLIP();
i = 0;
if (i <= cols - 6) {
FADD_4BC_U8();
#pragma pipeloop(0)
*dstPixelPtr++ = res;
FADD_4BC_U8();
}
*dstPixelPtr++ = res;
FADD_4BC_U8();
*dstPixelPtr++ = res;
FADD_4BC_U8();
*dstPixelPtr++ = res;
i += 6;
}
if (i <= cols-4) {
FADD_4BC_U8();
*dstPixelPtr++ = res;
FADD_4BC_U8();
*dstPixelPtr++ = res;
i += 4;
}
if (i <= cols-2) {
FADD_4BC_U8();
*dstPixelPtr++ = res;
i += 2;
}
if (i < cols) {
*dstPixelPtr++ = res;
}
colormap);
}
return MLIB_SUCCESS;
}
/***************************************************************/
/***************************************************************/
const void *colormap)
{
DECLAREVAR();
if (filter == MLIB_BICUBIC) {
} else {
}
if (max_xsize > MLIB_LIMIT) {
}
CLIP();
i = 0;
if (i <= cols - 4) {
FADD_4BC_S16();
#pragma pipeloop(0)
for (; i < cols-4; i++) {
*dstPixelPtr++ = res;
FADD_4BC_S16();
}
*dstPixelPtr++ = res;
FADD_4BC_S16();
*dstPixelPtr++ = res;
*dstPixelPtr++ = res;
*dstPixelPtr++ = res;
i += 4;
}
#pragma pipeloop(0)
for (; i < cols; i++) {
*dstPixelPtr++ = res;
}
colormap);
}
return MLIB_SUCCESS;
}
/***************************************************************/
/***************************************************************/
const void *colormap)
{
DECLAREVAR();
if (filter == MLIB_BICUBIC) {
} else {
}
if (max_xsize > MLIB_LIMIT) {
}
CLIP();
i = 0;
if (i <= cols - 6) {
FADD_4BC_U8();
#pragma pipeloop(0)
*dstPixelPtr++ = res;
FADD_4BC_U8();
}
*dstPixelPtr++ = res;
FADD_4BC_U8();
*dstPixelPtr++ = res;
FADD_4BC_U8();
*dstPixelPtr++ = res;
i += 6;
}
if (i <= cols-4) {
FADD_4BC_U8();
*dstPixelPtr++ = res;
FADD_4BC_U8();
*dstPixelPtr++ = res;
i += 4;
}
if (i <= cols-2) {
FADD_4BC_U8();
*dstPixelPtr++ = res;
i += 2;
}
if (i < cols) {
*dstPixelPtr++ = res;
}
colormap);
}
return MLIB_SUCCESS;
}
/***************************************************************/
/***************************************************************/
const void *colormap)
{
DECLAREVAR();
if (filter == MLIB_BICUBIC) {
} else {
}
if (max_xsize > MLIB_LIMIT) {
}
CLIP();
i = 0;
if (i <= cols - 4) {
FADD_4BC_S16();
#pragma pipeloop(0)
for (; i < cols-4; i++) {
*dstPixelPtr++ = res;
FADD_4BC_S16();
}
*dstPixelPtr++ = res;
FADD_4BC_S16();
*dstPixelPtr++ = res;
*dstPixelPtr++ = res;
*dstPixelPtr++ = res;
i += 4;
}
#pragma pipeloop(0)
for (; i < cols; i++) {
*dstPixelPtr++ = res;
}
colormap);
}
return MLIB_SUCCESS;
}
/***************************************************************/
/***************************************************************/
/***************************************************************/
const void *colormap)
{
DECLAREVAR();
if (filter == MLIB_BICUBIC) {
} else {
}
srcYStride >>= 1;
if (max_xsize > MLIB_LIMIT) {
}
CLIP();
i = 0;
if (i <= cols - 6) {
FADD_4BC_U8();
#pragma pipeloop(0)
*dstPixelPtr++ = res;
FADD_4BC_U8();
}
*dstPixelPtr++ = res;
FADD_4BC_U8();
*dstPixelPtr++ = res;
FADD_4BC_U8();
*dstPixelPtr++ = res;
i += 6;
}
if (i <= cols-4) {
FADD_4BC_U8();
*dstPixelPtr++ = res;
FADD_4BC_U8();
*dstPixelPtr++ = res;
i += 4;
}
if (i <= cols-2) {
FADD_4BC_U8();
*dstPixelPtr++ = res;
i += 2;
}
if (i < cols) {
*dstPixelPtr++ = res;
}
colormap);
}
return MLIB_SUCCESS;
}
/***************************************************************/
/***************************************************************/
const void *colormap)
{
DECLAREVAR();
if (filter == MLIB_BICUBIC) {
} else {
}
srcYStride >>= 1;
if (max_xsize > MLIB_LIMIT) {
}
CLIP();
i = 0;
if (i <= cols - 4) {
FADD_4BC_S16();
#pragma pipeloop(0)
for (; i < cols-4; i++) {
*dstPixelPtr++ = res;
FADD_4BC_S16();
}
*dstPixelPtr++ = res;
FADD_4BC_S16();
*dstPixelPtr++ = res;
*dstPixelPtr++ = res;
*dstPixelPtr++ = res;
i += 4;
}
#pragma pipeloop(0)
for (; i < cols; i++) {
*dstPixelPtr++ = res;
}
colormap);
}
return MLIB_SUCCESS;
}
/***************************************************************/
/***************************************************************/
const void *colormap)
{
DECLAREVAR();
if (filter == MLIB_BICUBIC) {
} else {
}
srcYStride >>= 1;
if (max_xsize > MLIB_LIMIT) {
}
CLIP();
i = 0;
if (i <= cols - 6) {
FADD_4BC_U8();
#pragma pipeloop(0)
*dstPixelPtr++ = res;
FADD_4BC_U8();
}
*dstPixelPtr++ = res;
FADD_4BC_U8();
*dstPixelPtr++ = res;
FADD_4BC_U8();
*dstPixelPtr++ = res;
i += 6;
}
if (i <= cols-4) {
FADD_4BC_U8();
*dstPixelPtr++ = res;
FADD_4BC_U8();
*dstPixelPtr++ = res;
i += 4;
}
if (i <= cols-2) {
FADD_4BC_U8();
*dstPixelPtr++ = res;
i += 2;
}
if (i < cols) {
*dstPixelPtr++ = res;
}
colormap);
}
return MLIB_SUCCESS;
}
/***************************************************************/
/***************************************************************/
const void *colormap)
{
DECLAREVAR();
if (filter == MLIB_BICUBIC) {
} else {
}
srcYStride >>= 1;
if (max_xsize > MLIB_LIMIT) {
}
CLIP();
i = 0;
if (i <= cols - 4) {
FADD_4BC_S16();
#pragma pipeloop(0)
for (; i < cols-4; i++) {
*dstPixelPtr++ = res;
FADD_4BC_S16();
}
*dstPixelPtr++ = res;
FADD_4BC_S16();
*dstPixelPtr++ = res;
*dstPixelPtr++ = res;
*dstPixelPtr++ = res;
i += 4;
}
#pragma pipeloop(0)
for (; i < cols; i++) {
*dstPixelPtr++ = res;
}
colormap);
}
return MLIB_SUCCESS;
}
/***************************************************************/