Skip to content
Permalink
Browse files

Resolved merge conflicts

  • Loading branch information
timlinux committed Jun 14, 2012
2 parents dba6ba4 + 966c5c1 commit f3f1c4378e1067a5a455f880669dc2a119f8348b
Showing with 6,688 additions and 5,359 deletions.
  1. +2 −2 CMakeLists.txt
  2. +9 −8 debian/changelog
  3. +2 −0 python/core/core.sip
  4. +4 −0 python/core/qgsrasterlayer.sip
  5. +1 −1 src/app/CMakeLists.txt
  6. +95 −45 src/app/qgisapp.cpp
  7. +7 −0 src/app/qgisapp.h
  8. +533 −1,937 src/app/qgsrasterlayerproperties.cpp
  9. +4 −58 src/app/qgsrasterlayerproperties.h
  10. +10 −0 src/core/CMakeLists.txt
  11. +1 −1 src/core/qgsmaplayer.h
  12. +308 −0 src/core/qgsprojectfiletransform.cpp
  13. +9 −0 src/core/qgsprojectfiletransform.h
  14. +3 −0 src/core/qgsrasterprojector.h
  15. +33 −0 src/core/raster/qgsbilinearrasterresampler.cpp
  16. +34 −0 src/core/raster/qgsbilinearrasterresampler.h
  17. +9 −0 src/core/raster/qgscolorrampshader.cpp
  18. +3 −1 src/core/raster/qgscolorrampshader.h
  19. +42 −0 src/core/raster/qgscontrastenhancement.cpp
  20. +6 −0 src/core/raster/qgscontrastenhancement.h
  21. +456 −0 src/core/raster/qgscubicrasterresampler.cpp
  22. +66 −0 src/core/raster/qgscubicrasterresampler.h
  23. +353 −0 src/core/raster/qgsmultibandcolorrenderer.cpp
  24. +70 −0 src/core/raster/qgsmultibandcolorrenderer.h
  25. +219 −0 src/core/raster/qgspalettedrasterrenderer.cpp
  26. +53 −0 src/core/raster/qgspalettedrasterrenderer.h
  27. +309 −1,830 src/core/raster/qgsrasterlayer.cpp
  28. +16 −61 src/core/raster/qgsrasterlayer.h
  29. +385 −0 src/core/raster/qgsrasterrenderer.cpp
  30. +185 −0 src/core/raster/qgsrasterrenderer.h
  31. +107 −0 src/core/raster/qgsrasterrendererregistry.cpp
  32. +64 −0 src/core/raster/qgsrasterrendererregistry.h
  33. +33 −0 src/core/raster/qgsrasterresampler.h
  34. +61 −1 src/core/raster/qgsrastershader.cpp
  35. +8 −0 src/core/raster/qgsrastershader.h
  36. +5 −0 src/core/raster/qgsrastershaderfunction.h
  37. +91 −1 src/core/raster/qgsrastertransparency.cpp
  38. +11 −0 src/core/raster/qgsrastertransparency.h
  39. +112 −0 src/core/raster/qgssinglebandcolordatarenderer.cpp
  40. +41 −0 src/core/raster/qgssinglebandcolordatarenderer.h
  41. +201 −0 src/core/raster/qgssinglebandgrayrenderer.cpp
  42. +51 −0 src/core/raster/qgssinglebandgrayrenderer.h
  43. +193 −0 src/core/raster/qgssinglebandpseudocolorrenderer.cpp
  44. +51 −0 src/core/raster/qgssinglebandpseudocolorrenderer.h
  45. +11 −0 src/gui/CMakeLists.txt
  46. +1 −1 src/gui/qgsexpressionbuilderwidget.cpp
  47. +263 −0 src/gui/raster/qgsmultibandcolorrendererwidget.cpp
  48. +55 −0 src/gui/raster/qgsmultibandcolorrendererwidget.h
  49. +106 −0 src/gui/raster/qgspalettedrendererwidget.cpp
  50. +43 −0 src/gui/raster/qgspalettedrendererwidget.h
  51. +41 −0 src/gui/raster/qgsrasterrendererwidget.h
  52. +140 −0 src/gui/raster/qgssinglebandgrayrendererwidget.cpp
  53. +41 −0 src/gui/raster/qgssinglebandgrayrendererwidget.h
  54. +486 −0 src/gui/raster/qgssinglebandpseudocolorrendererwidget.cpp
  55. +52 −0 src/gui/raster/qgssinglebandpseudocolorrendererwidget.h
  56. +385 −0 src/ui/qgsmultibandcolorrendererwidgetbase.ui
  57. +55 −0 src/ui/qgspalettedrendererwidgetbase.ui
  58. +412 −1,411 src/ui/qgsrasterlayerpropertiesbase.ui
  59. +148 −0 src/ui/qgssinglebandgrayrendererwidgetbase.ui
  60. +192 −0 src/ui/qgssinglebandpseudocolorrendererwidgetbase.ui
  61. +1 −1 tests/src/core/regression992.cpp
@@ -1,8 +1,8 @@
SET(CPACK_PACKAGE_VERSION_MAJOR "1")
SET(CPACK_PACKAGE_VERSION_MINOR "9")
SET(CPACK_PACKAGE_VERSION_PATCH "9")
SET(CPACK_PACKAGE_VERSION_PATCH "0")
SET(COMPLETE_VERSION ${CPACK_PACKAGE_VERSION_MAJOR}.${CPACK_PACKAGE_VERSION_MINOR}.${CPACK_PACKAGE_VERSION_PATCH})
SET(RELEASE_NAME "Master")
SET(RELEASE_NAME "Lisboa")
SET(PROJECT_VERSION ${COMPLETE_VERSION})
PROJECT(qgis${PROJECT_VERSION})
IF (APPLE)
@@ -1,6 +1,12 @@
qgis (1.9.90) UNRELEASED; urgency=low
qgis (1.9.0) UNRELEASED; urgency=low

* new development version 1.9.90 after branch of 1.8.0
* new development version 1.9 after branch of 1.8

-- Jürgen E. Fischer <jef@norbit.de> Thu, 14 Jun 2012 10:56:27 +0200

qgis (1.8.0) UNRELEASED; urgency=low

* new development version 1.8 after branch
* include function help in package
* include heatmap plugin
* drop extra include path for QtWebkit on oneiric and natty
@@ -13,11 +19,6 @@ qgis (1.9.90) UNRELEASED; urgency=low
* copyright & policy update (synced from debiangis)
* run crssync in postinst
* run tests with xvfb and upload to results to (c)dashboard

-- Jürgen E. Fischer <jef@norbit.de> Wed, 18 Apr 2012 20:50:12 +0200

qgis (1.8.0) UNRELEASED; urgency=low

* new development version 1.8 after branch
* add qgis browser (qbrowser)
* add zonal statistics plugins and globe plugin
@@ -30,7 +31,7 @@ qgis (1.8.0) UNRELEASED; urgency=low
* build package with libspatialindex where available
* drop wfsplugin & displaceplugin

-- Jürgen E. Fischer <jef@norbit.de> Fri, 28 Oct 2011 08:52:45 +0200
-- Jürgen E. Fischer <jef@norbit.de> Thu, 14 Jun 2012 10:56:27 +0200

qgis (1.7.0) UNRELEASED; urgency=low

@@ -62,6 +62,8 @@
%Include qgsrasterdataprovider.sip
%Include qgsrasterlayer.sip
%Include qgsrasterpyramid.sip
%Include qgsrasterrenderer.sip
%Include qgsrasterresampler.sip
%Include qgsrastershader.sip
%Include qgsrastershaderfunction.sip
%Include qgsrastertransparency.sip
@@ -222,6 +222,10 @@ public:
/** \brief Mutator for mUserDefinedRGBMinimumMaximum */
void setUserDefinedRGBMinimumMaximum( bool theBool );

/**Set raster renderer. Takes ownership of the renderer object*/
void setRenderer( QgsRasterRenderer* renderer );
QgsRasterRenderer* renderer();

/** \brief Accessor to find out how many standard deviations are being plotted */
double standardDeviations() const;

@@ -394,7 +394,7 @@ INCLUDE_DIRECTORIES(
../core
../core/gps ../core/gps/qextserialport
../core/composer ../core/raster ../core/renderer ../core/symbology ../core/symbology-ng
../gui ../gui/symbology-ng ../gui/attributetable
../gui ../gui/symbology-ng ../gui/attributetable ../gui/raster
../plugins
../python
gps
@@ -139,6 +139,7 @@
#include "qgsmessageviewer.h"
#include "qgsmimedatautils.h"
#include "qgsmessagelog.h"
#include "qgsmultibandcolorrenderer.h"
#include "qgsnewvectorlayerdialog.h"
#include "qgsoptions.h"
#include "qgspastetransformations.h"
@@ -158,10 +159,12 @@
#include "qgsrastercalcdialog.h"
#include "qgsrasterlayer.h"
#include "qgsrasterlayerproperties.h"
#include "qgsrasterrenderer.h"
#include "qgsrectangle.h"
#include "qgsrenderer.h"
#include "qgsscalecombobox.h"
#include "qgsshortcutsmanager.h"
#include "qgssinglebandgrayrenderer.h"
#include "qgssnappingdialog.h"
#include "qgssponsors.h"
#include "qgstextannotationitem.h"
@@ -5097,6 +5100,11 @@ void QgisApp::options()
}

void QgisApp::fullHistogramStretch()
{
histogramStretch( false );
}

void QgisApp::histogramStretch( bool visibleAreaOnly )
{
QgsMapLayer * layer = mMapLegend->currentLayer();

@@ -5116,76 +5124,118 @@ void QgisApp::fullHistogramStretch()
tr( "To perform a full histogram stretch, you need to have a raster layer selected." ) );
return;
}
if ( rlayer->providerType() == "wms" )

QgsRasterDataProvider* provider = rlayer->dataProvider();
if ( !provider )
{
return;
}
if ( rlayer->drawingStyle() == QgsRasterLayer::SingleBandGray ||
rlayer->drawingStyle() == QgsRasterLayer::MultiBandSingleBandGray ||
rlayer->drawingStyle() == QgsRasterLayer::MultiBandColor
)

//get renderer
QgsRasterRenderer* renderer = rlayer->renderer();
if ( !renderer )
{
rlayer->setContrastEnhancementAlgorithm( "StretchToMinimumMaximum" );
rlayer->setMinimumMaximumUsingDataset();
rlayer->setCacheImage( NULL );
//refreshLayerSymbology( rlayer->getLayerID() );
mMapCanvas->refresh();
return;
}

//singleband gray <-> multiband color
if ( renderer->type() == "singlebandgray" )
{
QgsSingleBandGrayRenderer* grayRenderer = static_cast<QgsSingleBandGrayRenderer*>( renderer );
if ( !grayRenderer )
{
return;
}

//create new contrast enhancements
int grayBand = grayRenderer->grayBand();
if ( grayBand == -1 )
{
return;
}

QgsContrastEnhancement* e = rasterContrastEnhancement( rlayer, grayBand, visibleAreaOnly );
if ( !e )
{
return;
}
grayRenderer->setContrastEnhancement( e );
}
else if ( renderer->type() == "multibandcolor" )
{
QgsMultiBandColorRenderer* colorRenderer = static_cast<QgsMultiBandColorRenderer*>( renderer );
if ( !colorRenderer )
{
return;
}

QgsContrastEnhancement* redEnhancement = rasterContrastEnhancement( rlayer, colorRenderer->redBand(), visibleAreaOnly );
if ( redEnhancement )
{
colorRenderer->setRedContrastEnhancement( redEnhancement );
}
QgsContrastEnhancement* greenEnhancement = rasterContrastEnhancement( rlayer, colorRenderer->greenBand(), visibleAreaOnly );
if ( greenEnhancement )
{
colorRenderer->setGreenContrastEnhancement( greenEnhancement );
}
QgsContrastEnhancement* blueEnhancement = rasterContrastEnhancement( rlayer, colorRenderer->blueBand(), visibleAreaOnly );
if ( blueEnhancement )
{
colorRenderer->setBlueContrastEnhancement( blueEnhancement );
}
}
else
{
QMessageBox::information( this,
tr( "No Valid Raster Layer Selected" ),
tr( "To perform a local histogram stretch, you need to have a grayscale "
"or multiband (multiband single layer, singleband grayscale or multiband color) "
" raster layer selected." ) );
return;
}

mMapCanvas->refresh();
}

void QgisApp::localHistogramStretch()
QgsContrastEnhancement* QgisApp::rasterContrastEnhancement( QgsRasterLayer* rlayer, int band,
bool visibleAreaOnly ) const
{
QgsMapLayer * layer = mMapLegend->currentLayer();

if ( !layer )
if ( !rlayer || band == -1 )
{
QMessageBox::information( this,
tr( "No Layer Selected" ),
tr( "To perform a local histogram stretch, you need to have a raster layer selected." ) );
return;
return 0;
}

QgsRasterLayer* rlayer = qobject_cast<QgsRasterLayer *>( layer );
if ( !rlayer )
QgsRasterDataProvider* provider = rlayer->dataProvider();
if ( !provider )
{
QMessageBox::information( this,
tr( "No Raster Layer Selected" ),
tr( "To perform a local histogram stretch, you need to have a raster layer selected." ) );
return;
return 0;
}
if ( rlayer->drawingStyle() == QgsRasterLayer::SingleBandGray ||
rlayer->drawingStyle() == QgsRasterLayer::MultiBandSingleBandGray ||
rlayer->drawingStyle() == QgsRasterLayer::MultiBandColor
)

QgsContrastEnhancement* e = new QgsContrastEnhancement(( QgsContrastEnhancement::QgsRasterDataType )(
provider->dataType( band ) ) );
double minValue = 0;
double maxValue = 0;

if ( visibleAreaOnly )
{
rlayer->setContrastEnhancementAlgorithm( "StretchToMinimumMaximum" );
rlayer->setMinimumMaximumUsingLastExtent();
rlayer->setCacheImage( NULL );
//refreshLayerSymbology( rlayer->getLayerID() );
mMapCanvas->refresh();
return;
double minMax[2];
rlayer->computeMinimumMaximumFromLastExtent( band, minMax );
minValue = minMax[0];
maxValue = minMax[1];
}
else
{
QMessageBox::information( this,
tr( "No Valid Raster Layer Selected" ),
tr( "To perform a local histogram stretch, you need to have a grayscale "
"or multiband (multiband single layer, singleband grayscale or multiband color) "
" raster layer selected." ) );
return;
QgsRasterBandStats rasterBandStats = rlayer->bandStatistics( band );
minValue = rasterBandStats.minimumValue;
maxValue = rasterBandStats.maximumValue;
}

e->setMinimumValue( minValue );
e->setMaximumValue( maxValue );
e->setContrastEnhancementAlgorithm( QgsContrastEnhancement::StretchToMinimumMaximum );
return e;
}

void QgisApp::localHistogramStretch()
{
histogramStretch( true );
}

void QgisApp::helpContents()
{
@@ -41,6 +41,7 @@ class QgsAnnotationItem;
class QgsClipboard;
class QgsComposer;
class QgsComposerView;
class QgsContrastEnhancement;
class QgsGeometry;
class QgsFeature;

@@ -971,6 +972,12 @@ class QgisApp : public QMainWindow, private Ui::MainWindow
void updateCRSStatusBar();
void createDecorations();

/**Do histogram stretch for singleband gray / multiband color rasters*/
void histogramStretch( bool visibleAreaOnly = false );
/**Create raster enhancement object for a raster band*/
QgsContrastEnhancement* rasterContrastEnhancement( QgsRasterLayer* rlayer, int band,
bool visibleAreaOnly = false ) const;

// actions for menus and toolbars -----------------

#ifdef Q_WS_MAC

0 comments on commit f3f1c43

Please sign in to comment.
You can’t perform that action at this time.