[mapguide-users] transparency and gdal again
Traian Stanev
traian.stanev at autodesk.com
Thu Feb 22 11:36:25 EST 2007
Aaaaah, yes. For 8 bit palleted, the MapGuide code explicitly sets alpha
to 255 after getting the color from the palette. Here is the unfortunate
line of code:
for (int i=0; i<w; i++) *dstptr++ = 0xff000000 | ((int*)palette)[*px++];
If I remember correctly, I did this to work around a problem with
palettes coming from the Autodesk.Raster provider having alpha set to 0
in the palette when it should have been 255.
It makes sense now.
Traian
-----Original Message-----
From: mapguide-users-bounces at lists.osgeo.org
[mailto:mapguide-users-bounces at lists.osgeo.org] On Behalf Of Frank
Warmerdam (External)
Sent: Thursday, February 22, 2007 10:55 AM
To: MapGuide Users Mail List
Subject: Re: [mapguide-users] transparency and gdal again
Traian Stanev wrote:
> For bitonal rasters, MapGuide takes the foreground and background
colors
> as set by Studio directly without modification. So if the background
> color is set to transparent, it should really look transparent in the
> viewer.
>
> However, if the provider is not returning a 1-bpp raster and instead
is
> using some other color format, then the colors set in Studio will not
be
> used since the code will assume that the raster is not bitonal.
Traian,
Note that GDAL promotes 1bit TIFF rasters to being 8bit paletted images
with
0 and 1 set to black and white (or err, white and black?). So if there
is special logic for 1bit foreground/background color it won't have any
effect
when using the gdal provider.
Best regards,
--
---------------------------------------+--------------------------------
------
I set the clouds in motion - turn up | Frank Warmerdam,
warmerdam at pobox.com
light and sound - activate the windows | http://pobox.com/~warmerdam
and watch the world go round - Rush | President OSGeo,
http://osgeo.org
_______________________________________________
mapguide-users mailing list
mapguide-users at lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/mapguide-users
More information about the mapguide-users
mailing list