You are reading a single comment by @Gordon and its replies. Click here to read the full conversation.
  • The 'easily' may be challenged by the really strange pixel order

    It's not a problem at all - just use getPixel and everything is handled behind the scenes for you - it only becomes an issue if you try and access the buffer itself directly.

    Errors

    Sorry, I should have checked my code. It's because Graphics.buffer is a plain (untyped) ArrayBuffer, not a Typed Array. The following should work:

    // save
    new Uint8Array(mCopy.buffer).set(m.buffer);
    // restore
    new Uint8Array(m.buffer).set(mCopy.buffer);
    

    One more thing - you'll probably want to do m.setRotation(1) and mCopy.setRotation(1), or when (if) you do operations on mCopy everything will be 90 degrees out.

About

Avatar for Gordon @Gordon started