22 #ifndef QGSRASTERLAYER_H
23 #define QGSRASTERLAYER_H
190 const QString & baseName = QString::null,
191 bool loadDefaultStyleFlag =
true );
195 const QString & baseName = QString(),
196 const QString & path = QString(),
197 const QString & providerLib = QString(),
198 const QStringList & layers = QStringList(),
199 const QStringList & styles = QStringList(),
200 const QString & format = QString(),
201 const QString & crs = QString() );
233 MultiBandSingleBandGray = MultiBandSingleGandGray,
236 SingleBandColorDataStyle
268 static void buildSupportedRasterFileFilter( QString & fileFilters );
275 static bool isValidRasterFileName(
const QString & theFileNameQString, QString &retError );
276 static bool isValidRasterFileName(
const QString & theFileNameQString );
281 static QDateTime lastModified(
const QString & name );
285 static void registerGdalDrivers();
295 void setDataProvider(
const QString & provider,
296 const QStringList & layers,
297 const QStringList & styles,
298 const QString & format,
299 const QString & crs );
301 void setDataProvider(
const QString & provider,
302 const QStringList & layers,
303 const QStringList & styles,
304 const QString & format,
306 bool loadDefaultStyleFlag );
308 static QLibrary* loadProviderLibrary( QString theProviderKey );
322 QString contrastEnhancementAlgorithmAsString()
const;
358 double noDataValue(
bool* isValid = 0 ) {
if ( isValid ) { *isValid = mValidNoDataValue;}
return mNoDataValue; }
410 unsigned int bandCount();
413 const QString bandName(
int theBandNoInt );
418 int bandNumber(
const QString & theBandName );
431 RasterPyramidList buildPyramidList();
434 QString colorShadingAlgorithmAsString()
const;
437 void computeMinimumMaximumEstimates(
int theBand,
double* theMinMax );
440 void computeMinimumMaximumEstimates( QString theBand,
double* theMinMax );
444 void computeMinimumMaximumEstimates(
int theBand,
double& theMin,
double& theMax );
447 void computeMinimumMaximumFromLastExtent(
int theBand,
double* theMinMax );
450 void computeMinimumMaximumFromLastExtent( QString theBand,
double* theMinMax );
454 void computeMinimumMaximumFromLastExtent(
int theBand,
double& theMin,
double& theMax );
463 QList<QgsColorRampShader::ColorRampItem>* colorTable(
int theBandNoInt );
479 void draw( QPainter * theQPainter,
488 QString drawingStyleAsString()
const;
494 bool hasStatistics(
int theBandNoInt );
497 bool identify(
const QgsPoint & point, QMap<QString, QString>& results );
500 QString identifyAsText(
const QgsPoint & point );
505 QString identifyAsHtml(
const QgsPoint & point );
517 QPixmap legendAsPixmap();
520 QPixmap legendAsPixmap(
bool );
523 QPixmap legendAsPixmap(
int theLabelCount );
526 double maximumValue(
unsigned int theBand );
529 double maximumValue( QString theBand );
535 double minimumValue(
unsigned int theBand );
538 double minimumValue( QString theBand );
541 QPixmap paletteAsPixmap(
int theBand = 1 );
544 QString providerKey()
const;
547 double rasterUnitsPerPixel();
551 bool readColorTable(
int theBandNumber, QList<QgsColorRampShader::ColorRampItem>* theList );
554 void resetNoDataValue();
557 void setBlueBandName(
const QString & theBandName );
563 void setColorShadingAlgorithm( QString theShaderAlgorithm );
567 bool theGenerateLookupTableFlag =
true );
570 void setContrastEnhancementAlgorithm( QString theAlgorithm,
bool theGenerateLookupTableFlag =
true );
576 void setDrawingStyle(
const QString & theDrawingStyleQString );
579 void setGrayBandName(
const QString & theBandName );
582 void setGreenBandName(
const QString & theBandName );
585 void setMaximumValue(
unsigned int theBand,
double theValue,
bool theGenerateLookupTableFlag =
true );
588 void setMaximumValue( QString theBand,
double theValue,
bool theGenerateLookupTableFlag =
true );
593 void setMinimumMaximumUsingLastExtent();
597 void setMinimumMaximumUsingDataset();
600 void setMinimumValue(
unsigned int theBand,
double theValue,
bool theGenerateLookupTableFlag =
true );
603 void setMinimumValue( QString theBand,
double theValue,
bool theGenerateLookupTableFlag =
true );
606 void setNoDataValue(
double theNoData );
613 void setRedBandName(
const QString & theBandName );
616 void setTransparentBandName(
const QString & theBandName );
619 void showProgress(
int theValue );
625 void thumbnailAsPixmap( QPixmap * theQPixmap );
629 void thumbnailAsImage( QImage * thepImage );
632 void triggerRepaint();
651 virtual QDateTime
timestamp()
const {
return mDataProvider->timestamp() ; }
655 QString buildPyramids(
const RasterPyramidList &,
656 const QString & theResamplingMethod =
"NEAREST",
657 bool theTryInternalFlag =
false );
661 void populateHistogram(
int theBandNoInt,
662 int theBinCountInt = 256,
663 bool theIgnoreOutOfRangeFlag =
true,
664 bool theThoroughBandScanFlag =
false );
666 void showStatusMessage(
const QString & theMessage );
669 void updateProgress(
int,
int );
672 void onProgress(
int,
double, QString );
676 void progressUpdate(
int theValue );
687 bool readSymbology(
const QDomNode& node, QString& errorMessage );
690 bool readXml( QDomNode & layer_node );
693 bool writeSymbology( QDomNode&, QDomDocument& doc, QString& errorMessage )
const;
696 bool writeXml( QDomNode & layer_node, QDomDocument & doc );
703 void drawSingleBandColorData( QPainter * theQPainter,
709 void drawMultiBandColor( QPainter * theQPainter,
714 void drawMultiBandSingleBandGray( QPainter * theQPainter,
720 void drawMultiBandSingleBandPseudoColor( QPainter * theQPainter,
726 void drawPalettedSingleBandColor( QPainter * theQPainter,
732 void drawPalettedSingleBandGray( QPainter * theQPainter,
738 void drawPalettedSingleBandPseudoColor( QPainter * theQPainter,
744 void drawPalettedMultiBandColor( QPainter * theQPainter,
750 void drawSingleBandGray( QPainter * theQPainter,
756 void drawSingleBandPseudoColor( QPainter * theQPainter,
762 void closeDataProvider();
765 QString generateBandName(
int );
768 bool hasBand(
const QString & theBandName );
771 QString projectionWkt();
778 bool readFile(
const QString & fileName );
782 inline double readValue(
void *data,
int type,
int index );
788 QString validateBandName(
const QString & theBandName );
836 double mGeoTransform[6];
933 void reset(
int maxPixelsInVirtualMemory = 5000000 );
935 bool nextScanLine( QRgb** imageScanLine,
void** rasterScanLine );
942 bool createNextPartImage();
945 void drawPixelRectangle();