git-svn-id: file:///srv/caca.zoy.org/var/lib/svn/libpipi/trunk@3547 92316355-f0b4-4df1-b90c-862c8a59935fmaster
@@ -59,6 +59,7 @@ render_sources = \ | |||||
render/screen.c | render/screen.c | ||||
combine_sources = \ | combine_sources = \ | ||||
combine/blit.c \ | |||||
combine/rgb.c \ | combine/rgb.c \ | ||||
combine/merge.c \ | combine/merge.c \ | ||||
combine/minmax.c \ | combine/minmax.c \ | ||||
@@ -79,6 +79,7 @@ pipi_command_t const *pipi_get_command_list(void) | |||||
{ "wrap", 0 }, | { "wrap", 0 }, | ||||
{ "combine", 0 }, | { "combine", 0 }, | ||||
{ "split", 0 }, | { "split", 0 }, | ||||
{ "blit", 1 }, | |||||
{ "mean", 0 }, | { "mean", 0 }, | ||||
{ "merge", 1 }, | { "merge", 1 }, | ||||
{ "min", 0 }, | { "min", 0 }, | ||||
@@ -461,6 +462,33 @@ int pipi_command(pipi_context_t *ctx, char const *cmd, ...) | |||||
ctx->images[ctx->nimages - 3] = dst; | ctx->images[ctx->nimages - 3] = dst; | ||||
ctx->nimages -= 2; | ctx->nimages -= 2; | ||||
} | } | ||||
else if(!strcmp(cmd, "blit")) | |||||
{ | |||||
pipi_image_t *dst; | |||||
char const *arg; | |||||
va_list ap; | |||||
int x, y; | |||||
if(ctx->nimages < 2) | |||||
return -1; | |||||
va_start(ap, cmd); | |||||
arg = va_arg(ap, char const *); | |||||
va_end(ap); | |||||
x = atoi(arg); | |||||
arg = strchr(arg, 'x'); | |||||
if(!arg) | |||||
return -1; | |||||
y = atoi(arg + 1); | |||||
dst = pipi_blit(ctx->images[ctx->nimages - 2], | |||||
ctx->images[ctx->nimages - 1], x, y); | |||||
if(dst == NULL) | |||||
return -1; | |||||
pipi_free(ctx->images[ctx->nimages - 2]); | |||||
pipi_free(ctx->images[ctx->nimages - 1]); | |||||
ctx->images[ctx->nimages - 2] = dst; | |||||
ctx->nimages--; | |||||
} | |||||
else if(!strcmp(cmd, "merge")) | else if(!strcmp(cmd, "merge")) | ||||
{ | { | ||||
pipi_image_t *dst; | pipi_image_t *dst; | ||||
@@ -167,6 +167,7 @@ __extern pipi_image_t *pipi_rgb(pipi_image_t *, pipi_image_t *, pipi_image_t *); | |||||
__extern pipi_image_t *pipi_red(pipi_image_t *); | __extern pipi_image_t *pipi_red(pipi_image_t *); | ||||
__extern pipi_image_t *pipi_green(pipi_image_t *); | __extern pipi_image_t *pipi_green(pipi_image_t *); | ||||
__extern pipi_image_t *pipi_blue(pipi_image_t *); | __extern pipi_image_t *pipi_blue(pipi_image_t *); | ||||
__extern pipi_image_t *pipi_blit(pipi_image_t *, pipi_image_t *, int, int); | |||||
__extern pipi_image_t *pipi_merge(pipi_image_t *, pipi_image_t *, double); | __extern pipi_image_t *pipi_merge(pipi_image_t *, pipi_image_t *, double); | ||||
__extern pipi_image_t *pipi_mean(pipi_image_t *, pipi_image_t *); | __extern pipi_image_t *pipi_mean(pipi_image_t *, pipi_image_t *); | ||||
__extern pipi_image_t *pipi_min(pipi_image_t *, pipi_image_t *); | __extern pipi_image_t *pipi_min(pipi_image_t *, pipi_image_t *); | ||||