How to set the transparent color on an ImagePyramidReader or ImageMosaicReader

1 message Options
Embed this post
Permalink
Stefan Tzeggai

How to set the transparent color on an ImagePyramidReader or ImageMosaicReader

Reply Threaded More More options
Print post
Permalink
Hi

When i create an ImagePyramidReader or am ImageMosaicReader with parameters
sourceURL and Hints, how to i set/change the transparent input color
programatically? Before or after the constuction.. i just can't find a way.

> Hints hints = new Hints();
>     reader = new ImagePyramidReader(theURL, hints);

I have tried to follow the hints through the process, but i don't get it how a
Hint given to the ImagePyramidReader can end up as a GeneralParameterValue in
calls to
> public GridCoverage read(GeneralParameterValue[] params) throws IOException
>{

because it looks like the readParams are just set once in the setInfo() method
of the *Format:

>        // reading parameters
>        readParameters = new ParameterGroup(new
> DefaultParameterDescriptorGroup(mInfo, new GeneralParameterDescriptor[]{
>         READ_GRIDGEOMETRY2D,
>         INPUT_TRANSPARENT_COLOR,
>                INPUT_IMAGE_THRESHOLD_VALUE,
>                OUTPUT_TRANSPARENT_COLOR,
>                USE_JAI_IMAGEREAD,
>                BACKGROUND_VALUES,
>                SUGGESTED_TILE_SIZE,
>                ALLOW_MULTITHREADING,
>                MAX_ALLOWED_TILES}));

I thought about overwriting the setInfo() method in ImageMosaicFormat, but it
is a final class.

Personally i have just added a setInputTransparentColor(Color c) method to the
ImageMosaicReader and ImagePyramidReader classes, but as i am preparing a
patch for better URL handling
( http://jira.codehaus.org/browse/GEOT-2695 ) i want to do it the GT way as
much as possible.

Greetings,
Steve


------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day
trial. Simplify your report design, integration and deployment - and focus on
what you do best, core application coding. Discover what's new with
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
Geotools-gt2-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users
My last name will change from Krüger to Tzeggai in mid 2010.