Compare commits

...

2 Commits

Author SHA1 Message Date
tth
daeb4c72a7 commit du soir, espoir 2021-05-10 01:15:29 +02:00
tth
5dd2c66beb nasty bug in makefile 2021-05-10 00:49:46 +02:00
3 changed files with 28 additions and 11 deletions

View File

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

View File

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

View File

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