Directly in CVS? (Re: raster layer properties and mask patches)
Jonathan Coles
jonathan at jpcoles.com
Thu Jan 27 19:31:05 CET 2005
Am Donnerstag, den 27.01.2005, 18:56 +0100 schrieb Bernhard Herzog:
> It shouldn't require much more memory. Just about 1 byte per pixel of
> the canvas window. That's almost negligible considering that several
> bytes per pixel are already required without the alpha channel.
ideally, yes, you are right. however, wxBitmap.SetMask() wants a wxMask
object. to create a wxMask object you need a wxBitmap. To create a
wxBitmap i call wxBitmapFromImage. To create a wxImage object, the data
has to be RGB triples (this is how it is stored internally, regardless
of whether it is considered a monobitmap or not). so the data i return
for the alpha channel is 3 times what it really needs to be (where
R=G=B), but that's because of how wx handles its images.
i could try returning the alpha data in a different format (e.g. XPM or
something). that might be able to convert directly to a wxBitmap without
first being stored as a wxImage.
> How much slower is the rendering with the alpha channel? My impression
> with the iceland data is that the difference isn't much. It takes maybe
> 25% longer (tested with a session with several instances of the image).
> I'd say, the mask should always be on without a way of switching it off.
> The little speed gain isn't worth the complication in the code and the
> file format.
i don't have any numbers, but if you say it takes about 25% longer, then
even that makes me wary. some people may want it to render faster. i've
just changed the default to be on, and the flag is only saved if the
user sets it to off. in the case that you are arguing, where people
won't change it, the saved file won't be affected.
> If we save it into the .thuban file, we have to support it in future
> versions of Thuban. I don't want that to happen for settings that
> aren't really necessary.
i disagree that it's not necessary, but if everyone agrees that they
don't want it, i'll take it out and make the mask manditory.
btw, from russell's post, he discovered that alpha support is only
available with gdal >= 1.2.4. what version are we supporting and should
i make some changes so that *only if* alpha band support is available it
is used?
--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)