|
|
@@ -79,6 +79,7 @@ pipi_command_t const *pipi_get_command_list(void) |
|
|
|
{ "wrap", 0 }, |
|
|
|
{ "combine", 0 }, |
|
|
|
{ "split", 0 }, |
|
|
|
{ "blit", 1 }, |
|
|
|
{ "mean", 0 }, |
|
|
|
{ "merge", 1 }, |
|
|
|
{ "min", 0 }, |
|
|
@@ -461,6 +462,33 @@ int pipi_command(pipi_context_t *ctx, char const *cmd, ...) |
|
|
|
ctx->images[ctx->nimages - 3] = dst; |
|
|
|
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")) |
|
|
|
{ |
|
|
|
pipi_image_t *dst; |
|
|
|