I have a vector of RGB data.
vector<int> image({1,1,1, 2,2,2, 3,3,3 , 4,4,4});
I want to flip this image horizontally (about the center column).
to perform flip operation, I have created a function
flip(void* image, int rows, int cols)
where i would like to perform flip, but keep individual triplets of RGB intact
So I created a
struct color{
char r;
char g;
char b;
};
and calling the function as
int main(){
vector<int> image({1,1,1, 2,2,2, 3,3,3 , 4,4,4});
flip(&image[0],rows,cols);
}
but casting void* to struct color[] raises compilation error. How can I proceed around this ?