title: Rotate image by 90, 180 or 270 degrees
body: <p>I need to rotate an image by either 90, 180 or 270 degrees.  In OpenCV4Android I can use:</p>
  
  <pre><code>Imgproc.getRotationMatrix2D(new Point(center, center), degrees, 1);
  Imgproc.warpAffine(src, dst, rotationMatrix, dst.size());
  </code></pre>
  
  <p>However, this is a huge bottleneck in my image processing algorithm.  Of course, a simple rotation by a multiple of 90 degrees is much simpler than the most general case of <code>warpAffine</code>, and can be done much more efficiently.  For 180 degrees, for instance, I could use:</p>
  
  <pre><code>Core.flip(src, dst, -1);
  </code></pre>
  
  <p>where -1 means to flip about both horizontal and vertical axes.  Is there a similar optimization I could use for 90 or 270 degree rotations?</p>