[Marble-devel] TextureColorizer Patch to generate palette at runtime

Torsten Rahn torsten.rahn at credativ.de
Mon Feb 11 13:47:47 CET 2008


On Monday 11 February 2008 02:06:25 Ismael Asensio wrote:
> rotten C++ skills, so here is a patch for the junior job you suggested
> about generate texturepalette at runtime. It seems to work, and the
> timedemo doesn't show a down in performance, but you'll say the last word.

Yes, I've reviewed and tested it and it works nicely. Thanks a lot for your 
help! I added some section to the data/CMakeLists.txt file so that 
the .leg-files get installed as well. I've committed your patch to SVN:

http://lists.kde.org/?l=kde-commits&m=120273293806406&w=2

Here's a small suggestion for a micro-optimization:

Setting the pen and the brush of QPainter several times should be avoided as 
much as possible as Qt is quite slow at changing pens and brushes. 

So setting a painter to the same brush or pen over and over should be avoided, 
as well if possible. I think we do this inside those for loops and it would 
be nice if you could figure out those redundant setters that we only set the 
painter once where possible. Could you try to fix that? :-)

Another thing:

It's nice that we are able to set the palettes for land and see now. 

However we plan to have temperature maps and precipitation maps in Marble 
which are based on grayscale maps. For these kind of maps we don't really 
want to take care of the coastline when colorizing as it doesn't make sense 
in this case.

So we need a second alternative mode (maybe using an enum?) for 
TextureColorizer which doesn't use two palettes but just a single palette. 
And of course in that mode Marble shouldn't use the coastlines while doing 
the colorization. 

Ismael, do you think you can refine the TextureColorization class (and related 
classes) to add that feature where we can easily add that mode which let's 
the TextureColorizer switch between single-leg-file mode (with coastlines 
being ignored) and two-leg-files mode (with coastlines being honored)? 
Of course you'd need to add setters and getters to switch between those modes.

Best Regards,

Torsten



   


> I've just got into the mailing list, so maybe it's a bit late for the patch
> and somebody has also send a nicer one :)
> Otherwise, I'm looking forward for a replay.
>
> Ciao!



-- 
 Torsten Rahn

 Tel.: 0 21 61 - 46 43 - 192

credativ GmbH, HRB Mönchengladbach 12080
Hohenzollernstr. 133, 41061 Mönchengladbach
Geschäftsführung: Dr. Michael Meskes, Jörg Folz


More information about the Marble-devel mailing list