[QGIS-trac] Re: [Quantum GIS] #1533: WMS raster transparency problem

Quantum GIS qgis at qgis.org
Mon Feb 9 22:54:28 EST 2009


#1533: WMS raster transparency problem
----------------------------------------------------+-----------------------
        Reporter:  jctull                           |         Owner:  ersts                          
            Type:  bug                              |        Status:  assigned                       
        Priority:  minor: annoyance or enhancement  |     Milestone:  Version 1.0.1                  
       Component:  MapCanvas                        |       Version:  HEAD                           
      Resolution:                                   |      Keywords:  wms raster transparency refresh
Platform_version:  10.5.6                           |      Platform:  OS X                           
        Must_fix:  Yes                              |   Status_info:  0                              
----------------------------------------------------+-----------------------
Comment (by ersts):

 I think it is more just that setAlphaChannel() does not work quite a
 expected. When you use that method it changes the image format to
 QImage::Format_ARGB32_Premultiplied

 {{{
 The image is stored using a premultiplied 32-bit [[BR]]
 ARGB format (0xAARRGGBB), i.e. the red, green,[[BR]]
 and blue channels are multiplied by the alpha component [[BR]]
 divided by 255. (If RR, GG, or BB has a[[BR]]
 higher value than the alpha channel, the results [[BR]]
 are undefined.) Certain operations (such as [[BR]]
 image composition using alpha blending) are faster [[BR]]
 using premultiplied ARGB32 than with plain ARGB32.
 }}}

 So I changed it around a little have had the WMS Provider store a
 QImage::Format_ARGB32 then just adjusted the pixel values on each refresh.
 WMS images should be small enough to not see any performance hit.

 The mods were made to the trunk r:10146. If you can take it for a spin and
 make sure it works more as expected. If it does I will close the ticket
 and add it to the Version-1_0 branch for inclusion in the next release.

-- 
Ticket URL: <http://trac.osgeo.org/qgis/ticket/1533#comment:4>
Quantum GIS <http://qgis.org>
Quantum GIS is an Open Source GIS viewer/editor supporting OGR, PostGIS, and GRASS formats


More information about the QGIS-trac mailing list