Opened 17 years ago

Closed 17 years ago

Last modified 15 years ago

#537 closed patch (fixed)

Patch for QgsRasterLayer to allow stretching in DrawMultiColorBand, DrawSingleBandGray

Reported by: ersts@… 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)

patch_for_QgsRasterLayer.txt (14.3 KB ) - added by ersts@… 17 years ago.
Text File containing patch for QgsRasterLayer

Download all attachments as: .zip

Change History (3)

by ersts@…, 17 years ago

Text File containing patch for QgsRasterLayer

comment:1 by timlinux, 17 years ago

Milestone: Version 0.8.1 ReleaseVersion 0.9 Release
Resolution: fixed
Status: newclosed

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

comment:2 by (none), 15 years ago

Milestone: Version 0.9

Milestone Version 0.9 deleted

Note: See TracTickets for help on using tickets.