Skip to content

Commit

Permalink
Update grass
Browse files Browse the repository at this point in the history
  • Loading branch information
nyalldawson committed Dec 16, 2022
1 parent 1a3bd17 commit aa8d902
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 13 deletions.
8 changes: 4 additions & 4 deletions src/providers/grass/qgsgrassimport.cpp
Expand Up @@ -245,16 +245,16 @@ bool QgsGrassRasterImport::import()
for ( int band = 1; band <= provider->bandCount(); band++ )
{
QgsDebugMsg( QString( "band = %1" ).arg( band ) );
int colorInterpretation = provider->colorInterpretation( band );
if ( colorInterpretation == QgsRaster::RedBand )
Qgis::RasterColorInterpretation colorInterpretation = provider->colorInterpretation( band );
if ( colorInterpretation == Qgis::RasterColorInterpretation::RedBand )
{
redBand = band;
}
else if ( colorInterpretation == QgsRaster::GreenBand )
else if ( colorInterpretation == Qgis::RasterColorInterpretation::GreenBand )
{
greenBand = band;
}
else if ( colorInterpretation == QgsRaster::BlueBand )
else if ( colorInterpretation == Qgis::RasterColorInterpretation::BlueBand )
{
blueBand = band;
}
Expand Down
14 changes: 7 additions & 7 deletions src/providers/grass/qgsgrassrasterprovider.cpp
Expand Up @@ -414,17 +414,17 @@ int QgsGrassRasterProvider::yBlockSize() const
int QgsGrassRasterProvider::xSize() const { return mCols; }
int QgsGrassRasterProvider::ySize() const { return mRows; }

QgsRasterIdentifyResult QgsGrassRasterProvider::identify( const QgsPointXY &point, QgsRaster::IdentifyFormat format, const QgsRectangle &boundingBox, int width, int height, int /*dpi*/ )
QgsRasterIdentifyResult QgsGrassRasterProvider::identify( const QgsPointXY &point, Qgis::RasterIdentifyFormat format, const QgsRectangle &boundingBox, int width, int height, int /*dpi*/ )
{
Q_UNUSED( boundingBox )
Q_UNUSED( width )
Q_UNUSED( height )
QMap<int, QVariant> results;
QMap<int, QVariant> noDataResults;
noDataResults.insert( 1, QVariant() );
QgsRasterIdentifyResult noDataResult( QgsRaster::IdentifyFormatValue, results );
QgsRasterIdentifyResult noDataResult( Qgis::RasterIdentifyFormat::Value, results );

if ( format != QgsRaster::IdentifyFormatValue )
if ( format != Qgis::RasterIdentifyFormat::Value )
{
return QgsRasterIdentifyResult( QGS_ERROR( tr( "Format not supported" ) ) );
}
Expand Down Expand Up @@ -461,7 +461,7 @@ QgsRasterIdentifyResult QgsGrassRasterProvider::identify( const QgsPointXY &poin

results.insert( 1, value );

return QgsRasterIdentifyResult( QgsRaster::IdentifyFormatValue, results );
return QgsRasterIdentifyResult( Qgis::RasterIdentifyFormat::Value, results );
}

int QgsGrassRasterProvider::capabilities() const
Expand Down Expand Up @@ -498,15 +498,15 @@ int QgsGrassRasterProvider::bandCount() const
return 1;
}

int QgsGrassRasterProvider::colorInterpretation( int bandNo ) const
Qgis::RasterColorInterpretation QgsGrassRasterProvider::colorInterpretation( int bandNo ) const
{
// TODO: avoid loading color table here or cache it
QList<QgsColorRampShader::ColorRampItem> ct = colorTable( bandNo );
if ( ct.size() > 0 )
{
return QgsRaster::ContinuousPalette;
return Qgis::RasterColorInterpretation::ContinuousPalette;
}
return QgsRaster::GrayIndex;
return Qgis::RasterColorInterpretation::GrayIndex;
}

QString QgsGrassRasterProvider::htmlMetadata()
Expand Down
4 changes: 2 additions & 2 deletions src/providers/grass/qgsgrassrasterprovider.h
Expand Up @@ -145,7 +145,7 @@ class GRASS_LIB_EXPORT QgsGrassRasterProvider : public QgsRasterDataProvider

bool isValid() const override;

QgsRasterIdentifyResult identify( const QgsPointXY &point, QgsRaster::IdentifyFormat format, const QgsRectangle &boundingBox = QgsRectangle(), int width = 0, int height = 0, int dpi = 96 ) override;
QgsRasterIdentifyResult identify( const QgsPointXY &point, Qgis::RasterIdentifyFormat format, const QgsRectangle &boundingBox = QgsRectangle(), int width = 0, int height = 0, int dpi = 96 ) override;

/**
* \brief Returns the caption error text for the last error in this provider
Expand Down Expand Up @@ -181,7 +181,7 @@ class GRASS_LIB_EXPORT QgsGrassRasterProvider : public QgsRasterDataProvider

int bandCount() const override;

int colorInterpretation( int bandNo ) const override;
Qgis::RasterColorInterpretation colorInterpretation( int bandNo ) const override;

int xBlockSize() const override;
int yBlockSize() const override;
Expand Down

0 comments on commit aa8d902

Please sign in to comment.