|
|
@@ -141,6 +141,29 @@ int pipi_command(pipi_context_t *ctx, char const *cmd, ...) |
|
|
|
pipi_free(src); |
|
|
|
ctx->images[ctx->nimages - 1] = dst; |
|
|
|
} |
|
|
|
else if(!strcmp(cmd, "boxblur")) |
|
|
|
{ |
|
|
|
pipi_image_t *src, *dst; |
|
|
|
char const *arg; |
|
|
|
va_list ap; |
|
|
|
double w, h; |
|
|
|
|
|
|
|
if(ctx->nimages < 1) |
|
|
|
return -1; |
|
|
|
va_start(ap, cmd); |
|
|
|
arg = va_arg(ap, char const *); |
|
|
|
va_end(ap); |
|
|
|
w = h = atof(arg); |
|
|
|
arg = strchr(arg, 'x'); |
|
|
|
if(arg) |
|
|
|
h = atof(arg + 1); |
|
|
|
src = ctx->images[ctx->nimages - 1]; |
|
|
|
dst = pipi_box_blur_ext(src, w, h); |
|
|
|
if(dst == NULL) |
|
|
|
return -1; |
|
|
|
pipi_free(src); |
|
|
|
ctx->images[ctx->nimages - 1] = dst; |
|
|
|
} |
|
|
|
else if(!strcmp(cmd, "geometry")) |
|
|
|
{ |
|
|
|
pipi_image_t *src, *dst; |
|
|
|