0
Good afternoon, I have a color image in an array 1D, for example:
int[] image = {255, 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 255, 0, 255, 0, 255, 0, 0};
This array has 6 pixels, red, green, blue, blue, green, red, imagining that these pixels are positioned horizontally:
| Vermelho | Verde | Azul |
| Azul | Verde | Vermelho |
How I could rotate this image so that the pixel layout becomes vertical:
| Azul | Vermelho |
| Verde | Verde |
| Vermelho | Azul |
I want to place this rotated array in another 1D array.
The difference is. Only when retrieving or printing values does the array continue in the same way
– Rovann Linhalis
You want to distribute each color group in indices with 3 difference, that’s it?
– user28595
Sorry, maybe I have expressed, badly, I need to insert this new image in a new array 1D, for an image that contains only 3 pixels will really only change in the part of saving the file, but when it involves more lines, then it is necessary to change this data. I improved the example, maybe it’s clearer. Abrass
– Dan Lucio Prada