I'm thinking complete new array, an inplace rotate give me brain fade
for row = 0 to 7
for column = 0 to 7
for element = 0 to 2
new_pixel[column*(7-row)+row*(7-column)+element]= pixel[row*8+column*3+element ]
next
next
next
I'm thinking complete new array, an inplace rotate give me brain fade
for row = 0 to 7
for column = 0 to 7
for element = 0 to 2
new_pixel[column*(7-row)+row*(7-column)+element]= pixel[row*8+column*3+element ]
next
next
next
the penny dropped its a 24 byte wide row , had 8x8 burnt into brain
for row = 0 to 7
for column = 0 to 7
for element = 0 to 2
new_pixel[3*(7-row)+24*column+element]= pixel[row*24+column*3+element ]
next
next
next
its so easy when you know how
to go ccw
for row = 0 to 7
for column = 0 to 7
for element = 0 to 2
new_pixel[3*(row)+24*(7-column)+element]= pixel[row*24+column*3+element ]
next
next
next
Hi Richard, did you mean rotating 2D 90 degrees each time you call the function?
If so I wish I’d looked a this. It's in my display code, Tetris has to do itI used a lookup table for block rotation,
but rotated digits for vertical orientation.
its a 2d 8x8 matrix each element is 24 bits (rgb) the lot rotate 90 deg with each call . the cw and ccw both work flawlessly and are fairly quick too .
a 45 deg rotate would be interesting.
At 8x8 resolution, as you get away from even 90 deg angles, it looks horrible.
Bookmarks