diff options
| author | Mattias Andrée <maandree@kth.se> | 2017-01-10 02:29:14 +0100 |
|---|---|---|
| committer | Mattias Andrée <maandree@kth.se> | 2017-01-10 02:29:14 +0100 |
| commit | 1f07892210515d5cf741727efc2532b8e50d4e71 (patch) | |
| tree | 5b5ef387b6ca3e90c7b464521ae501d8137a74a3 | |
| parent | Update todo (diff) | |
| download | blind-1f07892210515d5cf741727efc2532b8e50d4e71.tar.gz blind-1f07892210515d5cf741727efc2532b8e50d4e71.tar.bz2 blind-1f07892210515d5cf741727efc2532b8e50d4e71.tar.xz | |
vu-image-to-frame: add -h: headless frame
Signed-off-by: Mattias Andrée <maandree@kth.se>
| -rw-r--r-- | src/vu-image-to-frame.c | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/src/vu-image-to-frame.c b/src/vu-image-to-frame.c index ffa5b7f..7e70999 100644 --- a/src/vu-image-to-frame.c +++ b/src/vu-image-to-frame.c @@ -26,7 +26,7 @@ get_value(void *buffer) static void usage(void) { - eprintf("usage: %s\n", argv0); + eprintf("usage: [-h] %s\n", argv0); } int @@ -43,8 +43,12 @@ main(int argc, char *argv[]) double red, green, blue, pixel[4]; char width[3 * sizeof(size_t) + 1] = {0}; char height[3 * sizeof(size_t) + 1] = {0}; + int headless = 0; ARGBEGIN { + case 'h': + headless = 1; + break; default: usage(); } ARGEND; @@ -120,10 +124,12 @@ header_done: if (!*width || !*height) eprintf("convertion failed\n"); - printf("%s %s xyza\n%cuivf", width, height, 0); - fflush(stdout); - if (ferror(stdout)) - eprintf("<stdout>:"); + if (!headless) { + printf("%s %s xyza\n%cuivf", width, height, 0); + fflush(stdout); + if (ferror(stdout)) + eprintf("<stdout>:"); + } for (;;) { for (ptr = 0; ptr + 15 < n; ptr += 16) { |
