title: Rotate a bitmap represented by an array of bytes
body: <p>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 <code>┘</code> defined as:</p>
  
  <pre><code>uint8_t rows[8] = {
      0b00000001,
      0b00000001,
      0b00000001,
      0b00000001,
      0b00000001,
      0b00000001,
      0b00000001,
      0b11111111
  };
  </code></pre>
  
  <p>I want to "rotate" this anticlockwise to get <code>┐</code> as:</p>
  
  <pre><code>uint8_t rows2[8] = {
      0b11111111,
      0b00000001,
      0b00000001,
      0b00000001,
      0b00000001,
      0b00000001,
      0b00000001,
      0b00000001
  };
  </code></pre>
  
  <p>Or this if done clockwise, <code>└</code>:</p>
  
  <pre><code>uint8_t rows3[8] = {
      0b10000000,
      0b10000000,
      0b10000000,
      0b10000000,
      0b10000000,
      0b10000000,
      0b10000000,
      0b11111111
  };
  </code></pre>
  
  <p>How do I do this in straight C?</p>