Changeset 2694
- Timestamp:
- Aug 11, 2008, 2:51:05 AM (15 years ago)
- Location:
- libpipi/trunk
- Files:
-
- 2 deleted
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
libpipi/trunk/.gitignore
r2693 r2694 12 12 src/pipi 13 13 genethumb/genethumb 14 examples/blur15 examples/dither16 14 examples/edd 15 examples/floodfill 17 16 examples/img2rubik 18 17 examples/sharpen -
libpipi/trunk/examples/Makefile.am
r2676 r2694 3 3 AM_CPPFLAGS = -I$(top_srcdir) -I$(top_srcdir)/pipi 4 4 5 bin_PROGRAMS = blur dither edd img2rubik sharpen floodfill 6 7 blur_SOURCES = blur.c 8 blur_LDADD = ../pipi/libpipi.la 9 10 dither_SOURCES = dither.c 11 dither_LDADD = ../pipi/libpipi.la 5 bin_PROGRAMS = edd img2rubik sharpen floodfill 12 6 13 7 edd_SOURCES = edd.c -
libpipi/trunk/pipi/context.c
r2692 r2694 72 72 pipi_free(ctx->images[ctx->nimages]); 73 73 } 74 else if(!strcmp(cmd, "dither")) 75 { 76 pipi_image_t *src, *dst; 77 char const *method; 78 va_list ap; 79 80 if(ctx->nimages <= 0) 81 return -1; 82 va_start(ap, cmd); 83 method = va_arg(ap, char const *); 84 va_end(ap); 85 src = ctx->images[ctx->nimages - 1]; 86 dst = NULL; 87 if(!strcmp(method, "fs")) 88 dst = pipi_dither_floydsteinberg(src, 0); 89 else if(!strcmp(method, "sfs")) 90 dst = pipi_dither_floydsteinberg(src, 1); 91 else if(!strcmp(method, "ost")) 92 dst = pipi_dither_ostromoukhov(src, 0); 93 else if(!strcmp(method, "sost")) 94 dst = pipi_dither_ostromoukhov(src, 1); 95 else if(!strcmp(method, "ordered")) 96 dst = pipi_dither_ordered(src); 97 else if(!strcmp(method, "random")) 98 dst = pipi_dither_random(src); 99 else if(!strcmp(method, "dbs")) 100 dst = pipi_dither_dbs(src); 101 if(dst == NULL) 102 return -1; 103 pipi_free(src); 104 ctx->images[ctx->nimages - 1] = dst; 105 } 106 else if(!strcmp(cmd, "blur")) 107 { 108 pipi_image_t *src, *dst; 109 char const *arg; 110 va_list ap; 111 112 if(ctx->nimages <= 0) 113 return -1; 114 va_start(ap, cmd); 115 arg = va_arg(ap, char const *); 116 va_end(ap); 117 src = ctx->images[ctx->nimages - 1]; 118 dst = pipi_gaussian_blur(src, atoi(arg)); 119 if(dst == NULL) 120 return -1; 121 pipi_free(src); 122 ctx->images[ctx->nimages - 1] = dst; 123 } 74 124 else if(!strcmp(cmd, "free")) 75 125 { -
libpipi/trunk/src/pipi.c
r2693 r2694 16 16 while(*++argv) 17 17 { 18 if(!strcmp(argv[0], "--output") || !strcmp(argv[0], "-o")) 18 if(!strcmp(argv[0], "--dup")) 19 { 20 if(pipi_command(ctx, "dup") != 0) 21 return EXIT_FAILURE; 22 } 23 else if(!strcmp(argv[0], "--dither")) 24 { 25 if(argv[1] == NULL) 26 return EXIT_FAILURE; 27 if(pipi_command(ctx, "dither", argv[1]) != 0) 28 return EXIT_FAILURE; 29 argv++; 30 } 31 else if(!strcmp(argv[0], "--blur")) 32 { 33 if(argv[1] == NULL) 34 return EXIT_FAILURE; 35 if(pipi_command(ctx, "blur", argv[1]) != 0) 36 return EXIT_FAILURE; 37 argv++; 38 } 39 else if(!strcmp(argv[0], "--output") || !strcmp(argv[0], "-o")) 19 40 { 20 41 if(argv[1] == NULL)
Note: See TracChangeset
for help on using the changeset viewer.