diff options
author | Andreas Grois <andi@grois.info> | 2018-03-10 00:21:15 +0100 |
---|---|---|
committer | Andreas Grois <andi@grois.info> | 2018-03-10 00:21:15 +0100 |
commit | f1a53b120ee5ebfdcd13d178c459188ea8451ee8 (patch) | |
tree | 2ec337b0b69b0290a3a6d6fe5b86437612b6d139 | |
parent | 48d275a01baaff68a0c055dd77664b5d0f22d70d (diff) |
Forgot symmetry on png export. Added now.
-rw-r--r-- | BuddhaTest/src/Helpers.cpp | 8 |
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");
|