Skip to content
Permalink
Browse files
-Fix missed api updates in the unit tests
-Patched minor debug error in WMS provider
-Added ability to set transparency for WMS layer, closes ticket #1348. This patch needs to be reviewed on other platforms however as there seems to be a slight bug with QImage::setAlphaChannel

git-svn-id: http://svn.osgeo.org/qgis/trunk@9561 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
ersts committed Nov 1, 2008
1 parent 5cf0e49 commit 785dd83626c77bc796d230c6b74ab5d7924b6104

This file was deleted.

@@ -39,9 +39,9 @@ class QgsRasterBandStats
typedef QVector<int> HistogramVector;
//HistogramVector * histogramVector;
/** \brief whteher histogram values are estimated or completely calculated */
bool histogramEstimated;
bool isHistogramEstimated;
/** whehter histogram compuation should include out of range values */
bool histogramOutOfRange;
bool isHistogramOutOfRange;
/** Color table */
//QList<QgsColorRampShader::ColorRampItem> colorTable;
};
@@ -551,7 +551,8 @@ void QgsRasterLayerProperties::sync()
tabBar->setCurrentIndex( tabBar->indexOf( tabPageMetadata ) );
tabBar->removeTab( tabBar->indexOf( tabPageColormap ) );
tabBar->removeTab( tabBar->indexOf( tabPageSymbology ) );
tabBar->removeTab( tabBar->indexOf( tabPageTransparency ) );
gboxNoDataValue->setEnabled( false );
gboxCustomTransparency->setEnabled( false );
tabBar->removeTab( tabBar->indexOf( tabPageHistogram ) );
tabBar->removeTab( tabBar->indexOf( tabPagePyramids ) );
}
@@ -46,8 +46,8 @@ class CORE_EXPORT QgsRasterBandStats
stdDev = 0.0;
sum = 0.0;
elementCount = 0;
histogramEstimated = false;
histogramOutOfRange = false;
isHistogramEstimated = false;
isHistogramOutOfRange = false;
}

/** \brief The name of the band that these stats belong to. */
@@ -64,10 +64,10 @@ class CORE_EXPORT QgsRasterBandStats
int elementCount;

/** \brief whteher histogram values are estimated or completely calculated */
bool histogramEstimated;
bool isHistogramEstimated;

/** whehter histogram compuation should include out of range values */
bool histogramOutOfRange;
bool isHistogramOutOfRange;

/** \brief Store the histogram for a given layer */
HistogramVector * histogramVector;
@@ -1136,10 +1136,14 @@ bool QgsRasterLayer::draw( QgsRenderContext& rendererContext )
QgsDebugMsg( QString( "origin y: %1" ).arg( myRasterViewPort->topLeftPoint.y() ) );
QgsDebugMsg( QString( "(int)origin y: %1" ).arg( static_cast<int>( myRasterViewPort->topLeftPoint.y() ) ) );

//Set the transparency for the whole layer
QImage myAlphaChannel( image->width(), image->height(), QImage::Format_Indexed8 );
myAlphaChannel.fill( ( uint ) mTransparencyLevel );
image->setAlphaChannel( myAlphaChannel );

// Since GDAL's RasterIO can't handle floating point, we have to round to
// the nearest pixel. Add 0.5 to get rounding instead of truncation
// out of static_cast<int>.

theQPainter->drawImage( static_cast<int>(
myRasterViewPort->topLeftPoint.x()
+ 0.5 // try simulating rounding instead of truncation, to avoid off-by-one errors
@@ -4516,12 +4520,12 @@ void QgsRasterLayer::populateHistogram( int theBandNo, int theBinCount, bool the
//i.e if the histogram has never previously been generated or the user has
//selected a new number of bins.
if ( myRasterBandStats.histogramVector->size() != theBinCount ||
theIgnoreOutOfRangeFlag != myRasterBandStats.histogramOutOfRange ||
theHistogramEstimatedFlag != myRasterBandStats.histogramEstimated )
theIgnoreOutOfRangeFlag != myRasterBandStats.isHistogramOutOfRange ||
theHistogramEstimatedFlag != myRasterBandStats.isHistogramEstimated )
{
myRasterBandStats.histogramVector->clear();
myRasterBandStats.histogramEstimated = theHistogramEstimatedFlag;
myRasterBandStats.histogramOutOfRange = theIgnoreOutOfRangeFlag;
myRasterBandStats.isHistogramEstimated = theHistogramEstimatedFlag;
myRasterBandStats.isHistogramOutOfRange = theIgnoreOutOfRangeFlag;
int *myHistogramArray = new int[theBinCount];


@@ -277,8 +277,8 @@ QImage* QgsWmsProvider::draw( QgsRect const & viewExtent, int pixelWidth, int p
{
QgsDebugMsg( "Entering." );

QgsDebugMsg( "pixelWidth = " + QString( pixelWidth ) );
QgsDebugMsg( "pixelHeight = " + QString( pixelHeight ) );
QgsDebugMsg( "pixelWidth = " + QString::number( pixelWidth ) );
QgsDebugMsg( "pixelHeight = " + QString::number( pixelHeight ) );
QgsDebugMsg( "viewExtent: " + viewExtent.toString() );

// Can we reuse the previously cached image?
Loading

0 comments on commit 785dd83

Please sign in to comment.