[QGIS Commit] r15192 - in trunk/qgis: images images/themes/default
src/app
svn_qgis at osgeo.org
svn_qgis at osgeo.org
Fri Feb 18 05:30:57 EST 2011
Author: timlinux
Date: 2011-02-18 02:30:56 -0800 (Fri, 18 Feb 2011)
New Revision: 15192
Added:
trunk/qgis/images/themes/default/mActionLocalHistogramStretch.png
Modified:
trunk/qgis/images/images.qrc
trunk/qgis/src/app/qgisapp.cpp
trunk/qgis/src/app/qgisapp.h
Log:
Added local histogram stretch icon to the new raster toolbar and wired it up so it works
Modified: trunk/qgis/images/images.qrc
===================================================================
--- trunk/qgis/images/images.qrc 2011-02-18 09:49:14 UTC (rev 15191)
+++ trunk/qgis/images/images.qrc 2011-02-18 10:30:56 UTC (rev 15192)
@@ -3,6 +3,7 @@
<file>north_arrows/gpsarrow.svg</file>
<file>north_arrows/gpsarrow2.svg</file>
<file>themes/default/mActionAddArrow.png</file>
+ <file>themes/default/mActionLocalHistogramStretch.png</file>
<file>themes/newgis/mActionAddGPSLayer.png</file>
<file>themes/newgis/mActionAddImage.png</file>
<file>themes/newgis/mActionAddIsland.png</file>
Added: trunk/qgis/images/themes/default/mActionLocalHistogramStretch.png
===================================================================
--- trunk/qgis/images/themes/default/mActionLocalHistogramStretch.png (rev 0)
+++ trunk/qgis/images/themes/default/mActionLocalHistogramStretch.png 2011-02-18 10:30:56 UTC (rev 15192)
@@ -0,0 +1,36 @@
+PNG
+
+
+IHDR B C (ÓM
+ziCCPICC Profile xÕgTSÙÇϽé RBï½ôzo¢J(1*bGT`DE¡*8*EÆbaP°; 2DEåÝÀÃq½õæÛûòvÖ9ëÿÞÙ÷äsÖú@¾Áäña ¸)|WzhX8÷À@%d²yö¾¾àãÃ0É»:^ÿXöߢìèd /b'³>Å㧠·#zz
+aÔÅøÈ.pìpÔw/Öú;"5 ÀL~, ¤?ÆEúÑësÙ.ÂÆÛ°âlÐNJZ/àã«GýÐ'öf2£¾÷d2c¿óÒA~<ØÌKdn\üò¿S÷µTd&s½{#I6ÓÉcy{¶¨Gsun·Ï2Çð]üâðû.ëqÞËìü½O<Ó]°gýù©þAËà¼Ìq!ËÌvú®Çp\Ë:'
ñýY ë=¾¯xgà
+èÀ .~è p D!Ø+ืÏK¡Û#'/ZÎà²tµéúôÿMîÜÒbßÝY¼K¤à8ÿ[Ëè Àº9ÏÔ¿µ NU ÿ·¦j\¤¶µÊO[ê'8ê @) :ÐAÞ§)°vÈv> µâ@àt¶öC T g@¸ ®ëà6èCà1ãàÀ<A8Ñ )HR´ CȲ!OÈ
+"¡X¥BYÐN(*J¡J¨ú:]nBÐChÞBaLÅ`YXÖÍa{Ø×À±ð8Î÷Á%p|n
¯À·á!x~Ï¢ @) tPæ(G*⣶ rQŨ*TªÕºAM£>¡±hÖA[¡ÝÐAhzz:]®C·¢»ÑwÑ£èô7#ÑÂXbPL,&)ÆÔ`Z0×0CqÌ,+UÃaÝ°aØxì&l>ö(¶ÛÀagq8NgóÁ1q)¸ÜÜIÜeÜ n÷OÂËã
+ñ.øp<¿_oÀ_Ââ'ðó
+ÁàC`6
+ÕÂÂ8a(JT#ZñÄíÄbññ ñDR$YüHÒ6R é4éiôL%kÉäTò>r-¹üüB¡¨Rì(áÊ>J=å*åå£MHW!ÄÚ*T&Ô*4(ôZ ¬"l/¼V8S¸Xø¬ðáiª£SdHÈyû"³¢4QQÑ$Ñ|ÑÑ¢TUêLeS³©'¨W©c4MæHcÑvÒªi×hãbX151X¼XØ)±>±qª¸±x°xxøEñ ªC"Q¢@âÄ°Äç²+ìWD¯Ø»¢iÅà9ÉvѹÍC¥èRÎR R¤Ú¤J£¥5¥ý¤Ó¥I_^)¶Òj%keîÊ3+ÉÀ22þ2dNÈôÊÌÊÊɺÊòdÈ^³+»$7%O·çÈÉ_I§ÛÓé%ônúBªB¥B¼¢bâÅfŧJD%s¥¥"¥.¥eye/å,åFåG*s8Ã*=*sªjª!ª»UÛT'Õ$ÕjjjOÔ)ê¶êÔ«Ôïi`5Ì54jôkÂ&qew´`-S-ÖQm¶
6W»Jû¾YÇ^'M§QgTWB×Swnîk=e½p½z=zßôMôõ«õP
+Ü
+vt¼5Ô4dÞ3¢¹m5j7zc¬em|Ìø ÍÄËd·IÉWS3S¾ié²Y¤Y¹Ù}s1s_ó|ó,>YZ¦X±üËJÇ*ÁªÁjrÚªèUիƬÖÖ#6tHã6#¶
+¶LÛ*ÛçvJvl»» {
+ûxûö¯ôø-s;PN®N¹N}ÎTç çRçg..±..3®&®\;Ý0nnÜî3d,F=cÆÝÌ}³{·Ù#À£Ô㹧¦'ß³Ãör÷:èõÄ[ÅëÝæ|>}úªùnðýÕëçëWæ÷ÂßÀ?Ë¿'°. !àC C`Aàã õ Ô ®`áààú๧ÂP½ÐÍ¡·Ã¤Ã8aíá¸ðàððÙÕΫ0È^£¶&cÍ͵Òk×^\'¼¹îl$&2$²!òÓYÅbDGÍ°YY¯Øvì"öT´utaôDuLaÌd¬uìÁØ©8Û¸â¸i#§ó&Þ-¾"~.Á'¡6a!1$±9 tKå&p»×ËÏX?ÀÓâåðF6Xn8´aïÁ¯I×$·§!æ¦7U=uWêhMZYÚÇôàô³¢ÜÞ÷nÈtÉüyzkSWBÖö¬ÑÍö+·@[¢¶tmUÚ½u|붺íÄí ÛÛ¡¿£pÇû!;;²e³·eírÝÕ#ÃϹ¿ÛjwÅôξ½F{ìýËν§W÷%ë'J~Zس¯¯À´àØ~ì~îþá¶ê
+E3Çzl-¢å½?´îÐÍbãâÃÄéGJ<KÚ(ÙäKi\éPCYs¹LùÞò¹£ì£Çì5UÈVäU|>Î9þ Òµ²µJµªøöDÚÕÁÕ=?ÿ\_#]Wóµ[;Rç_×]oV_ß ÓPÐ7¦6N8ÙÊéT{NSe³DsÞip:õôË_">ãq¦ë¬ùÙ¦s*çÊ[h-¹PëÆÖ¶¸¶ö°öóîç»:¬:Z~ÕýµöÂ
²â./e_Z¸yy¶×9}%öÊX׺®ÇWC¯Þëöëî»æqíÆuëW{ì{.ß°¾qá¦åÍó·ÌoµÝ6½ÝÚkÒÛòÉo-}¦}wÌî´÷[ôw¬¸4h;xå®ÓÝë÷÷ny
+
+?¸qäûÁäÃÄo¥=¼í æIîS§ÅÏdUý®ñ{óéÈÅQ§ÑÞçϱÆ^ýüÇñìÅòõ¦\¦ú_®~9þ÷j~:çOÑ?Ë_«¿>÷Ý_½3¡3ãoøoÞæ¿zWûÞø}׬ïì³Iæçr?J}¬ûdþ©çsÈçùô/¸/%_5¾v|óøöd!iaÇä3½
+á ÞÖ@ Ö ±sÉ/V at K>aAü/ùæÅ) Õ ¬ÀÎ"¬ kØ:ØÈèû@A$Ç.DF¼#¦saáí ¸H ¾ö-,Ì,,|-F¼Î{ .{/yqAµ~ ød]iÚ&P~öñé.7õ pHYs #IDATxí[[H]^ÚI¨Yy¡^D¨J/¤¥¦YjHÐCEFFãC ½ÙKwÃK^SÑò ^ÂR
+/T*ênÝhì³gÎõgöì½Ö^{o_×91°ÀÓá7¶`a¡\¬akD(°åþ³[ª,Âl´²hGåºÐÚnÅjF%y"EÛO¶°K[jÂÃÃcw¼{¦i½¦µ)ÆINN÷Ñ£G°±±¡09·%@¬¯¯Cjj*Ãââ"©S§Lv]ÙÜ ÑÚÚ
+###066ÞÞÞ011«««ðäÉ¥ufæh
+~ò9¡]ò£Ë)NÎZZZ:Þ¿ÏüüüØüü¼¢\:D>·µµq£Î?¯èïcÇÁåËáñãÇrÓ2*Ð"D9é1"RRRXIIM£2f¾¾¾liiIÉp/'aõí5"¾|ùÝÝÝn·£9çÎÊ.ßÈBS˲²2¾[xyy9ôéÞ½{PTTäoÃT ***àêÕ«N}9sæìÚµz{{ÊéÍ4
+O>ñm¾nÞ¼ Ï=éÊ7
+HJJÝ»wÈÌÌÚÚZX^^Êê%`*ªì>pà DDDÀË/UÉë!d
++++ÐÕÕ.\Pmóµk×W³È :;;áäÉü8Ö±+W®Àëׯáëׯj«¸%g
+pñâEMîß¿âââ ººZS=W
M¢©©ÜZ¼~ý:¼xñBk5ä
+)øùó'?~\³ Ðßßi®«µá@´··Cll¬V»¸ü={ >>êêê\ª¯¥á@P´IsÝU¢W««¯§"2£èjU¥xÅðâ
ÍÎΪ·'D(Æ&w{l5e
+mmôùîÝ;õ=³I´¨¯¯ßÄÑ7kèÔèèèÐträ
íF¯Awj,G ÈåtÛMº~üø!éLEoÝ#8}ú4477»§ÈImÃèééáÇjg0Nìúeôîaîn ]:¡Òµ¿dî¤ì9J;OXXÐlÄÂÂLMMñy§Ñiiií /o 22ß=ê
+DUU¬é©ë2W¯^Lz]÷M;½É h¡T{-§Õ¡¨¬¬ÔZM(¯;}}}pðàA8zô¨°qWº¬ÑûbWw è¶úÒ¥K®ø¨ªít¸¢vô$Ýxþü¹ÃWzz~ãÆ
+xúô©^ê¸]ºL9qâÄ#)}ûöí¼+TôÈD§Ìááaøøñ£\ä~ª"V§x¶&?ÚM³²²X~~>c,88íÝ»þaW^m!Õ÷ôôäúH/éðà»sç
+ ï#¨qræÐçÏGRÛ·oOéYϬwff·¯eó¥2~ê65rssáöíÛpèÐ!À¼¼< ìIÄ ¡1¦ú4åHé%ýÙÙÙÄv5þW¹Ï°5ùQâ÷PìðáÃÖrÊ
+
+±7oÞüS®¥êÍôýûwà0Æ6³þÎKvP "NöøöíÃ+//ÅLMñÃ>õ>|øà¨] B?
¨qÚõݽ{WÙ´¸¸áTáë$,ú)@%¤9M_ÅMNN2üH[·nÉì-Mùô|øð!etn# S¡BTB8U2<ÝñQWq2k[¤ø½&»ÿ>
+
+bgÏåÛ,&áOè§PÀ¦Ô@ì´Í~¡¿ýC÷S²¢³·=§-ìY©ÿ_·ÕNGÃÂÖÊÉlkDX#B5"xXk
+_v ü' IEND®B`
\ No newline at end of file
Modified: trunk/qgis/src/app/qgisapp.cpp
===================================================================
--- trunk/qgis/src/app/qgisapp.cpp 2011-02-18 09:49:14 UTC (rev 15191)
+++ trunk/qgis/src/app/qgisapp.cpp 2011-02-18 10:30:56 UTC (rev 15192)
@@ -1209,6 +1209,12 @@
mWindowActions = new QActionGroup( this );
#endif
+ // Raster toolbar items
+ mActionLocalHistogramStretch = new QAction( getThemeIcon( "mActionmRasterLocalHistogramStretch.png" ), tr( "Local Histogram Stretch" ), this );
+ mActionLocalHistogramStretch->setStatusTip( tr( "Stretch histogram of active raster to view extents" ) );
+ connect( mActionLocalHistogramStretch, SIGNAL( triggered() ), this, SLOT( localHistogramStretch() ) );
+
+
// Help Menu Items
mActionHelpContents = new QAction( getThemeIcon( "mActionHelpContents.png" ), tr( "Help Contents" ), this );
@@ -1864,7 +1870,15 @@
mHelpToolBar->addAction( mActionHelpContents );
mHelpToolBar->addAction( QWhatsThis::createAction() );
mToolbarMenu->addAction( mHelpToolBar->toggleViewAction() );
+
+ //
+ // Raster Toolbar
+ mRasterToolBar = addToolBar( tr( "Raster" ) );
+ mRasterToolBar->setObjectName( "Raster" );
+ mRasterToolBar->addAction( mActionLocalHistogramStretch );
+ mToolbarMenu->addAction( mRasterToolBar->toggleViewAction() );
+
//Label Toolbar
mLabelToolBar = addToolBar( tr( "Label" ) );
mLabelToolBar->setObjectName( "Label" );
@@ -2070,6 +2084,7 @@
mActionOptions->setIcon( getThemeIcon( "/mActionOptions.png" ) );
mActionConfigureShortcuts->setIcon( getThemeIcon( "/mActionOptions.png" ) );
mActionHelpContents->setIcon( getThemeIcon( "/mActionHelpContents.png" ) );
+ mActionLocalHistogramStretch->setIcon( getThemeIcon( "/mActionLocalHistogramStretch.png" ) );
mActionQgisHomePage->setIcon( getThemeIcon( "/mActionQgisHomePage.png" ) );
mActionAbout->setIcon( getThemeIcon( "/mActionHelpAbout.png" ) );
mActionDraw->setIcon( getThemeIcon( "/mActionDraw.png" ) );
@@ -5459,6 +5474,48 @@
delete optionsDialog;
}
+void QgisApp::localHistogramStretch()
+{
+ QgsMapLayer * layer = mMapLegend->currentLayer();
+
+ if ( !layer )
+ {
+ QMessageBox::information( this,
+ tr( "No Layer Selected" ),
+ tr( "To perform a local histogram stretch, you need to have a raster layer selected." ) );
+ return;
+ }
+
+ QgsRasterLayer* rlayer = qobject_cast<QgsRasterLayer *>( layer );
+ if ( !rlayer )
+ {
+ QMessageBox::information( this,
+ tr( "No Raster Layer Selected" ),
+ tr( "To perform a local histogram stretch, you need to have a raster layer selected." ) );
+ return;
+ }
+ if ( rlayer->drawingStyle() == QgsRasterLayer::SingleBandGray ||
+ rlayer->drawingStyle() == QgsRasterLayer::MultiBandSingleBandGray
+ )
+ {
+ rlayer->setContrastEnhancementAlgorithm( "StretchToMinimumMaximum" );
+ rlayer->setMinimumMaximumUsingLastExtent();
+ rlayer->setCacheImage(NULL);
+ //refreshLayerSymbology( rlayer->getLayerID() );
+ mMapCanvas->refresh();
+ return;
+ }
+ else
+ {
+ QMessageBox::information( this,
+ tr( "No Valid Raster Layer Selected" ),
+ tr( "To perform a local histogram stretch, you need to have a grayscale "
+ "(multiband single layer, or singleband grayscale) raster layer "
+ "selected." ) );
+ return;
+ }
+}
+
void QgisApp::helpContents()
{
openURL( "index.html" );
Modified: trunk/qgis/src/app/qgisapp.h
===================================================================
--- trunk/qgis/src/app/qgisapp.h 2011-02-18 09:49:14 UTC (rev 15191)
+++ trunk/qgis/src/app/qgisapp.h 2011-02-18 10:30:56 UTC (rev 15192)
@@ -361,6 +361,7 @@
QToolBar *attributesToolBar() { return mAttributesToolBar; }
QToolBar *pluginToolBar() { return mPluginToolBar; }
QToolBar *helpToolBar() { return mHelpToolBar; }
+ QToolBar *rasterToolBar() { return mRasterToolBar; }
//! run python
void runPythonString( const QString &expr );
@@ -498,6 +499,8 @@
void zoomToLayerExtent();
//! zoom to actual size of raster layer
void zoomActualSize();
+ //! perform a local histogram stretch on the active raster layer (stretch based on pixel values in view extent)
+ void localHistogramStretch();
//! plugin manager
void showPluginManager();
//! load python support if possible
@@ -876,6 +879,7 @@
QToolBar *mAttributesToolBar;
QToolBar *mPluginToolBar;
QToolBar *mHelpToolBar;
+ QToolBar *mRasterToolBar;
QToolBar *mLabelToolBar;
// actions for menus and toolbars -----------------
@@ -1013,6 +1017,8 @@
QAction *mActionHelpSeparator2;
QAction *mActionAbout;
+ QAction *mActionLocalHistogramStretch;
+
QAction *mActionMoveLabel;
QAction *mActionRotateLabel;
QAction *mActionChangeLabelProperties;
More information about the QGIS-commit
mailing list