Rotate a bitmap represented by an array of bytes
问题 In an AVR, I'm using an array of eight bytes to store a picture displayed on an 8x8 LED matrix. The picture needs to be rotated from time to time. So, given the picture ┘ defined as: uint8_t rows[8] = { 0b00000001, 0b00000001, 0b00000001, 0b00000001, 0b00000001, 0b00000001, 0b00000001, 0b11111111 }; I want to "rotate" this anticlockwise to get ┐ as: uint8_t rows2[8] = { 0b11111111, 0b00000001, 0b00000001, 0b00000001, 0b00000001, 0b00000001, 0b00000001, 0b00000001 }; Or this if done clockwise,