diff options
| author | Mattias Andrée <maandree@kth.se> | 2017-01-15 17:15:47 +0100 |
|---|---|---|
| committer | Mattias Andrée <maandree@kth.se> | 2017-01-15 17:15:47 +0100 |
| commit | d6c07e7fa021e13b5b9914cb15f13c711ecd387d (patch) | |
| tree | 75fd767b2078a786c6bdb6729c45a63fd3b81979 /src/stream.h | |
| parent | blind-config: fix -j (diff) | |
| download | blind-d6c07e7fa021e13b5b9914cb15f13c711ecd387d.tar.gz blind-d6c07e7fa021e13b5b9914cb15f13c711ecd387d.tar.bz2 blind-d6c07e7fa021e13b5b9914cb15f13c711ecd387d.tar.xz | |
Use macros to write the head
Signed-off-by: Mattias Andrée <maandree@kth.se>
Diffstat (limited to 'src/stream.h')
| -rw-r--r-- | src/stream.h | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/src/stream.h b/src/stream.h index 027db4a..53b7113 100644 --- a/src/stream.h +++ b/src/stream.h @@ -4,6 +4,18 @@ #define STREAM_HEAD_MAX (3 * 3 * sizeof(size_t) + sizeof(((struct stream *)0)->pixfmt) + 10) +#define SPRINTF_HEAD_ZN(BUF, FRAMES, WIDTH, HEIGHT, PIXFMT, LENP)\ + sprintf(BUF, "%zu %zu %zu %s\n%cuivf%zn",\ + FRAMES, WIDTH, HEIGHT, PIXFMT, 0, LENP) + +#define SPRINTF_HEAD(BUF, FRAMES, WIDTH, HEIGHT, PIXFMT)\ + sprintf(BUF, "%zu %zu %zu %s\n%cuivf",\ + FRAMES, WIDTH, HEIGHT, PIXFMT, 0) + +#define FPRINTF_HEAD(FP, FRAMES, WIDTH, HEIGHT, PIXFMT)\ + fprintf(fp, "%zu %zu %zu %s\n%cuivf",\ + FRAMES, WIDTH, HEIGHT, PIXFMT, 0) + #define einit_stream(...) eninit_stream(1, __VA_ARGS__) #define eset_pixel_size(...) enset_pixel_size(1, __VA_ARGS__) #define eread_stream(...) enread_stream(1, __VA_ARGS__) |
