/*
* 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.
*/
/*
* The functions step along the lines from xLeft to xRight and apply
* the bilinear filtering.
*
*/
#include "vis_proto.h"
#include "mlib_image.h"
#include "mlib_ImageColormap.h"
#include "mlib_ImageCopy.h"
#include "mlib_ImageAffine.h"
#include "mlib_v_ImageFilters.h"
#include "mlib_v_ImageChannelExtract.h"
/***************************************************************/
/*#define MLIB_VIS2*/
/***************************************************************/
/***************************************************************/
/***************************************************************/
#ifdef MLIB_VIS2
#else
#endif /* MLIB_VIS2 */
/***************************************************************/
/***************************************************************/
#define DECLAREVAR() \
DECLAREVAR0(); \
/***************************************************************/
#define FMUL_16x16(x, y) \
/***************************************************************/
/***************************************************************/
0x00000000, 0x000000FF, 0x0000FF00, 0x0000FFFF,
0x00FF0000, 0x00FF00FF, 0x00FFFF00, 0x00FFFFFF,
0xFF000000, 0xFF0000FF, 0xFF00FF00, 0xFF00FFFF,
0xFFFF0000, 0xFFFF00FF, 0xFFFFFF00, 0xFFFFFFFF
};
/***************************************************************/
/***************************************************************/
\
\
/***************************************************************/
#define GET_FILTER_XY() \
filterpos)); \
/***************************************************************/
/***************************************************************/
#define LOAD_1CH() \
\
\
/***************************************************************/
(X >> MLIB_SHIFT); \
X += dX; \
Y += dY
/***************************************************************/
#define PREPARE_DELTAS \
}
/***************************************************************/
{
DECLAREVAR();
NEW_LINE(1);
if (off) {
}
if (off > 2) {
if (size > 2) {
}
}
LOAD_1CH();
}
#pragma pipeloop(0)
for (i = 0; i < size/4; i++) {
LOAD_1CH();
}
if (off) {
if (off > 1) {
}
if (off > 2) {
}
LOAD_1CH();
}
}
return MLIB_SUCCESS;
}
/***************************************************************/
2*(X >> MLIB_SHIFT); \
X += dX; \
Y += dY
/***************************************************************/
#ifndef MLIB_VIS2
#define LOAD_2CH() \
\
#else
#define LOAD_2CH() \
#endif /* MLIB_VIS2 */
/***************************************************************/
#define PREPARE_DELTAS \
}
/***************************************************************/
{
DECLAREVAR();
}
MLIB_WRITE_BMASK(0x45cd67ef);
NEW_LINE(2);
if (off) {
} else {
}
if (off) {
LOAD_2CH();
BL_SUM_2CH();
size--;
}
if (size >= 2) {
LOAD_2CH();
#pragma pipeloop(0)
BL_SUM_2CH();
LOAD_2CH();
}
BL_SUM_2CH();
}
if (size & 1) {
LOAD_2CH();
BL_SUM_2CH();
}
}
return MLIB_SUCCESS;
}
/***************************************************************/
#ifndef MLIB_VIS2
#define LOAD_2CH_NA() \
\
\
#else
#define LOAD_2CH_NA() \
vis_alignaddr(sp0, 0); \
\
vis_alignaddr(sp1, 0); \
\
\
\
#define BL_SUM_2CH_NA() \
\
\
#endif /* MLIB_VIS2 */
/***************************************************************/
{
DECLAREVAR();
}
MLIB_WRITE_BMASK(0x018923AB);
#ifndef MLIB_VIS2
#else
#endif /* MLIB_VIS2 */
NEW_LINE(2);
#pragma pipeloop(0)
for (i = 0; i < size/2; i++) {
LOAD_2CH_NA();
}
if (size & 1) {
LOAD_2CH_NA();
}
}
}
return MLIB_SUCCESS;
}
/***************************************************************/
#define PREPARE_DELTAS \
}
/***************************************************************/
{
DECLAREVAR();
}
NEW_LINE(3);
#pragma pipeloop(0)
for (i = 0; i < size; i++) {
vis_alignaddr(sp, 0);
vis_alignaddr((void*)0, 2);
X += dX;
Y += dY;
}
}
}
return MLIB_SUCCESS;
}
/***************************************************************/
\
/***************************************************************/
{
DECLAREVAR();
}
srcYStride >>= 2;
NEW_LINE(4);
#pragma pipeloop(0)
for (i = 0; i < size; i++) {
X += dX;
Y += dY;
}
}
return MLIB_SUCCESS;
}
/***************************************************************/
{
DECLAREVAR();
}
NEW_LINE(4);
#pragma pipeloop(0)
for (i = 0; i < size; i++) {
vis_alignaddr(sp, 0);
X += dX;
Y += dY;
}
}
}
return MLIB_SUCCESS;
}
/***************************************************************/
const void *colormap)
{
DECLAREVAR();
}
NEW_LINE(1);
#pragma pipeloop(0)
for (i = 0; i < size; i++) {
X += dX;
Y += dY;
}
if (nchan == 3) {
} else {
}
}
}
return MLIB_SUCCESS;
}
/***************************************************************/
const void *colormap)
{
DECLAREVAR();
srcYStride /= sizeof(DTYPE);
}
NEW_LINE(1);
#pragma pipeloop(0)
for (i = 0; i < size; i++) {
X += dX;
Y += dY;
}
if (nchan == 3) {
} else {
}
}
}
return MLIB_SUCCESS;
}
/***************************************************************/
};
/***************************************************************/