Skip to content
Permalink
Browse files

transparent null values

git-svn-id: http://svn.osgeo.org/qgis/trunk@5015 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
rblazek
rblazek committed Mar 13, 2006
1 parent 430c458 commit d2109c2b7fa2681ce5857b044c2070f2dc5107b6
Showing with 14 additions and 7 deletions.
  1. +14 −7 src/raster/qgsrasterlayer.cpp
@@ -1586,8 +1586,9 @@ void QgsRasterLayer::drawSingleBandGray(QPainter * theQPainter, QgsRasterViewPor
void *myGdalScanData = readData ( myGdalBand, theRasterViewPort );

QImage myQImage = QImage(theRasterViewPort->drawableAreaXDimInt, theRasterViewPort->drawableAreaYDimInt, 32);
myQImage.fill(0);
//myQImage.fill(0);
myQImage.setAlphaBuffer(true);
myQImage.fill(qRgba(255,255,255,0 )); // fill transparent

double myRangeDouble = myRasterBandStats.rangeDouble;

@@ -1675,8 +1676,9 @@ void QgsRasterLayer::drawSingleBandPseudoColor(QPainter * theQPainter,
void *myGdalScanData = readData ( myGdalBand, theRasterViewPort );

QImage myQImage = QImage(theRasterViewPort->drawableAreaXDimInt, theRasterViewPort->drawableAreaYDimInt, 32);
myQImage.fill(0);
//myQImage.fill(0);
myQImage.setAlphaBuffer(true);
myQImage.fill(qRgba(255,255,255,0 )); // fill transparent

//calculate the adjusted matrix stats - which come into affect if the user has chosen
QgsRasterBandStats myAdjustedRasterBandStats = getRasterBandStats(theBandNoInt);
@@ -1897,8 +1899,9 @@ void QgsRasterLayer::drawPalettedSingleBandColor(QPainter * theQPainter, QgsRast
QgsColorTable *myColorTable = colorTable ( theBandNoInt );

QImage myQImage = QImage(theRasterViewPort->drawableAreaXDimInt, theRasterViewPort->drawableAreaYDimInt, 32);
myQImage.fill(0);
//myQImage.fill(0);
myQImage.setAlphaBuffer(true);
myQImage.fill(qRgba(255,255,255,0 )); // fill transparent

for (int myColumnInt = 0; myColumnInt < theRasterViewPort->drawableAreaYDimInt; ++myColumnInt)
{
@@ -1989,8 +1992,9 @@ void QgsRasterLayer::drawPalettedSingleBandGray(QPainter * theQPainter, QgsRaste
QgsColorTable *myColorTable = &(myRasterBandStats.colorTable);

QImage myQImage = QImage(theRasterViewPort->drawableAreaXDimInt, theRasterViewPort->drawableAreaYDimInt, 32);
myQImage.fill(0);
//myQImage.fill(0);
myQImage.setAlphaBuffer(true);
myQImage.fill(qRgba(255,255,255,0 )); // fill transparent

for (int myColumnInt = 0; myColumnInt < theRasterViewPort->drawableAreaYDimInt; ++myColumnInt)
{
@@ -2096,8 +2100,9 @@ void QgsRasterLayer::drawPalettedSingleBandPseudoColor(QPainter * theQPainter, Q
QgsColorTable *myColorTable = &(myRasterBandStats.colorTable);

QImage myQImage = QImage(theRasterViewPort->drawableAreaXDimInt, theRasterViewPort->drawableAreaYDimInt, 32);
myQImage.fill(0);
//myQImage.fill(0);
myQImage.setAlphaBuffer(true);
myQImage.fill(qRgba(255,255,255,0 )); // fill transparent

int myRedInt = 0;
int myGreenInt = 0;
@@ -2335,8 +2340,9 @@ void QgsRasterLayer::drawPalettedMultiBandColor(QPainter * theQPainter, QgsRaste
QgsColorTable *myColorTable = colorTable ( theBandNoInt );

QImage myQImage = QImage(theRasterViewPort->drawableAreaXDimInt, theRasterViewPort->drawableAreaYDimInt, 32);
myQImage.fill(0);
//myQImage.fill(0);
myQImage.setAlphaBuffer(true);
myQImage.fill(qRgba(255,255,255,0 )); // fill transparent

for (int myColumnInt = 0; myColumnInt < theRasterViewPort->drawableAreaYDimInt; ++myColumnInt)
{
@@ -2473,8 +2479,9 @@ void QgsRasterLayer::drawMultiBandColor(QPainter * theQPainter, QgsRasterViewPor
void *myGdalBlueData = readData ( myGdalBlueBand, theRasterViewPort );

QImage myQImage = QImage(theRasterViewPort->drawableAreaXDimInt, theRasterViewPort->drawableAreaYDimInt, 32);
myQImage.fill(0);
//myQImage.fill(0);
myQImage.setAlphaBuffer(true);
myQImage.fill(qRgba(255,255,255,0 )); // fill transparent
for (int myColumnInt = 0; myColumnInt < theRasterViewPort->drawableAreaYDimInt; ++myColumnInt)
{
for (int myRowInt = 0; myRowInt < theRasterViewPort->drawableAreaXDimInt; ++myRowInt)

0 comments on commit d2109c2

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