/*
* 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
* Internal functions for mlib_ImageConv* on U8 type
* and MLIB_EDGE_DST_NO_WRITE mask
*
*/
/***************************************************************/
#include <vis_proto.h>
#include <mlib_image.h>
#include <mlib_ImageCheck.h>
#include <mlib_ImageColormap.h>
/*
This defines switches between functions in
files: mlib_v_ImageConv_8nw.c,
*/
#define CONV_INDEX
/***************************************************************/
#ifdef CONV_INDEX
mlib_image *src, \
void *colormap)
#else
mlib_image *src, \
#endif
/***************************************************************/
#ifdef CONV_INDEX
#else
#endif
/***************************************************************/
#define DEF_VARS \
mlib_s32 i, j, l
/***************************************************************/
#ifdef CONV_INDEX
#define DEF_EXTRA_VARS \
#else
#define DEF_EXTRA_VARS \
#endif
/***************************************************************/
#if NCHAN == 3
#define LOAD_SRC() { \
\
\
\
sp += 8; \
}
#else
#define LOAD_SRC() { \
\
\
\
sp += 6; \
}
#endif
/***************************************************************/
0x00040004, 0x00020002, 0x00010001, 0x00000000,
0x00000000, 0x00000000, 0x00000000, 0x00000000,
0x00000000, 0x00000000, 0x00000000, 0x00000000 };
/***************************************************************/
/***************************************************************/
{
for (l = 0; l < KSIZE; l++) {
#ifndef CONV_INDEX
#else
#pragma pipeloop(0)
for (i = 0; i < dsize; i += 3) {
LOAD_SRC();
}
#endif /* CONV_INDEX */
}
for (j = 0; j < hgt; j++) {
#ifndef CONV_INDEX
#endif
#pragma pipeloop(0)
}
#ifndef CONV_INDEX
#pragma pipeloop(0)
for (i = 0; i < xsize/8; i++) {
}
if (emask) {
}
#else
#pragma pipeloop(0)
for (i = 0; i < dsize; i += 3) {
LOAD_SRC();
}
#endif /* CONV_INDEX */
buff_ind++;
}
return MLIB_SUCCESS;
}
/***************************************************************/
{
#ifdef CONV_INDEX
#else
#endif
for (l = 0; l < KSIZE; l++) {
#ifndef CONV_INDEX
#else
#pragma pipeloop(0)
for (i = 0; i < dsize; i += 3) {
LOAD_SRC();
}
#endif /* CONV_INDEX */
}
/* init buffer */
#pragma pipeloop(0)
}
for (j = 0; j < hgt; j++) {
#ifndef CONV_INDEX
#endif
#ifdef CONV_INDEX
ik_last = 0;
#else
#endif
off &= 7;
/*if (!ik_last) {
if ((off & 3) || (ik == (KSIZE - 1))) {
ik_last = ik;
continue;
}
}*/
if (off == 0) {
#pragma pipeloop(0)
}
} else if (off == 4) {
#pragma pipeloop(0)
}
} else {
#pragma pipeloop(0)
}
}
}
off &= 7;
#ifndef CONV_INDEX
#pragma pipeloop(0)
for (i = 0; i < xsize/8; i++) {
}
if (emask) {
}
#else
#pragma pipeloop(0)
for (i = 0; i < dsize; i += 3) {
LOAD_SRC();
}
#endif /* CONV_INDEX */
buff_ind++;
}
return MLIB_SUCCESS;
}
/***************************************************************/
#ifdef CONV_INDEX
mlib_s32 m,
mlib_s32 n,
void *colormap)
#else
mlib_s32 m,
mlib_s32 n,
#endif
{
if (n > MAX_N) {
}
#ifdef CONV_INDEX
#else
#endif
return MLIB_FAILURE;
}
wid -= (m - 1);
hgt -= (n - 1);
for (l = 0; l < n; l++) {
#ifndef CONV_INDEX
#else
#pragma pipeloop(0)
for (i = 0; i < dsize; i += 3) {
LOAD_SRC();
}
#endif /* CONV_INDEX */
}
/* init buffer */
#pragma pipeloop(0)
}
for (j = 0; j < hgt; j++) {
for (l = 0; l < n; l++) {
}
#ifndef CONV_INDEX
for (l = 0; l < n; l++) {
}
#endif
#ifdef CONV_INDEX
ik_last = 0;
#else
ik_last = (m - 1);
#endif
#ifdef CONV_INDEX
#else
#endif
coff = 0;
if (jk_size == 2) {
#pragma pipeloop(0)
}
}
pk += 2*m;
} else if (jk_size == 3) {
if (off == 0) {
#pragma pipeloop(0)
}
} else if (off == 4) {
#pragma pipeloop(0)
}
} else {
#pragma pipeloop(0)
}
}
}
pk += 3*m;
} else { /* jk_size == 4 */
if (off == 0) {
#pragma pipeloop(0)
}
} else if (off == 4) {
#pragma pipeloop(0)
}
} else {
#pragma pipeloop(0)
}
}
}
pk += 4*m;
}
}
/*****************************************
*****************************************
** Final iteration **
*****************************************
*****************************************/
jk_size = n;
#ifdef CONV_INDEX
#else
#endif
off &= 7;
#ifndef CONV_INDEX
if (jk_size == 2) {
#pragma pipeloop(0)
for (i = 0; i < xsize/8; i++) {
}
if (emask) {
}
} else if (jk_size == 3) {
#pragma pipeloop(0)
for (i = 0; i < xsize/8; i++) {
}
if (emask) {
}
} else /* if (jk_size == 4) */ {
#pragma pipeloop(0)
for (i = 0; i < xsize/8; i++) {
}
if (emask) {
}
}
#else /* CONV_INDEX */
if (jk_size == 2) {
#pragma pipeloop(0)
for (i = 0; i < dsize; i += 3) {
LOAD_SRC();
}
} else /* if (jk_size == 3) */ {
#pragma pipeloop(0)
for (i = 0; i < dsize; i += 3) {
LOAD_SRC();
}
}
#endif /* CONV_INDEX */
#ifdef CONV_INDEX
#endif /* CONV_INDEX */
buff_ind++;
}
return MLIB_SUCCESS;
}
/***************************************************************/