/*
* 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.
*/
/*
* FUNCTIONS
* mlib_ImageCopy - Direct copy from one image to another.
*
* SYNOPSIS
* mlib_status mlib_ImageCopy(mlib_image *dst,
* const mlib_image *src);
*
* ARGUMENT
* dst pointer to output or destination image
* src pointer to input or source image
*
* RESTRICTION
* src and dst must have the same size, type and number of channels.
* They can have 1, 2, 3 or 4 channels of MLIB_BIT, MLIB_BYTE, MLIB_SHORT,
* MLIB_USHORT, MLIB_INT, MLIB_FLOAT or MLIB_DOUBLE data type.
*
* DESCRIPTION
* Direct copy from one image to another
*/
#include <stdlib.h>
#include "mlib_image.h"
#include "mlib_ImageCheck.h"
#include "mlib_ImageCopy.h"
/***************************************************************/
#ifdef _MSC_VER
#endif /* _MSC_VER */
/***************************************************************/
/* do not perform the coping by mlib_d64 data type for x86 */
#ifdef i386
typedef struct {
} two_int;
#else /* i386 */
#endif /* i386 */
/***************************************************************/
mlib_image *dst);
mlib_image *dst);
mlib_image *dst);
mlib_image *dst);
TYPE_64BIT *dp,
/***************************************************************/
const mlib_image *src)
{
mlib_s32 j;
switch (mlib_ImageGetType(dst)) {
case MLIB_BIT:
}
else {
}
}
else {
for (j = 0; j < height; j++) {
}
}
else {
for (j = 0; j < height; j++) {
}
}
}
break;
case MLIB_BYTE:
break;
case MLIB_SHORT:
case MLIB_USHORT:
break;
case MLIB_INT:
case MLIB_FLOAT:
break;
case MLIB_DOUBLE:
break;
default:
return MLIB_FAILURE; /* MLIB_BIT is not supported here */
}
return MLIB_SUCCESS;
}
/***************************************************************/
mlib_s32 i, j; \
\
src_width *= src_height; \
src_height = 1; \
}
/***************************************************************/
for ( i = 0; i < h; i++ ) { \
if (j = w & 1) \
for (; j < w; j += 2) { \
} \
} \
}
/***************************************************************/
/*
* Both bit offsets of source and distination are the same
*/
{
if (size <= 0) return;
return;
}
da++;
sa++;
#ifdef __SUNPRO_C
#pragma pipeloop(0)
#endif /* __SUNPRO_C */
}
sa += i << 3;
da += i << 3;
}
else {
#ifdef _NO_LONGLONG
#ifdef __SUNPRO_C
#pragma pipeloop(0)
#endif /* __SUNPRO_C */
}
sa += i << 2;
da += i << 2;
}
else {
lshift <<= 3;
#ifdef __SUNPRO_C
#pragma pipeloop(0)
#endif /* __SUNPRO_C */
#ifdef _LITTLE_ENDIAN
#else
#endif /* _LITTLE_ENDIAN */
}
sa += i << 2;
da += i << 2;
}
#else
lshift <<= 3;
#ifdef __SUNPRO_C
#pragma pipeloop(0)
#endif /* __SUNPRO_C */
}
sa += i << 3;
da += i << 3;
#endif /* _NO_LONGLONG */
}
for (; j < b_size; j++)
j = size & 7;
if (j > 0) {
}
}
/***************************************************************/
{
if (src_width < 16) {
return;
}
for (i = 0; i < src_height; i++) {
}
#ifdef __SUNPRO_C
#pragma pipeloop(0)
#endif /* __SUNPRO_C */
}
}
else {
#ifdef _NO_LONGLONG
}
#ifdef __SUNPRO_C
#pragma pipeloop(0)
#endif /* __SUNPRO_C */
}
}
else {
shl <<= 3;
#ifdef __SUNPRO_C
#pragma pipeloop(0)
#endif /* __SUNPRO_C */
#ifdef _LITTLE_ENDIAN
#else
#endif /* _LITTLE_ENDIAN */
ps++;
}
}
#else
}
{
/* shl and shr are in range [0, 64] */
shl <<= 3;
#ifdef __SUNPRO_C
#pragma pipeloop(0)
#endif /* __SUNPRO_C */
#ifdef _LITTLE_ENDIAN
#else
#endif /* _LITTLE_ENDIAN */
ps++;
}
}
#endif /* _NO_LONGLONG */
}
for (; j < src_width; j++)
}
}
/***************************************************************/
{
if (src_width < 8) {
return;
}
for (i = 0; i < src_height; i++) {
}
#ifdef __SUNPRO_C
#pragma pipeloop(0)
#endif /* __SUNPRO_C */
}
}
else {
#ifdef _NO_LONGLONG
}
#ifdef __SUNPRO_C
#pragma pipeloop(0)
#endif /* __SUNPRO_C */
}
}
else {
#ifdef __SUNPRO_C
#pragma pipeloop(0)
#endif /* __SUNPRO_C */
#ifdef _LITTLE_ENDIAN
#else
#endif /* _LITTLE_ENDIAN */
ps++;
}
}
#else
}
{
shl <<= 3;
#ifdef __SUNPRO_C
#pragma pipeloop(0)
#endif /* __SUNPRO_C */
#ifdef _LITTLE_ENDIAN
#else
#endif /* _LITTLE_ENDIAN */
ps++;
}
}
#endif /* _NO_LONGLONG */
}
for (; j < src_width; j++)
}
}
/***************************************************************/
{
if (src_width < 4) {
return;
}
for (i = 0; i < src_height; i++) {
}
#ifdef __SUNPRO_C
#pragma pipeloop(0)
#endif /* __SUNPRO_C */
}
}
else {
#ifdef _NO_LONGLONG
#ifdef __SUNPRO_C
#pragma pipeloop(0)
#endif /* __SUNPRO_C */
for (j = 0; j <= (src_width - 1); j++) {
}
#else
{
#ifdef __SUNPRO_C
#pragma pipeloop(0)
#endif /* __SUNPRO_C */
#ifdef _LITTLE_ENDIAN
#else
#endif /* _LITTLE_ENDIAN */
ps++;
}
}
#endif /* _NO_LONGLONG */
}
for (; j < src_width; j++)
}
}
/***************************************************************/
{
for (i = 0; i < src_height; i++) {
#ifdef __SUNPRO_C
#pragma pipeloop(0)
#endif /* __SUNPRO_C */
for (j = 0; j < src_width; j++)
}
}
/***************************************************************/
/*
* Both source and destination image data are 1 - d vectors and
* 8 - byte aligned. And size is in 8 - bytes.
*/
TYPE_64BIT *dp,
{
mlib_s32 i;
#ifdef __SUNPRO_C
#pragma pipeloop(0)
#endif /* __SUNPRO_C */
for (i = 0; i < size; i++) {
}
}
/***************************************************************/
#ifndef _NO_LONGLONG
#else
#endif /* _NO_LONGLONG */
/***************************************************************/
mlib_s32 n)
{
#ifdef __SUNPRO_C
#pragma pipeloop(0)
#endif /* __SUNPRO_C */
#ifdef _NO_LONGLONG
}
}
else
#endif /* _NO_LONGLONG */
{
/* shl and shr do not exceed 64 here */
#ifdef __SUNPRO_C
#pragma pipeloop(0)
#endif /* __SUNPRO_C */
#ifdef _LITTLE_ENDIAN
#else
#endif /* _LITTLE_ENDIAN */
}
}
}
else {
#ifdef __SUNPRO_C
#pragma pipeloop(0)
#endif /* __SUNPRO_C */
#ifdef __SUNPRO_C
#pragma pipeloop(0)
#endif /* __SUNPRO_C */
for (; n > 8; n -= 8) {
dp += 8;
sp += 8;
}
}
#ifdef __SUNPRO_C
#pragma pipeloop(0)
#endif /* __SUNPRO_C */
for (; n > 0; n--)
}
/***************************************************************/
#ifdef _MSC_VER
#endif /* _MSC_VER */
/***************************************************************/