RangeLookupTable issue

2 views
Skip to first unread message

andrea antonello

unread,
Oct 15, 2014, 3:42:40 AM10/15/14
to jai-...@googlegroups.com
Hi developers,
I have a problem with the upgrade from jaitools 1.3.0 to 1.3.1.

RangeLookupTable now uses a builder to create the table. What I can't
find though, is the possibility to add a default value as it was in
the past:

/**
* Creates a new table with a default value. The table will allow
* ranges to be added that overlap existing ranges.
* <p>
* If {@code defaultValue} is not {@code null} it will be returned when a
* lookup value cannot be matched; otherwise an unmatched value results in
* an {@code IllegalArgumentException}.
*
* @param defaultValue the default destination value or {@code null} to
* disable the default
*/
public RangeLookupTable(U defaultValue) {
this(defaultValue, true);
}


Anyone knows how this is done now?

Thanks,
Andrea

andrea antonello

unread,
Oct 15, 2014, 3:47:44 AM10/15/14
to jai-...@googlegroups.com
Sorry for the noise,
found it afterwards, it is a parameter:

ParameterBlockJAI pb = new ParameterBlockJAI("RangeLookup");
pb.setSource("source0", inRI);
pb.setParameter("table", table);
pb.setParameter("default", defaultValue);
RenderedImage lookupImg = JAI.create("RangeLookup", pb);


Cheers,
Andrea

Michael Bedward

unread,
Oct 15, 2014, 5:44:38 AM10/15/14
to jai-...@googlegroups.com
Hi Andrea,

Glad you found it. I hope having the default value separate to the
table isn't too clunky.

Michael
> --
> You received this message because you are subscribed to the Google Groups "jai-tools" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to jai-tools+...@googlegroups.com.
> To post to this group, send email to jai-...@googlegroups.com.
> Visit this group at http://groups.google.com/group/jai-tools.
> For more options, visit https://groups.google.com/d/optout.

andrea antonello

unread,
Oct 16, 2014, 2:14:16 AM10/16/14
to jai-...@googlegroups.com
Hi Michael,

> Glad you found it. I hope having the default value separate to the
> table isn't too clunky.

absolutely not, it was just me having been too much time far from this :-)

Thanks,
Andrea
Reply all
Reply to author
Forward
0 new messages