Created
December 26, 2018 23:04
-
-
Save SubhiH/4ec66fa824682750e9c9d716a322abfa to your computer and use it in GitHub Desktop.
Rotate gray scale image
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
void ImageOperator::rotate(const unsigned char* input, | |
const int width, | |
const int height, | |
const int channel, | |
unsigned char*& output){ | |
unsigned char* tmp = new unsigned char[width*height*channel]; | |
for (int row = 0; row < height; ++row) { | |
for (int col = 0; col < width; col+=1) { | |
tmp[col*width+width-1-row] = input[row*width+col]; | |
} | |
} | |
output = tmp; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment