Skip to main content

[JAI] RenderedOp graphs

1 reply [Last post]
Anonymous

Greetings,

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,

Fritz

---------------------------------------------------------------------
To unsubscribe, e-mail: interest-unsubscribe@jai.dev.java.net
For additional commands, e-mail: interest-help@jai.dev.java.net

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
Brian Burkhalter

On Tue, 19 Apr 2005, Fritz Cathey wrote:

> 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.

Whenever one or more parameters are changed on a RenderedOp a
RenderingChangeEvent will be emitted thereby causing the recomputation of the
affect region of downstream nodes. If more than one parameter is being changed
it is therefore preferable to change the entire ParameterBlock.

> 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.

That would work. You might also consider just having the op be a placeholder
which uses a PropertyGenerator to compute the properties. In that case an
OpImage might not even be 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.

Or you could have the operation parameter passed as a DeferredProperty object.

Brian

----------------
Brian Burkhalter
Advanced Development, Graphics and Media
Software Chief Technology Office
Sun Microsystems, Inc.

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
This email message is for the sole use of the intended recipient(s)
and may contain confidential and privileged information. Any
unauthorized review, use, disclosure or distribution is prohibited.
If you are not the intended recipient, please contact the sender by
reply email and destroy all copies of the original message.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

---------------------------------------------------------------------
To unsubscribe, e-mail: interest-unsubscribe@jai.dev.java.net
For additional commands, e-mail: interest-help@jai.dev.java.net