summaryrefslogtreecommitdiff
path: root/src/fmt/nut.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/fmt/nut.c')
-rw-r--r--src/fmt/nut.c53
1 files changed, 0 insertions, 53 deletions
diff --git a/src/fmt/nut.c b/src/fmt/nut.c
index f9ca9fd..886a054 100644
--- a/src/fmt/nut.c
+++ b/src/fmt/nut.c
@@ -254,56 +254,3 @@ void nut_write_end(struct nut_writer *wr)
free(index.ptr);
}
-
-/*
-#include <inttypes.h>
-#include <unistd.h>
-#include <time.h>
-
-int main()
-{
- unsigned int fps = 20;
- unsigned int size[2] = { 200, 200 };
-
- //FILE *f = fopen("test.nut", "wb");
- //if (!f) {
- // fprintf(stderr, "failed to open output\n");
- // return EXIT_FAILURE;
- //}
-
- struct nut_writer writer;
- nut_write_start(&writer, stdout, fps, size);
-
- struct timespec ts;
- clock_gettime(CLOCK_REALTIME, &ts);
-
- size_t n_pixels = size[0] * size[1];
- size_t frame_size = n_pixels * 4;
- void *frame_buf = malloc(frame_size);
-
- for (unsigned int stage = 0;; stage++) {
- uint32_t color = htole32((0xff << 24) | (0xff << ((stage%3)*8)));
- for (size_t i = 0; i < n_pixels; i++)
- ((uint32_t *)frame_buf)[i] = color;
- for (unsigned int frame = 0; frame < fps; frame++) {
- struct timespec ts_now;
- clock_gettime(CLOCK_REALTIME, &ts_now);
-
- double e_time = (double) (ts_now.tv_nsec - ts.tv_nsec) / 1000000000.0 +
- (ts_now.tv_sec - ts.tv_sec);
- double p_time = stage + (double) frame / fps;
- double ahead = p_time - e_time - 5.0;
- if (ahead > 0.0)
- usleep(ahead * 1000000.0);
-
- nut_write_frame(&writer, frame_buf);
- }
- }
- free(frame_buf);
-
- nut_write_end(&writer);
-
- fflush(stdout);
-
- //fclose(f);
-}*/