Browse Source

* Add --boxblur to the pipi command line.

git-svn-id: file:///srv/caca.zoy.org/var/lib/svn/libpipi/trunk@2742 92316355-f0b4-4df1-b90c-862c8a59935f
remotes/tiles
sam 16 years ago
parent
commit
ab1487e666
2 changed files with 31 additions and 0 deletions
  1. +23
    -0
      pipi/context.c
  2. +8
    -0
      src/pipi.c

+ 23
- 0
pipi/context.c View File

@@ -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;


+ 8
- 0
src/pipi.c View File

@@ -65,6 +65,14 @@ int main(int argc, char *argv[])
return EXIT_FAILURE;
argv++;
}
else if(!strcmp(argv[0], "--boxblur"))
{
if(argv[1] == NULL)
return EXIT_FAILURE;
if(pipi_command(ctx, "boxblur", argv[1]) != 0)
return EXIT_FAILURE;
argv++;
}
else if(!strcmp(argv[0], "--gray"))
{
if(pipi_command(ctx, "gray") != 0)


Loading…
Cancel
Save