summaryrefslogtreecommitdiff
path: root/farbfeld/ff2pam.c
diff options
context:
space:
mode:
authorstkhan <personal@slickd.xyz>2022-06-20 19:54:29 +0000
committerstkhan <personal@slickd.xyz>2022-06-20 19:54:29 +0000
commit4c40a4dc245f7715f4891ed02d71475628e7a959 (patch)
treefa52419490b5a0d89d746f6e3a0b0c1e675b7726 /farbfeld/ff2pam.c
parent513b0e238b98f72a01d740a0bd99a3739918645c (diff)
new directory structure
Diffstat (limited to 'farbfeld/ff2pam.c')
-rw-r--r--farbfeld/ff2pam.c55
1 files changed, 0 insertions, 55 deletions
diff --git a/farbfeld/ff2pam.c b/farbfeld/ff2pam.c
deleted file mode 100644
index fca5c6f..0000000
--- a/farbfeld/ff2pam.c
+++ /dev/null
@@ -1,55 +0,0 @@
-/* See LICENSE file for copyright and license details. */
-#include <arpa/inet.h>
-
-#include <errno.h>
-#include <inttypes.h>
-#include <stdint.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <unistd.h>
-
-#include "util.h"
-
-static void
-usage(void)
-{
- die("usage: %s", argv0);
-}
-
-int
-main(int argc, char *argv[])
-{
- size_t rowlen;
- uint32_t width, height, i;
- uint16_t *row;
-
- /* arguments */
- argv0 = argv[0], argc--, argv++;
-
- if (argc) {
- usage();
- }
-
- /* prepare */
- ff_read_header(&width, &height);
- row = ereallocarray(NULL, width, (sizeof("RGBA") - 1) * sizeof(uint16_t));
- rowlen = width * (sizeof("RGBA") - 1);
-
- /* write data */
- printf("P7\n"
- "WIDTH %" PRIu32 "\n"
- "HEIGHT %" PRIu32 "\n"
- "DEPTH 4\n" /* number of channels */
- "MAXVAL 65535\n"
- "TUPLTYPE RGB_ALPHA\n"
- "ENDHDR\n",
- width, height);
-
- for (i = 0; i < height; i++) {
- efread(row, sizeof(uint16_t), rowlen, stdin);
- efwrite(row, sizeof(uint16_t), rowlen, stdout);
- }
-
- return fshut(stdout, "<stdout>");
-}