[Qgis-developer] patch for qgsrasterlayer.cpp

Peter Ersts ersts at amnh.org
Tue Oct 2 10:17:53 EDT 2007


Marco,

This looks good. There are a number these places where computations like 
this can be pulled out of loops to speed things up.

I will make sure these mods get into the raster branch.

-pete

Tim Sutton wrote:
> Hi Marco
>
> Thanks! There are actually many places we can optimise things. For one
> when we have a separate renderer class for each renderer type, we can
> avoid a lot of switches...
>
> Peter is now 'Raster Master' so I will defer the patch to him (if
> thats ok Peter?).
>
> Regards
>
> Tim
>
> 2007/9/28, Marco Hugentobler <marco.hugentobler at karto.baug.ethz.ch>:
>   
>> Hi Peter and Tim,
>>
>> While sitting in the train, I plaied a bit around with the methods
>> QgsRasterLayer::drawPallettedMultiBandColor and
>> QgsRasterLayer::drawMultiBandColor. I think that some multiplications and
>> comparison in the inner loop, which is executed appr. 800000 times during
>> each redraw, can be avoided or moved outside the loop. Especially,
>> QgsRasterLayer::drawPallettedMultiBandColor was much faster on my PC
>> afterwards.
>>
>> Attached the patch. Please review and test, if I didn't break any existing
>> functionality.
>>
>> Regards,
>> Marco
>>
>>
>>
>> --
>> Dr. Marco Hugentobler
>> Institute of Cartography
>> ETH Zurich
>> Technical Advisor QGIS Project Steering Committee
>> marco.hugentobler at karto.baug.ethz.ch
>>
>>
>>     
>
>
>   


-- 
====================================
Peter J. Ersts, Project Specialist
American Museum of Natural History
Center for Biodiversity and Conservation
Central Park West at 79th Street
New York, New York 10024
Tel: (212)-496-3488 or (212)-769-5742
Fax: (212)-313-7295 or (212)-769-5292
Web: http://cbc.amnh.org
Web: http://geospatial.amnh.org

Open Source, Open Mind.
...evolving through community cooperation to change the world bit by bit





More information about the Qgis-developer mailing list