|
|
|
@ -4,6 +4,7 @@
|
|
|
|
|
|
|
|
|
|
#include <stdio.h>
|
|
|
|
|
#include <string.h>
|
|
|
|
|
#include <stdlib.h>
|
|
|
|
|
|
|
|
|
|
#include "../floatimg.h"
|
|
|
|
|
|
|
|
|
@ -11,11 +12,44 @@
|
|
|
|
|
|
|
|
|
|
extern int verbosity;
|
|
|
|
|
|
|
|
|
|
/* ---------------------------------------------------------------- */
|
|
|
|
|
static int check_boundaries(FloatImg *from, FloatImg *to, FimgArea51 *a51)
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
#if DEBUG_LEVEL
|
|
|
|
|
fprintf(stderr, ">>> %s ( %p %p %p )\n", __func__, from, to, a51);
|
|
|
|
|
fimg_printdims("from", from);
|
|
|
|
|
fimg_printdims("to ", to);
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
/* just a small molly-guard */
|
|
|
|
|
if ( (a51->w < 0) || (a51->h < 0) ) {
|
|
|
|
|
fprintf(stderr, "%s: fubar on %p\n", __func__, a51);
|
|
|
|
|
abort(); /* FY Bro ! */
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return -1;
|
|
|
|
|
}
|
|
|
|
|
/* ---------------------------------------------------------------- */
|
|
|
|
|
static int move_pixels(FloatImg *from, FloatImg *to,
|
|
|
|
|
FimgArea51 *a51, int flags)
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
#if DEBUG_LEVEL
|
|
|
|
|
fprintf(stderr, ">>> %s ( %p %p %p 0x%04x )\n", __func__,
|
|
|
|
|
from, to, a51, flags);
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
return -1;
|
|
|
|
|
}
|
|
|
|
|
/* ---------------------------------------------------------------- */
|
|
|
|
|
int incrustator_0(FloatImg *psrc, FloatImg *pdst,
|
|
|
|
|
int xpos, int ypos, int flags)
|
|
|
|
|
{
|
|
|
|
|
int y, srcpos, dstpos, szl;
|
|
|
|
|
int y, srcpos, dstpos, szl;
|
|
|
|
|
int foo;
|
|
|
|
|
|
|
|
|
|
FimgArea51 area;
|
|
|
|
|
|
|
|
|
|
#if DEBUG_LEVEL
|
|
|
|
|
fprintf(stderr, ">>> %s ( %p %p %d %d 0x%04X\n", __func__, psrc, pdst,
|
|
|
|
@ -28,6 +62,10 @@ if (verbosity > 1) {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* check boudaries */
|
|
|
|
|
area.x = xpos; area.y = ypos;
|
|
|
|
|
area.w = psrc->width; area.h = psrc->height;
|
|
|
|
|
foo = check_boundaries(psrc, pdst, &area);
|
|
|
|
|
|
|
|
|
|
if ( (xpos < 0) || (xpos > pdst->width - psrc->width) ||
|
|
|
|
|
(ypos < 0) || (ypos > pdst->height - psrc->height) ) {
|
|
|
|
|
fprintf(stderr, "%s: boudary error\n", __func__);
|
|
|
|
|