Is there a way to take a view on a 2D matrix, and do things like translate the indices, or even rotate the view? Say, something like this.
using ColorTypes, ImageView x = zeros(RGBA, 1000, 1000) v = view(x, 400:600, 400:600) #view to a square in the middle rotate!(v, pi/3) #rotate the view indices 60º translate!(v, (100, -10)) #translate the view indices in x by +100, y by -1 v .= RGBA(1.0, 0.0, 0.0, 1.0) #set the elements in the view to red display(x) #shows a transparent image with a red square to the #right and bottom of center, that's rotated by 60º
Rotation would require going for the nearest indices per element.