aboutsummaryrefslogtreecommitdiff
path: root/BuddhaTest/src/Helpers.cpp
diff options
context:
space:
mode:
authorAndreas Grois <andi@grois.info>2018-03-10 00:21:15 +0100
committerAndreas Grois <andi@grois.info>2018-03-10 00:21:15 +0100
commitf1a53b120ee5ebfdcd13d178c459188ea8451ee8 (patch)
tree2ec337b0b69b0290a3a6d6fe5b86437612b6d139 /BuddhaTest/src/Helpers.cpp
parent48d275a01baaff68a0c055dd77664b5d0f22d70d (diff)
Forgot symmetry on png export. Added now.
Diffstat (limited to 'BuddhaTest/src/Helpers.cpp')
-rw-r--r--BuddhaTest/src/Helpers.cpp8
1 files changed, 8 insertions, 0 deletions
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");