clean: clean and omp

This commit is contained in:
2025-12-07 17:22:50 -05:00
parent b96381c56e
commit fb2a2fce59

View File

@@ -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;}