Hi everyone!
I want to achieve the following:
I need to cut out an arbitrarily rotated rectangular area of undefined size of an image, then scale it to a predefined size in pixels.
Reading in this document from sun
http://dlc.sun.com/pdf/806-5413-10/806-5413-10.pdf I figured, since I need to do this more than once, was to set up a tool chain, that does the following things:
(1) rotate the input image.
(2) crop the rectangular region out.
(3) translate the rectangular region, so it's origin is at (0,0) again.
(4) scale the rectangular region to the predefined square size.
The idea was, that once this processing chain was set up, I merely had to adjust the parameters of the region and the source image, then start sucking through pixels.
Here's what I ended up with as code:
Once I'd need pixels for a specific Image and Ellipse (This defines the dimensions and the angle of the cut out rectangle) I would just set the source Image and the new parameters and start grabbing pixels. This however fails on instantiation, telling me I have null parameters for for most of the JAI.cretaeRenderable() calls, that the crop operation cannot crop outisde the image and such.
What I first intended, was to set up the entire RenderableOp Graph with an empty constructor, and then set the variables needed to suck pixels through.
I then tried adding a non-empty constructor, since the were null pointers.
What is it I'm not getting?
Is the thing I want feasible with JAI anyway?