Crop bitmap (or setBitmapData)

I have cases in my game where I'd like to draw some sub-rect of an image; for example, a laser image where I'd like to draw it (rotated) but only to a certain length (the length can change each frame).

As far as I can tell the options are:

  • use the mask image for this, but that seems unnecessarily expensive to fill that in and check it while drawing;
  • use the global clip rect, but that doesn't work for my case because I want to rotate the image so there's no screen-aligned rect to clip to;
  • allocate another image of the clipped size and draw the source image into it (again seems expensive).

Would it be possible to add something (to the C API) like setBitmapClipRect, getSubBitmap or even allow me to create a bitmap with my own data/width/height/rowbytes so I could build this myself?

Thanks!