diff --git a/.gitignore b/.gitignore index a16877a..7164dd3 100644 --- a/.gitignore +++ b/.gitignore @@ -10,6 +10,7 @@ Makefile libtool pipi/pipi.pc genethumb/genethumb +examples/blur examples/img2rubik stamp-h1 .auto diff --git a/examples/Makefile.am b/examples/Makefile.am index 8ccef3d..e9737d3 100644 --- a/examples/Makefile.am +++ b/examples/Makefile.am @@ -2,7 +2,10 @@ AM_CPPFLAGS = -I$(top_srcdir) -I$(top_srcdir)/pipi -bin_PROGRAMS = img2rubik +bin_PROGRAMS = img2rubik blur + +blur_SOURCES = blur.c +blur_LDADD = ../pipi/libpipi.la img2rubik_SOURCES = img2rubik.c img2rubik_LDADD = ../pipi/libpipi.la diff --git a/examples/blur.c b/examples/blur.c new file mode 100644 index 0000000..d90d355 --- /dev/null +++ b/examples/blur.c @@ -0,0 +1,34 @@ +#include "config.h" +#include "common.h" + +#include +#include +#include + +#include + +int main(int argc, char *argv[]) +{ + char *srcname = NULL, *dstname = NULL; + pipi_image_t *img, *newimg; + + if(argc < 3) + { + fprintf(stderr, "%s: too few arguments\n", argv[0]); + fprintf(stderr, "Usage: %s \n", argv[0]); + return EXIT_FAILURE; + } + + srcname = argv[1]; + dstname = argv[3]; + + img = pipi_load(srcname); + newimg = pipi_gaussian_blur(img, atof(argv[2])); + pipi_free(img); + + pipi_save(newimg, dstname); + pipi_free(newimg); + + return 0; +} +