I am working on creating a linear gradient, and writing pixels into an image from left to right. I have this working well.
Now, I need to be able to generate the gradient based on an angle. I was thinking I could basically create the linear gradient, and the rotate based on the angle, and crop (since Ill need to fill a larger area when I rotate).
Looking of ofPixels, there are methods to rotate by 90 degrees, but not arbitrary angles. So, my question is, what is the best approach for rotating ofPixels (or ofImage) by an arbitrary angle, and then copying / cropping a region of those pixels.
Basically like the attached image.
(I realize a better solution might be to just have my algorithm draw at an arbitrary angle, but I want to see if I can get this approach working first).