function rotateClockwise(buffer) {
  var w = buffer.height;
  var h = buffer.width;
  var w2 = Math.floor(w / 2);
  var h2 = Math.floor(h / 2);
  return makeBuffer(w, h, function(context) {
    context.translate(w2, h2);
    context.rotate(Math.PI / 2);
    context.drawImage(buffer, -h2, -w2);
  });
}
function rotateClockwise(buffer) {
  var w = buffer.height;
  var h = buffer.width;
  var w2 = Math.floor(w / 2);
  var h2 = Math.floor(h / 2);
  return makeBuffer(w, h, function(context) {
    context.translate(w2, h2);
    context.rotate(Math.PI / 2);
    context.drawImage(buffer, -h2, -w2);
  });
}
function rotateClockwise ( buffer ) { var w = buffer . height ; var h = buffer . width ; var w2 = Math . floor ( w / 2 ) ; var h2 = Math . floor ( h / 2 ) ; return makeBuffer ( w , h , function ( context ) { context . translate ( w2 , h2 ) ; context . rotate ( Math . PI / 2 ) ; context . drawImage ( buffer , - h2 , - w2 ) ; } ) ; }
Make a copy of a buffer that is rotated 90 degrees clockwise.
@param {external:canvas|external:image} buffer The original image
@return {external:canvas} The rotated buffer
Make a copy of a buffer that is rotated 90 degrees clockwise .