/*
* 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 S32 type and
* MLIB_EDGE_DST_NO_WRITE mask
*
*/
#include "mlib_image.h"
#include "mlib_ImageConv.h"
/***************************************************************/
/***************************************************************/
/***************************************************************/
#ifndef MLIB_USE_FTOI_CLAMPING
#else
#endif /* MLIB_USE_FTOI_CLAMPING */
/***************************************************************/
/* mlib_s32 chan2 = chan1 + chan1 */
/***************************************************************/
mlib_s32 i, j, c; \
/***************************************************************/
mlib_s32 i, j, c
/***************************************************************/
#define CALC_SCALE() \
scalef = 1.0; \
while (scalef_expon > 30) { \
scalef_expon -= 30; \
} \
\
/***************************************************************/
{
}
/* keep kernel in regs */
CALC_SCALE();
for (c = 0; c < chan1; c++) {
#ifdef __SUNPRO_C
#pragma pipeloop(0)
#endif /* __SUNPRO_C */
}
for (j = 0; j < hgt; j++) {
#ifdef __SUNPRO_C
#pragma pipeloop(0)
#endif /* __SUNPRO_C */
}
for (; i < wid; i++) {
}
}
}
return MLIB_SUCCESS;
}
/***************************************************************/
{
}
CALC_SCALE();
for (c = 0; c < chan1; c++) {
#ifdef __SUNPRO_C
#pragma pipeloop(0)
#endif /* __SUNPRO_C */
}
for (j = 0; j < hgt; j++) {
#ifdef __SUNPRO_C
#pragma pipeloop(0)
#endif /* __SUNPRO_C */
}
for (; i < wid; i++) {
}
}
}
return MLIB_SUCCESS;
}
/***************************************************************/
{
}
CALC_SCALE();
for (c = 0; c < chan1; c++) {
#ifdef __SUNPRO_C
#pragma pipeloop(0)
#endif /* __SUNPRO_C */
}
for (j = 0; j < hgt; j++) {
/*
* First loop on two first lines of kernel
*/
#ifdef __SUNPRO_C
#pragma pipeloop(0)
#endif /* __SUNPRO_C */
}
/*
* Second loop on two last lines of kernel
*/
#ifdef __SUNPRO_C
#pragma pipeloop(0)
#endif /* __SUNPRO_C */
}
/* last pixels */
for (; i < wid; i++) {
}
/* next line */
}
}
return MLIB_SUCCESS;
}
/***************************************************************/
{
}
CALC_SCALE();
for (c = 0; c < chan1; c++) {
#ifdef __SUNPRO_C
#pragma pipeloop(0)
#endif /* __SUNPRO_C */
}
for (j = 0; j < hgt; j++) {
/*
* First loop
*/
#ifdef __SUNPRO_C
#pragma pipeloop(0)
#endif /* __SUNPRO_C */
}
/*
* Second loop
*/
#ifdef __SUNPRO_C
#pragma pipeloop(0)
#endif /* __SUNPRO_C */
}
/*
* 3 loop
*/
#ifdef __SUNPRO_C
#pragma pipeloop(0)
#endif /* __SUNPRO_C */
}
/* last pixels */
for (; i < wid; i++) {
}
/* next line */
}
}
return MLIB_SUCCESS;
}
/***************************************************************/
{
}
CALC_SCALE();
for (c = 0; c < chan1; c++) {
#ifdef __SUNPRO_C
#pragma pipeloop(0)
#endif /* __SUNPRO_C */
}
buff_ind = 0;
#ifdef __SUNPRO_C
#pragma pipeloop(0)
#endif /* __SUNPRO_C */
for (j = 0; j < hgt; j++) {
for (l = 0; l < KSIZE; l++) {
if (l < (KSIZE - 1)) {
#ifdef __SUNPRO_C
#pragma pipeloop(0)
#endif /* __SUNPRO_C */
}
} else {
#ifdef __SUNPRO_C
#pragma pipeloop(0)
#endif /* __SUNPRO_C */
buffd[i ] = 0.0;
}
}
}
/* last pixels */
for (; i < wid; i++) {
for (l = 0; l < KSIZE; l++) {
}
}
/* next line */
buff_ind++;
}
}
return MLIB_SUCCESS;
}
/***************************************************************/
const mlib_image *src,
const mlib_d64 *k,
mlib_s32 n,
{
hgt -= (n - 1);
}
for (c = 0; c < chan1; c++) {
#ifdef __SUNPRO_C
#pragma pipeloop(0)
#endif /* __SUNPRO_C */
for (i = 0; i < wid; i++) {
#ifdef __SUNPRO_C
#pragma pipeloop(0)
#endif /* __SUNPRO_C */
for (j = 0; j < hsize; j += 2) {
}
}
if (kh == 4) {
#ifdef __SUNPRO_C
#pragma pipeloop(0)
#endif /* __SUNPRO_C */
pbuff[j] = 0;
pbuff[j + 1] = 0;
}
if (j < hsize) {
pbuff[j] = 0;
}
} else if (kh == 3) {
#ifdef __SUNPRO_C
#pragma pipeloop(0)
#endif /* __SUNPRO_C */
pbuff[j] = 0;
pbuff[j + 1] = 0;
}
if (j < hsize) {
pbuff[j] = 0;
}
} else if (kh == 2) {
#ifdef __SUNPRO_C
#pragma pipeloop(0)
#endif /* __SUNPRO_C */
pbuff[j] = 0;
pbuff[j + 1] = 0;
}
if (j < hsize) {
pbuff[j] = 0;
}
} else /* if (kh == 1) */ {
#ifdef __SUNPRO_C
#pragma pipeloop(0)
#endif /* __SUNPRO_C */
for (j = 0; j < hsize; j++) {
pbuff[j] = 0;
}
}
}
}
}
return MLIB_SUCCESS;
}
/***************************************************************/
const mlib_image *src,
mlib_s32 m,
mlib_s32 n,
{
if (scale > 30) {
scale -= 30;
}
mn = m*n;
if (mn > 256) {
if (k == NULL) return MLIB_FAILURE;
}
for (i = 0; i < mn; i++) {
}
}
wid -= (m - 1);
hgt -= (n - 1);
for (c = 0; c < chan1; c++) {
for (l = 0; l < n; l++) {
#ifdef __SUNPRO_C
#pragma pipeloop(0)
#endif /* __SUNPRO_C */
for (i = 0; i < wid + (m - 1); i++) {
}
}
buff_ind = 0;
#ifdef __SUNPRO_C
#pragma pipeloop(0)
#endif /* __SUNPRO_C */
for (j = 0; j < hgt; j++) {
for (l = 0; l < n; l++) {
if (kw == 7) {
if (l < (n - 1) || off < m) {
#ifdef __SUNPRO_C
#pragma pipeloop(0)
#endif /* __SUNPRO_C */
}
} else {
#ifdef __SUNPRO_C
#pragma pipeloop(0)
#endif /* __SUNPRO_C */
buffd[i ] = 0.0;
}
}
} else if (kw == 6) {
if (l < (n - 1) || off < m) {
#ifdef __SUNPRO_C
#pragma pipeloop(0)
#endif /* __SUNPRO_C */
}
} else {
#ifdef __SUNPRO_C
#pragma pipeloop(0)
#endif /* __SUNPRO_C */
buffd[i ] = 0.0;
}
}
} else if (kw == 5) {
if (l < (n - 1) || off < m) {
#ifdef __SUNPRO_C
#pragma pipeloop(0)
#endif /* __SUNPRO_C */
}
} else {
#ifdef __SUNPRO_C
#pragma pipeloop(0)
#endif /* __SUNPRO_C */
buffd[i ] = 0.0;
}
}
} else if (kw == 4) {
if (l < (n - 1) || off < m) {
#ifdef __SUNPRO_C
#pragma pipeloop(0)
#endif /* __SUNPRO_C */
}
} else {
#ifdef __SUNPRO_C
#pragma pipeloop(0)
#endif /* __SUNPRO_C */
buffd[i ] = 0.0;
}
}
} else if (kw == 3) {
if (l < (n - 1) || off < m) {
#ifdef __SUNPRO_C
#pragma pipeloop(0)
#endif /* __SUNPRO_C */
}
} else {
#ifdef __SUNPRO_C
#pragma pipeloop(0)
#endif /* __SUNPRO_C */
buffd[i ] = 0.0;
}
}
} else { /* kw == 2 */
if (l < (n - 1) || off < m) {
#ifdef __SUNPRO_C
#pragma pipeloop(0)
#endif /* __SUNPRO_C */
}
} else {
#ifdef __SUNPRO_C
#pragma pipeloop(0)
#endif /* __SUNPRO_C */
buffd[i ] = 0.0;
}
}
}
}
}
/* last pixels */
for (; i < wid; i++) {
mlib_s32 x;
for (l = 0; l < n; l++) {
}
}
/* next line */
buff_ind++;
}
}
return MLIB_SUCCESS;
}
/***************************************************************/