Compare commits

..

No commits in common. "daeb4c72a7ce5bb3e79709a8e92b6f5720e01b55" and "0ea39f2f9ab0e2c7158c94945b707d6931787246" have entirely different histories.

3 changed files with 11 additions and 28 deletions

View File

@ -8,8 +8,8 @@ LIBS = -ltiff -lpnglite -lcfitsio
all: assemblage extracteur
assemblage: assemblage.c ${DEPS}
assemblage: assemblage.c Makefile
gcc $(COPT) $< ../libfloatimg.a $(LIBS) -o $@
extracteur: extracteur.c ${DEPS}
extracteur: extracteur.c Makefile
gcc $(COPT) $< ../libfloatimg.a $(LIBS) -o $@

View File

@ -7,19 +7,12 @@ IMGS="foo.fimg"
for idx in $(seq 0 69)
do
outf=$(printf "%s/X%04d.png" "/tmp" $idx)
echo "work on "$outf
echo $outf
x=$(( idx * 4 ))
y=$(( idx + 80 ))
./extracteur $IMGS 256,128,${x},${y} $outf
error=$?
if [ 0 -ne $error ] ; then
echo error $error
exit 1
fi
echo
./extracteur $IMGS 320,200,${x},${y} $outf
done
convert -delay 10 /tmp/X????.png foo.gif

View File

@ -24,7 +24,7 @@ float rgb[3];
if (verbosity) {
fimg_describe(in, "source");
fimg_describe(out, "destination");
print_rectangle(__func__, rect);
print_rectangle(rect);
}
count = 0;
@ -48,6 +48,7 @@ return 0;
void help(int k)
{
puts("Usage:\n\textracteur in.fimg w,h,x,y out.???");
exit(0);
}
/* ---------------------------------------------- ~~~~~~~~~~~~~~~~ */
@ -61,23 +62,16 @@ char *outfile = "out.fimg";
verbosity = 0;
#if 0
for (foo=0; foo<argc; foo++) {
fprintf(stderr, "%9d %s\n", foo, argv[foo]);
}
#endif
while ((opt = getopt(argc, argv, "hv")) != -1) {
switch(opt) {
case 'h': help(0), exit(0); break;
case 'v': verbosity++; break;
default: break;
case 'h': help(0); break;
case 'v': verbosity++; break;
default: break;
}
}
if (3 != argc-optind) {
fprintf(stderr, "---- %s errcli c=%d %d ----\n", argv[0],
argc, argc-optind);
fprintf(stderr, "---- %s errcli %d ----\n", argv[0], argc-optind);
help(1);
exit(1);
}
@ -106,13 +100,9 @@ if (4 != parse_rectangle( argv[optind+1], &zone, 0) ) {
// zone.w = src.width / 2; zone.h = src.height / 2;
// zone.x = src.width / 4 ; zone.y = src.height / 4;
if (verbosity) print_rectangle(argv[0], &zone);
if (verbosity) print_rectangle(&zone);
foo = fimg_create(&dst, zone.w, zone.h, FIMG_TYPE_RGB);
if (foo) {
fprintf(stderr, "NO PICZ EPIC FAIL %d\n", foo);
exit(1);
}
foo = fimg_extractor(&src, &dst, &zone);
if (foo) {