Raster layer opacity
Jonathan Coles
jonathan at jpcoles.com
Wed Mar 23 16:41:44 CET 2005
Hi all,
sorry I disappeared for a couple of months, but I had a little matter of
a master's thesis to attend to. :)
I've just commited changes that allow the opacity of a raster layer to
be changed. Previously, (in anticipation of these changes) a raster
layer had an opacity property but it was not used. I've added a new
control to the layer properties box for raster layers. The level is then
used in MapRenderer.draw_raster_data() to scale the alpha values to the
proper opacity.
I chose to implement the scaling in MapRenderer.draw_raster_data() as
opposed to BaseRenderer.draw_raster_layer() because doing the scaling
late in the rendering process allows for all types of raster layer
formats to be adjusted, not just those that are handled in
BaseRenderer.draw_raster_layer(). This decision, however, required that
I add the layer to the parameter list of
MapRenderer.draw_raster_data().
For a simple demonstration, move the iceland raster layer to the top and
set the opacity to about 128. remember: completely opaque=255,
completely transparent=0.
Here'a question: Is opacity a property of all layers or just raster
layers? perhaps we can't support opacity in vectors layers just yet, but
should that mean we shouldn't anticipate it? If opacity is a property of
all layers then I can refactor the opacity methods in RasterLayer into
BaseLayer.
--jonathan
--
=====================================================================
Jonathan Coles http://www.jpcoles.com
jonathan at jpcoles.com GnuPG Key: /gpg_pub_key.asc
=====================================================================
More information about the Thuban-devel
mailing list
This site is hosted by Intevation GmbH (Datenschutzerklärung und Impressum | Privacy Policy and Imprint)