Explorar el Código

* Add a blur example.

git-svn-id: file:///srv/caca.zoy.org/var/lib/svn/libpipi/trunk@2604 92316355-f0b4-4df1-b90c-862c8a59935f
remotes/tiles
sam hace 16 años
padre
commit
60dea0643d
Se han modificado 3 ficheros con 39 adiciones y 1 borrados
  1. +1
    -0
      .gitignore
  2. +4
    -1
      examples/Makefile.am
  3. +34
    -0
      examples/blur.c

+ 1
- 0
.gitignore Ver fichero

@@ -10,6 +10,7 @@ Makefile
libtool
pipi/pipi.pc
genethumb/genethumb
examples/blur
examples/img2rubik
stamp-h1
.auto


+ 4
- 1
examples/Makefile.am Ver fichero

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


+ 34
- 0
examples/blur.c Ver fichero

@@ -0,0 +1,34 @@
#include "config.h"
#include "common.h"

#include <stdio.h>
#include <stdlib.h>
#include <string.h>

#include <pipi.h>

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 <src> <radius> <dest>\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;
}


Cargando…
Cancelar
Guardar