Browse Source

* update sampler

master
Alex 'AdUser' Z 10 years ago
parent
commit
115758d8e1
  1. 2
      src/Makefile
  2. 18
      src/sampler-test.c
  3. 1
      src/sampler.c

2
src/Makefile

@ -29,7 +29,7 @@ imdb_1to2: imdb_1to2.c
gcc $(CFLAGS) $(CPPFLAGS) -o $@ $^ gcc $(CFLAGS) $(CPPFLAGS) -o $@ $^
FLAGS=$(shell GraphicsMagickWand-config --cppflags --ldflags --libs) FLAGS=$(shell GraphicsMagickWand-config --cppflags --ldflags --libs)
sampler-test: sampler.c sampler-test.c sampler-test: sampler.c bitmap.c sampler-test.c
gcc $(CFLAGS) $(CPPFLAGS) $(FLAGS) -o $@ $^ gcc $(CFLAGS) $(CPPFLAGS) $(FLAGS) -o $@ $^
clean: clean:

18
src/sampler-test.c

@ -1,15 +1,25 @@
#include "common.h" #include "common.h"
#include "database.h" #include "database.h"
#include "bitmap.h"
#include "sampler.h" #include "sampler.h"
int main(int argc, char **argv) int main(int argc, char **argv)
{ {
char * const source = "sample.png";
imdb_rec_t rec; imdb_rec_t rec;
int ret = 0;
if (argc < 2) {
puts("Usage: sampler-test <file>");
exit(EXIT_FAILURE);
}
memset(&rec, 0x0, sizeof(imdb_rec_t)); memset(&rec, 0x0, sizeof(imdb_rec_t));
ret = imdb_sample(&rec, source);
exit(ret == 0 ? EXIT_SUCCESS : EXIT_FAILURE); if (imdb_sample(&rec, argv[1]) != 0) {
puts("sampler failure");
exit(EXIT_FAILURE);
}
bitmap_print(&rec.data[REC_OFF_BM]);
exit(EXIT_SUCCESS);
} }

1
src/sampler.c

@ -90,7 +90,6 @@ imdb_sample(imdb_rec_t * const rec,
fprintf(stderr, "%03d %.1024s\n", severity, description); /* FIXME */ fprintf(stderr, "%03d %.1024s\n", severity, description); /* FIXME */
} }
DestroyMagickWand(wand); DestroyMagickWand(wand);
DestroyMagick(); DestroyMagick();

Loading…
Cancel
Save