Feature request #537
Patch for QgsRasterLayer to allow stretching in DrawMultiColorBand, DrawSingleBandGray
|Pull Request or Patch supplied:||Resolution:||fixed|
|Easy fix?:||No||Copied to github as #:||10596|
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.
#1 Updated by Tim Sutton over 14 years ago
- Resolution set to fixed
- Status changed from Open to Closed
Committed in trunk with fe3c509c (SVN r6436) - 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.