From f1a53b120ee5ebfdcd13d178c459188ea8451ee8 Mon Sep 17 00:00:00 2001 From: Andreas Grois Date: Sat, 10 Mar 2018 00:21:15 +0100 Subject: Forgot symmetry on png export. Added now. --- BuddhaTest/src/Helpers.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'BuddhaTest') diff --git a/BuddhaTest/src/Helpers.cpp b/BuddhaTest/src/Helpers.cpp index 69dafa3..cf925be 100644 --- a/BuddhaTest/src/Helpers.cpp +++ b/BuddhaTest/src/Helpers.cpp @@ -166,6 +166,14 @@ namespace Helpers unsigned int col = i - 3*row*width; row_pointers[row][col] = (255*data[i] + (maxValue/2))/maxValue; } + for(int i = 0; i < height/2;++i) + { + for(int j = 0; j < width;++j) + { + png_byte average = (row_pointers[i][j] + row_pointers[height-i-1][j])/2; + row_pointers[i][j] = row_pointers[height-i-1][j] = average; + } + } //beware, this is going to be ugly C syntax, but well, libpng... FILE * fp = fopen("image.png", "wb"); -- cgit v1.2.3