You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Patch for QgsRasterLayer to allow stretching in DrawMultiColorBand, DrawSingleBandGray
With thanks to Pete
git-svn-id: http://svn.osgeo.org/qgis/trunk/qgis@6435 c8812cc2-4d05-0410-92ff-de0c093fc19c
Copy file name to clipboardexpand all lines: src/core/raster/qgsrasterlayer.h
+12
Original file line number
Diff line number
Diff line change
@@ -460,6 +460,7 @@ class CORE_EXPORT QgsRasterLayer : public QgsMapLayer
460
460
* that falls outside the clipping range.*/
461
461
voidsetMinRedDouble(double theDouble)
462
462
{
463
+
userDefinedColorMinMax = true;
463
464
minRedDouble=theDouble;
464
465
};
465
466
/** \brief Accessor for maximum clipping range for red.
@@ -478,6 +479,7 @@ class CORE_EXPORT QgsRasterLayer : public QgsMapLayer
478
479
* that falls outside the clipping range.*/
479
480
voidsetMaxRedDouble(double theDouble)
480
481
{
482
+
userDefinedColorMinMax = true;
481
483
maxRedDouble=theDouble;
482
484
};
483
485
//
@@ -499,6 +501,7 @@ class CORE_EXPORT QgsRasterLayer : public QgsMapLayer
499
501
* that falls outside the clipping range.*/
500
502
voidsetMinGreenDouble(double theDouble)
501
503
{
504
+
userDefinedColorMinMax = true;
502
505
minGreenDouble=theDouble;
503
506
};
504
507
/** \brief Accessor for maximum clipping range for green.
@@ -517,6 +520,7 @@ class CORE_EXPORT QgsRasterLayer : public QgsMapLayer
517
520
* that falls outside the clipping range.*/
518
521
voidsetMaxGreenDouble(double theDouble)
519
522
{
523
+
userDefinedColorMinMax = true;
520
524
maxGreenDouble=theDouble;
521
525
};
522
526
//
@@ -539,6 +543,7 @@ class CORE_EXPORT QgsRasterLayer : public QgsMapLayer
539
543
* that falls outside the clipping range.*/
540
544
voidsetMinBlueDouble(double theDouble)
541
545
{
546
+
userDefinedColorMinMax = true;
542
547
minBlueDouble=theDouble;
543
548
};
544
549
/** \brief Accessor for maximum clipping range for blue.
@@ -557,6 +562,7 @@ class CORE_EXPORT QgsRasterLayer : public QgsMapLayer
557
562
* that falls outside the clipping range.*/
558
563
voidsetMaxBlueDouble(double theDouble)
559
564
{
565
+
userDefinedColorMinMax = true;
560
566
maxBlueDouble=theDouble;
561
567
};
562
568
//
@@ -578,6 +584,7 @@ class CORE_EXPORT QgsRasterLayer : public QgsMapLayer
578
584
* that falls outside the clipping range.*/
579
585
voidsetMinGrayDouble(double theDouble)
580
586
{
587
+
userDefinedGrayMinMax = true;
581
588
minGrayDouble=theDouble;
582
589
};
583
590
/** \brief Accessor for maximum clipping range for gray.
@@ -596,12 +603,14 @@ class CORE_EXPORT QgsRasterLayer : public QgsMapLayer
596
603
* that falls outside the clipping range.*/
597
604
voidsetMaxGrayDouble(double theDouble)
598
605
{
606
+
userDefinedGrayMinMax = true;
599
607
maxGrayDouble=theDouble;
600
608
};
601
609
//
602
610
/** \brief This enumerator describes the types of histogram scaling algorithms that can be used. */
603
611
enum COLOR_SCALING_ALGORITHM
604
612
{
613
+
NO_STRETCH, //this should be the default color scaling algorithm, will allow for the display of images without calling QgsRasterBandStats unless needed
605
614
STRETCH_TO_MINMAX, //linear histogram stretch
606
615
STRETCH_AND_CLIP_TO_MINMAX,
607
616
CLIP_TO_MINMAX
@@ -998,6 +1007,9 @@ public slots:
998
1007
double maxGrayDouble;
999
1008
/** \brief Whether this raster has overviews / pyramids or not */
1000
1009
bool hasPyramidsFlag;
1010
+
//Since QgsRasterBandStats deos not set the minRedDouble maxRedDouble etc., it is benificial to know if the user as set these values. Default = false
1011
+
bool userDefinedColorMinMax;
1012
+
bool userDefinedGrayMinMax;
1001
1013
/** \brief This list holds a series of RasterPyramid structs
1002
1014
* which store infomation for each potential pyramid level for this raster.*/
0 commit comments