From fb2a2fce59f4326829e93c0f14cced8bad3b1089 Mon Sep 17 00:00:00 2001 From: Yingjie Wang Date: Sun, 7 Dec 2025 17:22:50 -0500 Subject: [PATCH] clean: clean and omp --- src/write_png.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/write_png.c b/src/write_png.c index f0c491b..e4fe247 100644 --- a/src/write_png.c +++ b/src/write_png.c @@ -25,6 +25,7 @@ int buffer_normalize_srgb(double *buffer, int W, int H) { max = percentile(buffer, W*H*3, cutperc); printf("max in the buffer: %g\n", max); if (max == 0) return 1; + #pragma omp parallel for for (int j = 0; j < H; j++) { for (int i = 0; i < W; i++) { for (int c = 0; c < 3; c++) { @@ -39,7 +40,7 @@ int buffer_normalize_srgb(double *buffer, int W, int H) { int write_png(char *filename, double *buffer, int W, int H) { buffer_normalize_srgb(buffer, W, H); size_t bufsize = W*H*3; - printf("bufsize: %d\n", bufsize); + //printf("bufsize: %d\n", bufsize); uint8_t *img = (uint8_t *)malloc(bufsize*sizeof(uint8_t)); if (!img) {return 1;}