745 changes: 14 additions & 731 deletions src/core/raster/qgsrasterlayer.cpp

Large diffs are not rendered by default.

66 changes: 0 additions & 66 deletions src/core/raster/qgsrasterlayer.h
Original file line number Diff line number Diff line change
Expand Up @@ -310,12 +310,6 @@ class CORE_EXPORT QgsRasterLayer : public QgsMapLayer
/** \brief Accessor for drawing style */
DrawingStyle drawingStyle() { return mDrawingStyle; }

/** \brief Accessor for gray band name mapping */
QString grayBandName() const { return mGrayBandName; }

/** \brief Accessor for green band name mapping */
QString greenBandName() const { return mGreenBandName; }

/** \brief Accessor for mHasPyramids (READ ONLY) */
bool hasPyramids() { return mHasPyramids; }

Expand All @@ -328,48 +322,21 @@ class CORE_EXPORT QgsRasterLayer : public QgsMapLayer
/** \brief Accessor that returns the height of the (unclipped) raster */
int height() { return mHeight; }

/** \brief Accessor to find out whether the histogram should be inverted */
bool invertHistogram() const { return mInvertColor; }

/** \brief Is the NoDataValue Valid */
bool isNoDataValueValid() const { return mValidNoDataValue; }

/** \brief Accessor for mGrayMinimumMaximumEstimated */
bool isGrayMinimumMaximumEstimated() const { return mGrayMinimumMaximumEstimated; }

/** \brief Accessor for mRGBMinimumMaximumEstimated */
bool isRGBMinimumMaximumEstimated() const { return mRGBMinimumMaximumEstimated; }

/** \brief Accessor that returns the NO_DATA entry for this raster */
double noDataValue( bool* isValid = 0 ) { if ( isValid ) { *isValid = mValidNoDataValue;} return mNoDataValue; }

/** \brief Returns a pointer to the transparency object */
QgsRasterTransparency* rasterTransparency() { return &mRasterTransparency; }

/** \brief Accessor for raster shader */
QgsRasterShader* rasterShader() { return mRasterShader; }

/** \brief Accessor for raster layer type (which is a read only property) */
LayerType rasterType() { return mRasterType; }

/** \brief Accessor for red band name (allows alternate mappings e.g. map blue as red color) */
QString redBandName() const { return mRedBandName; }


/** \brief Mutator for drawing style */
void setDrawingStyle( const DrawingStyle & theDrawingStyle ) { mDrawingStyle = theDrawingStyle; setRendererForDrawingStyle( theDrawingStyle ); }
/**Sets corresponding renderer for style*/
void setRendererForDrawingStyle( const DrawingStyle & theDrawingStyle );

/** \brief Mutator for mGrayMinimumMaximumEstimated */
void setGrayMinimumMaximumEstimated( bool theBool ) { mGrayMinimumMaximumEstimated = theBool; }

/** \brief Mutator to alter the state of the invert histogram flag */
void setInvertHistogram( bool theFlag ) { mInvertColor = theFlag; }

/** \brief Mutator for mRGBMinimumMaximumEstimated */
void setRGBMinimumMaximumEstimated( bool theBool ) { mRGBMinimumMaximumEstimated = theBool; }

/** \brief Mutator to alter the number of standard deviations that should be plotted */
void setStandardDeviations( double theStandardDeviations ) { mStandardDeviations = theStandardDeviations; }

Expand All @@ -387,9 +354,6 @@ class CORE_EXPORT QgsRasterLayer : public QgsMapLayer
/** \brief Accessor to find out how many standard deviations are being plotted */
double standardDeviations() const { return mStandardDeviations; }

/** \brief Accessor for transparent band name mapping */
QString transparentBandName() const { return mTransparencyBandName; }

/** \brief [ data provider interface ] Does this layer use a provider for setting/retrieving data?
* @deprecated in 2.0
*/
Expand Down Expand Up @@ -681,9 +645,6 @@ class CORE_EXPORT QgsRasterLayer : public QgsMapLayer
/** \brief receive progress signal from provider */
void onProgress( int, double, QString );

/** \brief Overload the setTransparency method from QgsMapLayer */
void setTransparency( unsigned int theInt );

signals:
/** \brief Signal for notifying listeners of long running processes */
void progressUpdate( int theValue );
Expand Down Expand Up @@ -848,15 +809,6 @@ class CORE_EXPORT QgsRasterLayer : public QgsMapLayer
/** \brief Values for mapping pixel to world coordinates. Contents of this array are the same as the GDAL adfGeoTransform */
double mGeoTransform[6];

/** \brief The band to be associated with the grayscale only output - usually 1 */
QString mGrayBandName;

/** \brief Flag to indicate of the min max values are actual or estimates/user defined */
bool mGrayMinimumMaximumEstimated;

/** \brief The band to be associated with the color green - usually 2 */
QString mGreenBandName;

/** \brief Whether this raster has overviews / pyramids or not */
bool mHasPyramids;

Expand All @@ -866,9 +818,6 @@ class CORE_EXPORT QgsRasterLayer : public QgsMapLayer
/** \brief Raster height */
int mHeight;

/** \brief Flag indicating whether the color of pixels should be inverted or not */
bool mInvertColor;

/** [ data provider interface ] Timestamp, the last modified time of the data source when the layer was created */
QDateTime mLastModified;

Expand All @@ -889,26 +838,11 @@ class CORE_EXPORT QgsRasterLayer : public QgsMapLayer
/** \brief This list holds a series of RasterPyramid structs which store information for each potential pyramid level */
RasterPyramidList mPyramidList;

/** \brief The raster shader for the layer */
QgsRasterShader* mRasterShader;

/** \brief A collection of stats - one for each band in the layer */
RasterStatsList mRasterStatsList;

/** \brief The transparency container */
QgsRasterTransparency mRasterTransparency;

LayerType mRasterType;

/** \brief The band to be associated with the color red - usually 1 */
QString mRedBandName;

/** \brief Flag to indicate of the min max values are actual or estimates/user defined */
bool mRGBMinimumMaximumEstimated;

/** \brief The band to be associated with transparency */
QString mTransparencyBandName;

/** \brief Flag to indicate if the user entered custom min max values */
bool mUserDefinedGrayMinimumMaximum;

Expand Down
22 changes: 11 additions & 11 deletions src/core/raster/qgssinglebandgrayrenderer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,17 @@ void QgsSingleBandGrayRenderer::draw( QPainter* p, QgsRasterViewPort* viewPort,
{
grayVal = readValue( rasterData, rasterType, currentRasterPos );

//alpha
currentAlpha = mOpacity;
if ( mRasterTransparency )
{
currentAlpha = mRasterTransparency->alphaValue( grayVal, mOpacity * 255 ) / 255.0;
}
if ( mAlphaBand > 0 )
{
currentAlpha *= ( readValue( alphaData, alphaType, currentRasterPos ) / 255.0 );
}

if ( mContrastEnhancement )
{
if ( !mContrastEnhancement->isValueInDisplayableRange( grayVal ) )
Expand All @@ -138,17 +149,6 @@ void QgsSingleBandGrayRenderer::draw( QPainter* p, QgsRasterViewPort* viewPort,
grayVal = 255 - grayVal;
}

//alpha
currentAlpha = mOpacity;
if ( mRasterTransparency )
{
currentAlpha = mRasterTransparency->alphaValue( grayVal, mOpacity * 255 ) / 255.0;
}
if ( mAlphaBand > 0 )
{
currentAlpha *= ( readValue( alphaData, alphaType, currentRasterPos ) / 255.0 );
}

if ( doubleNear( currentAlpha, 255 ) )
{
imageScanLine[j] = qRgba( grayVal, grayVal, grayVal, 255 );
Expand Down
3 changes: 3 additions & 0 deletions src/mapserver/qgssldparser.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -419,6 +419,8 @@ QgsFeatureRendererV2* QgsSLDParser::rendererFromUserStyle( const QDomElement& us

bool QgsSLDParser::rasterSymbologyFromUserStyle( const QDomElement& userStyleElement, QgsRasterLayer* r ) const
{
return false;
#if 0 //needs to be fixed
QgsDebugMsg( "Entering" );
if ( !r )
{
Expand Down Expand Up @@ -502,6 +504,7 @@ bool QgsSLDParser::rasterSymbologyFromUserStyle( const QDomElement& userStyleEle

//set pseudo color mode
return true;
#endif //0
}

// ---------------labelSettingsFromUserStyle-----------------------
Expand Down