[JAI] RenderedOp graphs
I need some guidance on building a reusable graph of RenderedOp nodes.
In this graph I will have "computation" nodes (like the JAI statistics
operators for "extrema" and "histogram") which don't affect their
sources but compute some useful properties. I want to define
other RenderedOp nodes having these computation nodes as sources
and which will use the computed properties when they are rendered.
Construction of the graph might have some code like the following:
thresholdLevelOp = JAI.create("thresholdlevel", src)
// rendering will "threshold" src using the value computed above.
myThresholdOp = JAI.create("mythreshold", thresholdLevelOp);
Later, the user may change parameters on some node. I assume that
invoking getNewRendering() on the node will force re-rendering of
the downstream nodes.
Does anyone have any suggestions for how to implement this sort of thing?
What sort of OpImages should my "computation" image factories create?
I was thinking of extending OpImage much like StatisticsOpImage.
In particular, overriding the getProperty() method to compute
the desired quantities if needed.
Also, I was thinking that immediately downstream nodes would have
image factories that produce extensions of, say, PointOpImage or
UntiledOpImage (or even "computation" OpImages). Then the implementations
of computeRect() or computeImage() (or getProperty()) could invoke
getProperty() on the appropriate source when needed.
Ideas, comments and suggestions will be greatly appreciated. Thanks,