Skip to content

Commit

Permalink
transparent null values
Browse files Browse the repository at this point in the history
git-svn-id: http://svn.osgeo.org/qgis/trunk/qgis@5015 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
rblazek committed Mar 13, 2006
1 parent 4106f2d commit 5646fa9
Showing 1 changed file with 14 additions and 7 deletions.
21 changes: 14 additions & 7 deletions src/raster/qgsrasterlayer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -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)
{
Expand Down Expand Up @@ -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)
{
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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)
{
Expand Down Expand Up @@ -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)
Expand Down

0 comments on commit 5646fa9

Please sign in to comment.