added FITS support to grabvidseq

This commit is contained in:
tth 2020-07-24 14:04:54 +02:00
parent be3338eb5f
commit 334cffce60
4 changed files with 10 additions and 5 deletions

1
.gitignore vendored
View File

@ -40,6 +40,7 @@ v4l2/grabvidseq
v4l2/*.o v4l2/*.o
v4l2/*.ppm v4l2/*.ppm
v4l2/*.png v4l2/*.png
v4l2/*.fits
v4l2/video-infos v4l2/video-infos
v4l2/nc-camcontrol v4l2/nc-camcontrol

View File

@ -19,7 +19,8 @@ v4l2_pr_structs.o: v4l2_pr_structs.c v4l2_pr_structs.h Makefile
gcc ${COPT} -c $< gcc ${COPT} -c $<
grabvidseq: grabvidseq.c ${DEPS} rgb2fimg.o grabvidseq: grabvidseq.c ${DEPS} rgb2fimg.o
gcc ${COPT} $< rgb2fimg.o ../libfloatimg.a -lpnglite -lz -lm -lv4l2 -o $@ gcc ${COPT} $< rgb2fimg.o ../libfloatimg.a -lpnglite -lz -lm \
-lcfitsio -lv4l2 -o $@
video-infos: video-infos.c Makefile funcs.o v4l2_pr_structs.o video-infos: video-infos.c Makefile funcs.o v4l2_pr_structs.o
gcc -Wall -g $< ${LOBJ} ../libfloatimg.a -o $@ gcc -Wall -g $< ${LOBJ} ../libfloatimg.a -o $@

View File

@ -51,9 +51,9 @@ int verbosity;
static void xioctl(int fh, int request, void *arg) static void xioctl(int fh, int request, void *arg)
{ {
int r; int r;
do { do {
r = v4l2_ioctl(fh, request, arg); r = v4l2_ioctl(fh, request, arg);
} while (r == -1 && ((errno == EINTR) || (errno == EAGAIN))); } while (r == -1 && ((errno == EINTR) || (errno == EAGAIN)));
@ -393,6 +393,9 @@ switch (foo) {
case FILE_TYPE_PNG: case FILE_TYPE_PNG:
foo = fimg_save_as_png(to_save, outfile, 0); foo = fimg_save_as_png(to_save, outfile, 0);
break; break;
case FILE_TYPE_FITS:
foo = fimg_save_R_as_fits(to_save, outfile, 0);
break;
default: default:
fprintf(stderr, "can't save as %s\n", outfile); fprintf(stderr, "can't save as %s\n", outfile);
break; break;

View File

@ -22,9 +22,9 @@ int verbosity;
/* --------------------------------------------------------------------- */ /* --------------------------------------------------------------------- */
int essai_get_fmt(char *dev, int k) int essai_get_fmt(char *dev, int k)
{ {
int vfd, idx, foo; int vfd, foo;
struct v4l2_format fmt; struct v4l2_format fmt;
struct v4l2_requestbuffers reqbuf; // struct v4l2_requestbuffers reqbuf;
fprintf(stderr, ">>> %s ( '%s' %d )\n", __func__, dev, k); fprintf(stderr, ">>> %s ( '%s' %d )\n", __func__, dev, k);