a few oops...

This commit is contained in:
tTh 2023-07-08 12:43:00 +02:00
parent 0f245582d5
commit 2c1687f82b
4 changed files with 21 additions and 12 deletions

View File

@ -134,7 +134,7 @@ if (notused) {
fprintf(stderr, "notused was %d, must be 0 in %s\n", fprintf(stderr, "notused was %d, must be 0 in %s\n",
notused, __func__); } notused, __func__); }
if (verbosity > 1) fprintf(stderr, "parsing '%s'\n", str); if (verbosity > 1) fprintf(stderr, "%s: parsing '%s'\n", __func__, str);
foo = sscanf(str, "%d,%d,%d,%d", &w, &h, &x, &y); foo = sscanf(str, "%d,%d,%d,%d", &w, &h, &x, &y);
if (4 == foo) { if (4 == foo) {
r->x = x, r->y = y, r->w = w, r->h = h; r->x = x, r->y = y, r->w = w, r->h = h;

View File

@ -1,11 +1,11 @@
#!/bin/bash #!/bin/bash
# # CAPTURE
source ./conf.sh source ./conf.sh
DEVICE="/dev/video0" DEVICE="/dev/video0"
GOPT=" -v -s 1920x1080 -p 0 -n 30" GOPT=" -v -s 1920x1080 -p 0 -n 10"
OUTD=$GRABDIR OUTD=$GRABDIR
TMPG="/dev/shm/tmpgrab.fimg" TMPG="/dev/shm/tmpgrab.fimg"
@ -15,9 +15,13 @@ do
# take the picz # take the picz
${GRAB} -d ${DEVICE} ${GOPT} -o ${TMPG} ${GRAB} -d ${DEVICE} ${GOPT} -o ${TMPG}
# display $TMPG
# only take the good spot # only take the good spot
fimg=$(printf "%s/%05d.fimg" ${OUTD} ${idx}) fimg=$(printf "%s/%05d.fimg" ${OUTD} ${idx})
${EXTR} ${TMPG} 800,600,560,240 ${fimg} ${EXTR} -o ${fimg} ${TMPG} 800,600,560,240 ${fimg}
# display ${fimg} ; exit
echo echo
sleep $DELAY_GRAB sleep $DELAY_GRAB

View File

@ -1,4 +1,6 @@
# Sat Jul 8 10:41:58 UTC 2023
# #
# location of some tools # location of some tools
# #
@ -6,14 +8,15 @@
GRAB="$HOME/Devel/FloatImg/v4l2/grabvidseq" GRAB="$HOME/Devel/FloatImg/v4l2/grabvidseq"
MKFX="$HOME/Devel/FloatImg/tools/fimgfx" MKFX="$HOME/Devel/FloatImg/tools/fimgfx"
MDAT="$HOME/Devel/FloatImg/tools/fimgmetadata" MDAT="$HOME/Devel/FloatImg/tools/fimgmetadata"
EXTR="fimgextract" EXTR="$HOME/Devel/FloatImg/tools/fimgextract"
INTERPOLATOR="$HOME/Devel/FloatImg/Fonderie/interpolator" INTERPOLATOR="$HOME/Devel/FloatImg/Fonderie/interpolator"
FONDERIE="$HOME/Devel/FloatImg/Fonderie/fonderie" FONDERIE="$HOME/Devel/FloatImg/Fonderie/fonderie"
SINGLEPASS="$HOME/Devel/FloatImg/Fonderie/singlepass" SINGLEPASS="$HOME/Devel/FloatImg/Fonderie/singlepass"
NBPASS=2400 NBPASS=2400
DELAY_GRAB=3 DELAY_GRAB=1
IDXLINKFARM=0 IDXLINKFARM=0
# #

View File

@ -68,7 +68,7 @@ printf("-- Fimg Extractor -- lib v%d -- %s %s\n", FIMG_VERSION,
puts("usage:\n\tfimgextract [options] source.fimg width,height,xpos,ypos"); puts("usage:\n\tfimgextract [options] source.fimg width,height,xpos,ypos");
puts("options:"); puts("options:");
puts("\t-o out.fimg\tname the output file"); puts("\t-o out.fimg\tname the output file");
puts("\t-v\t\tmake be a blabla box"); puts("\t-v\t\tmake me a blabla box");
puts("\t-x\t\tenable crashy feature"); puts("\t-x\t\tenable crashy feature");
exit(0); exit(0);
} }
@ -92,23 +92,25 @@ while ((opt = getopt(argc, argv, "ho:vx")) != -1) {
} }
} }
if (verbosity) {
fprintf(stderr, "argc = %d optind = %d\n", argc, optind); fprintf(stderr, "argc = %d optind = %d\n", argc, optind);
for (idx=optind; idx<argc; idx++) { for (idx=optind; idx<argc; idx++) {
fprintf(stderr, " %5d %s\n", idx, argv[idx]); fprintf(stderr, " %5d %s\n", idx, argv[idx]);
} }
}
if (argc==optind) { if (argc==optind) {
fprintf(stderr, "wuh ?\n"); fprintf(stderr, "wuh ?\n");
exit(0); exit(0);
} }
foo = parse_rectangle(argv[argc-1], &area, 0); foo = parse_rectangle(argv[optind+1], &area, 0);
if (4 != foo) { if (4 != foo) {
fprintf(stderr, "%s: parse_rectangle --> %d\n", argv[0], foo); fprintf(stderr, "%s: parse_rectangle --> %d\n", argv[0], foo);
exit(1); exit(1);
} }
foo = extractor(argv[argc-2], output_file, &area); foo = extractor(argv[optind], output_file, &area);
if (foo) { if (foo) {
fprintf(stderr, "%s: extractor --> %d\n", __func__, foo); fprintf(stderr, "%s: extractor --> %d\n", __func__, foo);
exit(1); exit(1);