#537 closed patch (fixed)
Patch for QgsRasterLayer to allow stretching in DrawMultiColorBand, DrawSingleBandGray
Reported by: | Owned by: | timlinux | |
---|---|---|---|
Priority: | major: does not work as expected | Milestone: | |
Component: | Rasters | Version: | Trunk |
Keywords: | stretch | Cc: | |
Must Fix for Release: | No | Platform: | Debian |
Platform Version: | Kubuntu 6.10 | Awaiting user input: | no |
Description
QgsRasterLayer has methods and enums for some basic stretching capabilities, but these capabilities are not implemented in the draw methods. This patch adds some functionality to the QgsRasterLayer::drawMultiBandColor and QgsRasterLayer::drawSingleBandGray methods. While the current QGIS GUI does not allow the user to set the needed inputs, stretching can, in the mean time, be done through a plugin.
The implementation in this patch adds a NO_STRETCH entry to the COLOR_STRETCH_ALGORITHM enum. This enum is set as the default scaling algorithm. This is done so that images can be loaded without QgsRasterLayerStats beign called unless needed. The two updated methods can also use the value of stdDevsToPlot to automatically stretch the image (which means QgsRasterStats is caled) if the color stretch algorithms is set, which means that with a few simple modifications to the QgsRasterProperties window, simple stretching could be made available to QGIS users.
Attachments (1)
Change History (3)
by , 17 years ago
Attachment: | patch_for_QgsRasterLayer.txt added |
---|
comment:1 by , 17 years ago
Milestone: | Version 0.8.1 Release → Version 0.9 Release |
---|---|
Resolution: | → fixed |
Status: | new → closed |
Committed in trunk with r6435 - many thanks. Do you need this in 0.8.1 too? I prefer not to add new stuff to 0.8 branch but only things that fix existing bugs. If you really need it plugged into 0.8.1 please discuss with me further.
Regards
Tim
Text File containing patch for QgsRasterLayer