move extractor to func/
This commit is contained in:
@@ -12,11 +12,6 @@
|
||||
int verbosity;
|
||||
|
||||
/* ---------------------------------------------- ~~~~~~~~~~~~~~~~ */
|
||||
typedef struct {
|
||||
int w, h;
|
||||
int x, y;
|
||||
int flags;
|
||||
} Rectangle;
|
||||
|
||||
/* ---------------------------------------------- ~~~~~~~~~~~~~~~~ */
|
||||
int print_rectangle(Rectangle *rect)
|
||||
@@ -28,20 +23,6 @@ printf("rect @ %p : %dx%d at %d,%d\n", rect, rect->w, rect->h,
|
||||
return 0;
|
||||
}
|
||||
/* ---------------------------------------------- ~~~~~~~~~~~~~~~~ */
|
||||
int parse_rectangle(char *str, Rectangle *r, int notused)
|
||||
{
|
||||
int x, y, w, h, foo;
|
||||
|
||||
if (verbosity)
|
||||
fprintf(stderr, "parsing %s\n", str);
|
||||
|
||||
foo = sscanf(str, "%d,%d,%d,%d", &w, &h, &x, &y);
|
||||
if (4 == foo) {
|
||||
r->x = x, r->y = y, r->w = w, r->h = h;
|
||||
return 4;
|
||||
}
|
||||
return -1;
|
||||
}
|
||||
/* ---------------------------------------------- ~~~~~~~~~~~~~~~~ */
|
||||
int essai_extraction(FloatImg *in, FloatImg *out, Rectangle *rect)
|
||||
{
|
||||
@@ -111,7 +92,7 @@ if (verbosity) {
|
||||
}
|
||||
|
||||
infile = argv[optind]; outfile = argv[optind+2];
|
||||
fprintf(stderr, " %s -> %s\n", infile, outfile);
|
||||
fprintf(stderr, "%s %s -> %s\n", argv[0], infile, outfile);
|
||||
|
||||
foo = fimg_create_from_dump(infile, &src);
|
||||
if (foo) {
|
||||
@@ -133,7 +114,7 @@ if (verbosity) print_rectangle(&zone);
|
||||
|
||||
foo = fimg_create(&dst, zone.w, zone.h, FIMG_TYPE_RGB);
|
||||
|
||||
foo = essai_extraction(&src, &dst, &zone);
|
||||
foo = fimg_extractor(&src, &dst, &zone);
|
||||
if (foo) {
|
||||
fprintf(stderr, "EXTRACTOR EPIC FAIL %d\n", foo);
|
||||
exit(1);
|
||||
|
||||
Reference in New Issue
Block a user