-Major API changes applied to be consistent with the core

-Should only be minor updates if any to the raster classes from here on out

git-svn-id: http://svn.osgeo.org/qgis/trunk@9564 c8812cc2-4d05-0410-92ff-de0c093fc19c
This commit is contained in:
ersts 2008-11-05 22:44:50 +00:00
parent b0a539a712
commit f46b458a78
13 changed files with 4589 additions and 4700 deletions

View File

@ -8,13 +8,13 @@ class QgsContrastEnhancement
public:
/** \brief This enumerator describes the types of contrast enhancement algorithms that can be used. */
enum CONTRAST_ENHANCEMENT_ALGORITHM
enum ContrastEnhancementAlgorithm
{
NO_STRETCH, //this should be the default color scaling algorithm
STRETCH_TO_MINMAX, //linear histogram enhanceContrast
STRETCH_AND_CLIP_TO_MINMAX,
CLIP_TO_MINMAX,
USER_DEFINED
NoEnhancement, //this should be the default color scaling algorithm
StretchToMinimumMaximum, //linear histogram enhanceContrast
StretchAndClipToMinimumMaximum,
ClipToMinimumMaximum,
UserDefined
};
/*! These are exactly the same as GDAL pixel data types */
@ -58,7 +58,7 @@ public:
/** \brief Return the minimum value for the contrast enhancement range. */
double minimumValue();
CONTRAST_ENHANCEMENT_ALGORITHM getContrastEnhancementAlgorithm();
ContrastEnhancementAlgorithm contrastEnhancementAlgorithm();
/*
*
@ -68,7 +68,7 @@ public:
/** \brief Return true if pixel is in stretable range, false if pixel is outside of range (i.e., clipped) */
bool isValueInDisplayableRange(double);
/** \brief Set the contrast enhancement algorithm */
void setContrastEnhancementAlgorithm(CONTRAST_ENHANCEMENT_ALGORITHM, bool generateTable=true);
void setContrastEnhancementAlgorithm(ContrastEnhancementAlgorithm, bool generateTable=true);
/** \brief A public method that allows the user to set their own custom contrast enhancment function */
void setContrastEnhancementFunction(QgsContrastEnhancementFunction*);
/** \brief Set the maximum value for the contrast enhancement range. */

View File

@ -14,556 +14,485 @@ class QgsRasterLayer : QgsMapLayer
%End
public:
//
// Static methods:
//
static void buildSupportedRasterFileFilter(QString & fileFilters);
static void registerGdalDrivers();
/** This helper checks to see whether the file name appears to be a valid
raster file name */
static bool isValidRasterFileName(const QString & theFileNameQString);
//
// Non Static methods:
//
/** \brief This is the constructor for the RasterLayer class.
*
* The main tasks carried out by the constructor are:
*
* -Load the rasters default style (.qml) file if it exists
*
* -Populate the RasterStatsVector with initial values for each band.
*
* -Calculate the layer extents
*
* -Determine whether the layer is gray, paletted or multiband.
*
* -Assign sensible defaults for the red,green, blue and gray bands.
* -Assign sensible defaults for the red, green, blue and gray bands.
*
* -
* */
QgsRasterLayer(const QString & path = QString::null,
const QString & baseName = QString::null);
QgsRasterLayer( const QString & path = QString::null,
const QString & baseName = QString::null,
bool loadDefaultStyleFlag = true );
/** \brief The destuctor. */
/** \brief [ data provider interface ] Constructor in provider mode */
QgsRasterLayer( int dummy,
const QString & baseName = QString(),
const QString & path = QString(),
const QString & providerLib = QString(),
const QStringList & layers = QStringList(),
const QStringList & styles = QStringList(),
const QString & format = QString(),
const QString & crs = QString());
/** \brief The destructor */
~QgsRasterLayer();
//
// Enums, structs and typedefs
//
/** \brief This enumerator describes the types of shading that can be used */
enum ColorShadingAlgorithm
{
UndefinedShadingAlgorithm,
PseudoColor,
FreakOut,
ColorRamp,
UserDefined
};
/** \brief This enumerator describes the different kinds of drawing we can do */
enum DrawingStyle
{
UndefinedDrawingStyle,
SingleBandGray, // a single band image drawn as a range of gray colors
SingleBandPseudoColor, // a single band image drawn using a pseudocolor algorithm
PalettedColor, //a "Palette" image drawn using color table
PalettedSingleBandGray, // a "Palette" layer drawn in gray scale
PalettedSingleBandPseudoColor, // a "Palette" layerdrawn using a pseudocolor algorithm
PalettedMultiBandColor, // currently not supported
MultiBandSingleGandGray, // a layer containing 2 or more bands, but a single band drawn as a range of gray colors
MultiBandSingleBandPseudoColor, //a layer containing 2 or more bands, but a single band drawn using a pseudocolor algorithm
MultiBandColor //a layer containing 2 or more bands, mapped to RGB color space.
//In the case of a multiband with only two bands, one band will be mapped to more than one color.
};
/** \brief This enumerator describes the type of raster layer */
enum LayerType
{
GrayOrUndefined,
Palette,
Multiband
} ;
/** \brief A list containing on ContrastEnhancement object per raster band in this raster layer */
typedef QList<QgsContrastEnhancement> ContrastEnhancementList;
/** \brief A list containing one RasterPyramid struct per raster band in this raster layer.
* POTENTIAL pyramid layer. This works by dividing the height
* and width of the raster by an incrementing number. As soon as the result
* of the division is <=256 we stop allowing RasterPyramid structs
* to be added to the list. Each time a RasterPyramid is created
* we will check to see if a pyramid matching these dimensions already exists
* in the raster layer, and if so mark the exists flag as true */
typedef QList<QgsRasterPyramid> RasterPyramidList;
/** \brief A list containing one RasterBandStats struct per raster band in this raster layer.
* Note that while very RasterBandStats element will have the name and number of its associated
* Note that while every RasterBandStats element will have the name and number of its associated
* band populated, any additional stats are calculated on a need to know basis.*/
typedef QList<QgsRasterBandStats> RasterStatsList;
/** \brief A list containing one RasterPyramid struct per raster band in this raster layer.
* POTENTIAL pyramid layer. How this works is we divide the height
* and width of the raster by an incrementing number. As soon as the result
* of the division is <=256 we stop allowing RasterPyramid stracuts
* to be added to the list. Each time a RasterPyramid is created
* we will check to see if a pyramid matching these dimensions already exists
* in the raster layer, and if so mark the exists flag as true. */
typedef QList<QgsRasterPyramid> RasterPyramidList;
/** \brief A list containing on ContrastEnhancement object per raster band in this raster layer. */
typedef QList<QgsContrastEnhancement> ContrastEnhancementList;
/** \brief This typedef is used when the showProgress function is passed to gdal as a function
pointer. */
// typedef int (QgsRasterLayer::*showTextProgress)( double theProgress,
// const char *theMessageCharArray,
// void *theData);
/** \brief Identify raster value(s) found on the point position
*
* \param point[in] a coordinate in the CRS of this layer.
//
// Static methods:
//
static void buildSupportedRasterFileFilter( QString & fileFilters );
/** This helper checks to see whether the file name appears to be a valid
* raster file name. If the file name looks like it could be valid,
* but some sort of error occurs in processing the file, the error is
* returned in retError.
*/
bool identify(const QgsPoint & point, QMap<QString,QString>& results /Out/);
static bool isValidRasterFileName( const QString & theFileNameQString, QString &retError );
/** \brief Identify arbitrary details from the WMS server found on the point position
*
* \param point[in] an image pixel coordinate in the last requested extent of layer.
*
* \return A text document containing the return from the WMS server
*
* \note The arbitraryness of the returned document is enforced by WMS standards
* up to at least v1.3.0
static bool isValidRasterFileName( const QString & theFileNameQString );
/** Return time stamp for given file name */
static QDateTime lastModified( const QString & name );
/** \brief ensures that GDAL drivers are registered, but only once */
static void registerGdalDrivers();
//
// Non Static inline methods
//
/** \brief Accessor for blue band name mapping */
QString blueBandName() const;
/** \brief Accessor for color shader algorithm */
QgsRasterLayer::ColorShadingAlgorithm colorShadingAlgorithm() const;
/** \brief Accessor for contrast enhancement algorithm */
QgsContrastEnhancement::ContrastEnhancementAlgorithm contrastEnhancementAlgorithm();
/** \brief Returns contrast enhancement algorithm as a string */
QString contrastEnhancementAlgorithmAsString() const;
/** \brief Accessor for drawing style */
DrawingStyle drawingStyle();
/** \brief Accessor for gray band name mapping */
QString grayBandName() const;
/** \brief Accessor for green band name mapping */
QString greenBandName() const;
/** \brief Accessor for mHasPyramids (READ ONLY) */
bool hasPyramids();
/** \brief Accessor for mUserDefinedGrayMinimumMaximum */
bool hasUserDefinedGrayMinimumMaximum() const;
/** \brief Accessor for mUserDefinedRGBMinimumMaximum */
bool hasUserDefinedRGBMinimumMaximum() const;
/** \brief Accessor that returns the height of the (unclipped) raster */
int height();
/** \brief Accessor to find out whether the histogram should be inverted */
bool invertHistogram() const;
/** \brief Is the NoDataValue Valid */
bool isNoDataValueValid() const;
/** \brief Accessor for mGrayMinimumMaximumEstimated */
bool isGrayMinimumMaximumEstimated() const;
/** \brief Accessor for mRGBMinimumMaximumEstimated */
bool isRGBMinimumMaximumEstimated() const;
/** \brief Accessor that returns the NO_DATA entry for this raster */
double noDataValue( bool* isValid = 0 );
/** \brief Returns a pointer to the transparency object */
QgsRasterTransparency* rasterTransparency();
/** \brief Accessor for raster shader */
QgsRasterShader* rasterShader();
/** \brief Accessor for raster layer type (which is a read only property) */
LayerType rasterType();
/** \brief Accessor for red band name (allows alternate mappings e.g. map blue as red color) */
QString redBandName();
/** [ data provider interface ] Set the data provider */
void setDataProvider( const QString & provider,
const QStringList & layers,
const QStringList & styles,
const QString & format,
const QString & crs );
/** \brief Mutator for drawing style */
void setDrawingStyle( const DrawingStyle & theDrawingStyle );
/** \brief Mutator for mGrayMinimumMaximumEstimated */
void setGrayMinimumMaximumEstimated( bool theBool );
/** \brief Mutator to alter the state of the invert histogram flag */
void setInvertHistogram( bool theFlag );
/** \brief Mutator for mRGBMinimumMaximumEstimated */
void setRGBMinimumMaximumEstimated( bool theBool );
/** \brief Mutator to alter the number of standard deviations that should be plotted */
void setStandardDeviationsToPlot( double theStdDevsToPlot );
/** \brief Mutator for mUserDefinedGrayMinimumMaximum */
void setUserDefinedGrayMinimumMaximum( bool theBool );
/** \brief Mutator for mUserDefinedRGBMinimumMaximum */
void setUserDefinedRGBMinimumMaximum( bool theBool );
/** \brief Accessor to find out how many standard deviations are being plotted */
double standardDeviationsToPlot() const;
/** \brief Accessor for transparent band name mapping */
QString transparentBandName() const;
/** \brief [ data provider interface ] Does this layer use a provider for setting/retrieving data? */
bool usesProvider();
/** \brief Accessor that returns the width of the (unclipped) raster */
int width();
//
// Non Static methods
//
/** \brief Get the number of bands in this layer */
unsigned int bandCount();
/** \brief Get the name of a band given its number */
const QString bandName( int theBandNoInt );
/** \brief Get the number of a band given its name. The name is the rewritten name set
* up in the constructor, and will not necessarily be the same as the name retrieved directly from gdal!
* If no matching band is found zero will be returned! */
int bandNumber( const QString & theBandName );
/** \brief Get RasterBandStats for a band given its number (read only) */
const QgsRasterBandStats bandStatistics( int );
/** \brief Get RasterBandStats for a band given its name (read only) */
const QgsRasterBandStats bandStatistics( const QString & );
/** \brief Accessor for ths raster layers pyramid list. A pyramid list defines the
* POTENTIAL pyramids that can be in a raster. To know which of the pyramid layers
* ACTUALLY exists you need to look at the existsFlag member in each struct stored in the
* list.
*/
QString identifyAsText(const QgsPoint & point);
RasterPyramidList buildPyramidList();
/** \brief Query gdal to find out the Wkt projection string for this layer. This implements the virtual method of the same name defined in QgsMapLayer*/
QString getProjectionWkt();
/** \brief Accessor for color shader algorithm */
QString colorShadingAlgorithmAsString() const;
/** \brief Returns the number of raster units per each raster pixel. For rasters with world file, this is normally the first row (without the sign) in that file */
/** \brief Wrapper for GDALComputeRasterMinMax with the estimate option */
void computeMinimumMaximumEstimates( int theBand, double* theMinMax );
/** \brief Wrapper for GDALComputeRasterMinMax with the estimate option */
void computeMinimumMaximumEstimates( QString theBand, double* theMinMax );
/** \brief Get a pointer to the contrast enhancement for the selected band */
QgsContrastEnhancement* contrastEnhancement( unsigned int theBand );
/**Copies the symbology settings from another layer. Returns true in case of success*/
bool copySymbologySettings( const QgsMapLayer& theOther );
/** \brief Get a pointer to the color table */
//QList<QgsColorRampShader::ColorRampItem>* colorTable( int theBandNoInt );
/** Returns the data provider */
QgsRasterDataProvider* dataProvider();
/** Returns the data provider in a const-correct manner */
//const QgsRasterDataProvider* dataProvider() const;
/** \brief This is called when the view on the raster layer needs to be redrawn */
bool draw( QgsRenderContext& rendererContext );
/** \brief This is an overloaded version of the draw() function that is called by both draw() and thumbnailAsPixmap */
void draw( QPainter * theQPainter,
QgsRasterViewPort * myRasterViewPort,
const QgsMapToPixel* theQgsMapToPixel = 0 );
/** \brief Returns a string representation of drawing style
*
* Implementaed mainly for serialisation / deserialisation of settings to xml.
* NOTE: May be deprecated in the future!. DrawingStyle drawingStyle() instead.
* */
QString drawingStyleAsString() const;
/** \brief Checks if symbology is the same as another layers */
bool hasCompatibleSymbology( const QgsMapLayer& theOther ) const;
/** \brief Check whether a given band number has stats associated with it */
bool hasStatistics( int theBandNoInt );
/** \brief Identify raster value(s) found on the point position */
bool identify( const QgsPoint & point, QMap<QString, QString>& results /Out/ );
/** \brief Identify arbitrary details from the WMS server found on the point position */
QString identifyAsText( const QgsPoint & point );
/** \brief Currently returns always false */
bool isEditable() const;
/** \brief [ data provider interface ] If an operation returns 0 (e.g. draw()), this function returns the text of the error associated with the failure */
QString lastError();
/** \brief [ data provider interface ] If an operation returns 0 (e.g. draw()), this function returns the text of the error associated with the failure */
QString lastErrorTitle();
/** \brief Get a legend image for this layer */
QPixmap legendAsPixmap();
/** \brief Overloaded version of above function that can print layer name onto legend */
//QPixmap legendAsPixmap( bool );
/** \brief Use this method when you want an annotated legend suitable for print output etc */
//QPixmap legendAsPixmap( int theLabelCount );
/** \brief Accessor for maximum value user for contrast enhancement */
double maximumValue( unsigned int theBand );
/** \brief Accessor for maximum value user for contrast enhancement */
double maximumValue( QString theBand );
/** \brief Obtain GDAL Metadata for this layer */
QString metadata();
/** \brief Accessor for minimum value user for contrast enhancement */
double minimumValue( unsigned int theBand );
/** \brief Accessor for minimum value user for contrast enhancement */
double minimumValue( QString theBand );
/** \brief Get an 100x100 pixmap of the color palette. If the layer has no palette a white pixmap will be returned */
QPixmap paletteAsPixmap( int theBand = 1 );
/** \brief [ data provider interface ] Which provider is being used for this Raster Layer? */
QString providerKey();
/** \brief Returns the number of raster units per each raster pixel. In a world file, this is normally the first row (without the sign) */
double rasterUnitsPerPixel();
/** \brief Draws a thumbnail of the rasterlayer into the supplied pixmap pointer */
void drawThumbnail(QPixmap * theQPixmap);
/** \brief Get an 8x8 pixmap of the colour palette. If the layer has no palette a white pixmap will be returned. */
QPixmap getPaletteAsPixmap(int theBand=1);
/** \brief This is called when the view on the rasterlayer needs to be refreshed (redrawn).
*/
bool draw(QgsRenderContext& rendererContext);
/** \brief This is an overloaded version of the above function that is called by both draw above and drawThumbnail */
void draw(QPainter * theQPainter, QgsRasterViewPort * myRasterViewPort,
QgsMapToPixel * theQgsMapToPixel = 0);
//
// Accessors for image height and width
//
/** \brief Accessor that returns the width of the (unclipped) raster */
int getRasterXDim();
/** \brief Accessor that returns the height of the (unclipped) raster */
int getRasterYDim();
//
// Accessor and mutator for no data double
//
/** \brief Is the NoDataValue Valid */
bool isNoDataValueValid();
/** \brief Accessor that returns the NO_DATA entry for this raster. */
double getNoDataValue(bool* isValid=0);
/** \brief Mutator that allows the NO_DATA entry for this raster to be overridden. */
void setNoDataValue(double theNoData);
/** \brief Read color table from GDAL raster band */
//bool readColorTable( int theBandNumber, QList<QgsColorRampShader::ColorRampItem>* theList );
/** \brief Simple reset function that set the noDataValue back to the value stored in the first raster band */
void resetNoDataValue();
//
// Accessor and mutator for mInvertPixelsFlag
//
/** \brief Accessor to find out whether the histogram should be inverted. */
bool getInvertHistogramFlag() const;
/** \brief Mutator to alter the state of the invert histogram flag. */
void setInvertHistogramFlag(bool theFlag);
//
// Accessor and mutator for mStandardDeviations
//
/** \brief Accessor to find out how many standard deviations are being plotted. */
double getStdDevsToPlot() const;
/** \brief Mutator to alter the number of standard deviations that should be plotted. */
void setStdDevsToPlot(double the);
/** \brief Get the number of bands in this layer */
unsigned int getBandCount();
/** \brief Get RasterBandStats for a band given its number (read only) */
const QgsRasterBandStats getRasterBandStats(int);
/** \brief Check whether a given band number has stats associated with it */
bool hasStats(int theBandNoInt);
/** \brief Overloaded method that also returns stats for a band, but uses the band colour name
* Note this approach is not recommeneded because it is possible for two gdal raster
* bands to have the same name!
*/
const QgsRasterBandStats getRasterBandStats(const QString &);
/** \brief Get the number of a band given its name. Note this will be the rewritten name set
* up in the constructor, and will not necessarily be the same as the name retrieved directly from gdal!
* If no matching band is found zero will be returned! */
int getRasterBandNumber (const QString & theBandNameQString);
/** \brief Get the name of a band given its number. */
const QString getRasterBandName(int theBandNoInt);
/** \brief Find out whether a given band exists. */
bool hasBand(const QString & theBandName);
/** \brief Call any inline image manipulation filters */
void filterLayer(QImage * theQImage);
/** \brief Accessor for red band name (allows alternate mappings e.g. map blue as red colour). */
QString getRedBandName() const;
/** \brief Mutator for red band name (allows alternate mappings e.g. map blue as red colour). */
void setRedBandName(const QString & theBandNameQString);
//
// Accessor and mutator for green band name
//
/** \brief Accessor for green band name mapping. */
QString getGreenBandName() const;
/** \brief Mutator for green band name mapping. */
void setGreenBandName(const QString & theBandNameQString);
//
// Accessor and mutator for blue band name
//
/** \brief Accessor for blue band name mapping. */
QString getBlueBandName() const;
/** \brief Mutator for blue band name mapping. */
void setBlueBandName(const QString & theBandNameQString);
//
// Accessor transparency container.
//
QgsRasterTransparency* getRasterTransparency();
//
// Accessor and mutator for transparent band name
//
/** \brief Accessor for transparent band name mapping. */
QString getTransparentBandName() const;
/** \brief Mutator for transparent band name mapping. */
void setTransparentBandName(const QString & theBandNameQString);
//
// Accessor and mutator for gray band name
//
/** \brief Accessor for gray band name mapping. */
QString getGrayBandName() const;
/** \brief Mutator for gray band name mapping. */
void setGrayBandName(const QString & theBandNameQString);
// Accessor and mutator for min max values
double minimumValue(unsigned int theBand);
double minimumValue(QString theBand);
/** \brief Mutator for blue band name mapping */
void setBlueBandName( const QString & theBandName );
void setMinimumValue(unsigned int theBand, double theValue);
/** \brief Mutator for color shader algorithm */
void setColorShadingAlgorithm( QgsRasterLayer::ColorShadingAlgorithm theShaderAlgorithm );
void setMinimumValue(QString theBand, double theValue, bool theGenerateLookupTableFlag=true);
double maximumValue(unsigned int theBand);
/** \brief Mutator for color shader algorithm */
void setColorShadingAlgorithm( QString theShaderAlgorithm );
double maximumValue(QString theBand);
void setMaximumValue(unsigned int theBand, double theValue);
/** \brief Mutator for contrast enhancement algorithm */
void setContrastEnhancementAlgorithm( QgsContrastEnhancement::ContrastEnhancementAlgorithm theAlgorithm,
bool theGenerateLookupTableFlag = true );
void setMaximumValue(QString theBand, double theValue, bool theGenerateLookupTableFlag=true);
/** \brief Mutator for contrast enhancement algorithm */
void setContrastEnhancementAlgorithm( QString theAlgorithm, bool theGenerateLookupTableFlag = true );
/** \brief Wrapper for GDALComputeRasterMinMax with the estimate option */
void computeMinimumMaximumEstimates(int theBand, double* theMinMax);
/** \brief Mutator for contrast enhancement function */
void setContrastEnhancementFunction( QgsContrastEnhancementFunction* theFunction );
/** \brief Wrapper for GDALComputeRasterMinMax with the estimate option */
void computeMinimumMaximumEstimates(QString theBand, double* theMinMax);
/** \brief Overloaded version of the above function for convenience when restoring from xml */
void setDrawingStyle( const QString & theDrawingStyleQString );
QgsContrastEnhancement* getContrastEnhancement(unsigned int theBand);
/** \brief Mutator for gray band name mapping */
void setGrayBandName( const QString & theBandName );
//
// Accessor and mutator for the contrast enhancement algorithm
//
/** \brief Accessor for contrast enhancement algorithm. */
QgsContrastEnhancement::CONTRAST_ENHANCEMENT_ALGORITHM getContrastEnhancementAlgorithm();
/** \brief Accessor for contrast enhancement algorithm. */
QString getContrastEnhancementAlgorithmAsString() const;
/** \brief Mutator for contrast enhancement algorithm. */
void setContrastEnhancementAlgorithm(QgsContrastEnhancement::CONTRAST_ENHANCEMENT_ALGORITHM theAlgorithm, bool theGenerateLookupTableFlag=true);
/** \brief Mutator for contrast enhancement algorithm. */
void setContrastEnhancementAlgorithm(QString theAlgorithm, bool theGenerateLookupTableFlag=true);
//
// Mutator for the contrast enhancement function
//
/** \brief Mutator for contrast enhancement function. */
void setContrastEnhancementFunction(QgsContrastEnhancementFunction* theFunction);
/** \brief This enumerator describes the types of shading that can be used. */
enum COLOR_SHADING_ALGORITHM
{
UNDEFINED_SHADING_ALGORITHM,
PSEUDO_COLOR,
FREAK_OUT, //it will scare your granny!
COLOR_RAMP,
USER_DEFINED
};
//
// Accessor and mutator for the color shader algorithm
//
/** \brief Accessor for colour shader algorithm. */
COLOR_SHADING_ALGORITHM getColorShadingAlgorithm() const;
/** \brief Mutator for green band name mapping */
void setGreenBandName( const QString & theBandName );
/** \brief Mutator for setting the maximum value for contrast enhancement */
void setMaximumValue( unsigned int theBand, double theValue, bool theGenerateLookupTableFlag = true );
/** \brief Mutator for setting the maximum value for contrast enhancement */
void setMaximumValue( QString theBand, double theValue, bool theGenerateLookupTableFlag = true );
/** \brief Mutator for setting the minimum value for contrast enhancement */
void setMinimumValue( unsigned int theBand, double theValue, bool theGenerateLookupTableFlag = true );
/** \brief Mutator for setting the minimum value for contrast enhancement */
void setMinimumValue( QString theBand, double theValue, bool theGenerateLookupTableFlag = true );
/** \brief Mutator that allows the NO_DATA entry for this raster to be overridden */
void setNoDataValue( double theNoData );
/** \brief Accessor for colour shader algorithm. */
QString getColorShadingAlgorithmAsString() const;
/** \brief Mutator for color shader algorithm. */
void setColorShadingAlgorithm(COLOR_SHADING_ALGORITHM theShaderAlgorithm);
/** \brief Mutator for color shader algorithm. */
void setColorShadingAlgorithm(QString theShaderAlgorithm);
/** \brief Accessor for raster shader */
QgsRasterShader* getRasterShader();
/** \brief Set the raster shader function to a user defined function */
void setRasterShaderFunction(QgsRasterShaderFunction* theFunction);
/** \brief This enumerator describes the different kinds of drawing we can do. */
enum DRAWING_STYLE
{
UNDEFINED_DRAWING_STYLE,
SINGLE_BAND_GRAY, // a "Gray" or "Undefined" layer drawn as a range of gray colors
SINGLE_BAND_PSEUDO_COLOR,// a "Gray" or "Undefined" layer drawn using a pseudocolor algorithm
PALETTED_COLOR, //a "Palette" image drawn using color table
PALETTED_SINGLE_BAND_GRAY,// a "Palette" layer drawn in gray scale (using only one of the color components)
PALETTED_SINGLE_BAND_PSEUDO_COLOR, // a "Palette" layer having only one of its color components rendered as psuedo color
PALETTED_MULTI_BAND_COLOR, // a "Palette" image is decomposed to 3 channels (RGB) and drawn
// as multiband
MULTI_BAND_SINGLE_BAND_GRAY, // a layer containing 2 or more bands, but using only one band to produce a grayscale image
MULTI_BAND_SINGLE_BAND_PSEUDO_COLOR, //a layer containing 2 or more bands, but using only one band to produce a pseudocolor image
MULTI_BAND_COLOR //a layer containing 2 or more bands, mapped to the three RGBcolors. In the case of a multiband with only two bands, one band will have to be mapped to more than one color
};
DRAWING_STYLE drawingStyle;
//
// Accessor and mutator for drawing style.
//
/** \brief Accessor for drawing style. */
DRAWING_STYLE getDrawingStyle();
/** \brief Returns a string representation of drawing style.
*
* Implementaed mainly for serialisation / deserialisation of settings to xml.
* NOTE: May be deprecated in the future!. Use alternate implementation above rather.
* */
QString getDrawingStyleAsString() const;
/** \brief Mutator for drawing style. */
void setDrawingStyle(const DRAWING_STYLE & theDrawingStyle);
/** \brief Overloaded version of the above function for convenience when restoring from xml.
*
* Implementaed mainly for serialisation / deserialisation of settings to xml.
* NOTE: May be deprecated in the future! Use alternate implementation above rather.
* */
void setDrawingStyle(const QString & theDrawingStyleQString);
void setRasterShaderFunction( QgsRasterShaderFunction* theFunction );
/** \brief This enumerator describes the type of raster layer. */
enum RASTER_LAYER_TYPE
{
GRAY_OR_UNDEFINED,
PALETTE,
MULTIBAND
};
RASTER_LAYER_TYPE rasterLayerType;
//
//accessor and for raster layer type (READ ONLY)
//
/** \brief Accessor for raster layer type (which is a read only property) */
RASTER_LAYER_TYPE getRasterLayerType();
/** \brief Accessor for hasPyramidsFlag (READ ONLY) */
bool getHasPyramidsFlag();
/** \brief Get a legend image for this layer. */
QPixmap getLegendQPixmap();
/** \brief Overloaded version of above function that can print layer name onto legend. */
QPixmap getLegendQPixmap(bool);
/** \brief Use this method when you want an annotated legend suitable for print output etc.
* @param int theLabelCountInt Number of vertical labels to display (defaults to 3)
* */
QPixmap getDetailedLegendQPixmap(int theLabelCount);
/**
* Returns the sublayers of this layer
*
* (Useful for providers that manage their own layers, such as WMS)
*
*/
/** \brief Mutator for red band name (allows alternate mappings e.g. map blue as red color) */
void setRedBandName( const QString & theBandName );
/** \brief Mutator for transparent band name mapping */
void setTransparentBandName( const QString & theBandName );
/** \brief [ data provider interface ] A wrapper function to emit a progress update signal */
void showProgress( int theValue );
/** \brief Returns the sublayers of this layer - Useful for providers that manage their own layers, such as WMS */
QStringList subLayers() const;
/** \brief Draws a thumbnail of the rasterlayer into the supplied pixmap pointer */
void thumbnailAsPixmap( QPixmap * theQPixmap );
/** \brief Emit a signal asking for a repaint. (inherited from maplayer) */
void triggerRepaint();
//
// Virtural methods
//
/**
* Reorders the *previously selected* sublayers of this layer from bottom to top
*
* (Useful for providers that manage their own layers, such as WMS)
*
*/
virtual void setLayerOrder(const QStringList & layers);
virtual void setLayerOrder( const QStringList & layers );
/**
* Set the visibility of the given sublayer name
*/
virtual void setSubLayerVisibility(const QString & name, bool vis);
virtual void setSubLayerVisibility( const QString & name, bool vis );
/** \brief Emit a signal asking for a repaint. (inherited from maplayer) */
void triggerRepaint();
/** \brief Obtain GDAL Metadata for this layer */
QString metadata();
/** \brief Accessor for ths raster layers pyramid list. A pyramid list defines the
* POTENTIAL pyramids that can be in a raster. To know which of the pyramid layers
* ACTUALLY exists you need to look at the existsFlag member in each struct stored in the
* list.*/
RasterPyramidList buildRasterPyramidList();
/** \brief Helper method to retrieve the nth pyramid layer struct from the PyramidList.
* If the nth layer does not exist, NULL will be returned. */
// RasterPyramid getRasterPyramid(int thePyramidNo);
/**Currently returns always false*/
bool isEditable() const;
/** Return time stamp for given file name */
static QDateTime lastModified ( const QString & name );
/**Copies the symbology settings from another layer. Returns true in case of success*/
bool copySymbologySettings(const QgsMapLayer& other);
bool hasCompatibleSymbology(const QgsMapLayer& other) const;
/**
* If an operation returns 0 (e.g. draw()), this function
* returns the text of the error associated with the failure.
* Interactive users of this provider can then, for example,
* call a QMessageBox to display the contents.
*/
QString lastErrorTitle();
/**
* If an operation returns 0 (e.g. draw()), this function
* returns the text of the error associated with the failure.
* Interactive users of this provider can then, for example,
* call a QMessageBox to display the contents.
*/
QString lastError();
public slots:
/** \brief Create GDAL pyramid overviews */
QString buildPyramids( const RasterPyramidList &,
const QString & theResamplingMethod = "NEAREST",
bool theTryInternalFlag = false );
/** Returns the data provider
*
* \retval 0 if not using the data provider model (i.e. directly using GDAL)
*/
QgsRasterDataProvider* dataProvider();
/** \brief Populate the histogram vector for a given band */
void populateHistogram( int theBandNoInt,
int theBinCountInt = 256,
bool theIgnoreOutOfRangeFlag = true,
bool theThoroughBandScanFlag = false );
/** Returns the data provider in a const-correct manner
*
* \retval 0 if not using the data provider model (i.e. directly using GDAL)
*/
// PyQGIS: commented out, has the same signature as the function above
// const QgsRasterDataProvider* dataProvider() const;
void showStatusMessage( const QString & theMessage );
/** \brief Mutator for mUserDefinedRGBMinMaxFlag */
void setUserDefinedRGBMinMax(bool theBool);
/** \brief Propagate progress updates from GDAL up to the parent app */
void updateProgress( int, int );
/** \brief Accessor for mUserDefinedRGBMinMaxFlag. */
bool getUserDefinedRGBMinMax() const;
/** \brief Mutator for mUserDefinedGrayMinMaxFlag */
void setUserDefinedGrayMinMax(bool theBool);
/** \brief Accessor for mUserDefinedGrayMinMaxFlag. */
bool getUserDefinedGrayMinMax() const;
public slots:
/**
* Convert this raster to another format
*/
//void const convertTo();
/**
* Mainly inteded for use in propogating progress updates from gdal up to the parent app.
**/
void updateProgress(int,int);
/** \brief Create gdal pyramid overviews for this layer.
* This will speed up performance at the expense of hard drive space.
* Also, write access to the file is required for creating internal pyramids,
* and to the directory in which the files exists if external
* pyramids (.ovr) are to be created. If no paramter is passed in
* it will default to nearest neighbor resampling.
* @param theTryInternalFlag - Try to make the pyramids internal to
* the raster file if supported (e.g. geotiff). If not supported it
* will revert to creating external .ovr file anyway.
* \return null string on success, otherwise a string specifying error
*/
QString buildPyramids(const RasterPyramidList &,
const QString & theResamplingMethod="NEAREST",
bool theTryInternalFlag=false);
/** \brief Used at the moment by the above function but hopefully will later
be useable by any operation that needs to notify the user of its progress. */
/*
int showTextProgress( double theProgress,
const char *theMessageCharArray,
void *theData);
*/
signals:
/** \brief Signal for notifying listeners of long running processes */
void progressUpdate( int theValue );
/** Populate the histogram vector for a given layer
* @param theBandNoInt - which band to compute the histogram for
* @param theBinCountInt - how many 'bins' to categorise the data into
* @param theIgnoreOutOfRangeFlag - whether to ignore values that are out of range (default=true)
* @param theThoroughBandScanFlag - whether to visit each cell when computing the histogram (default=false)
*/
void populateHistogram(int theBandNoInt,
int theBinCountInt=256,
bool theIgnoreOutOfRangeFlag=true,
bool theThoroughBandScanFlag=false);
/** \brief Color table
* \param band number
* \return pointer to color table
*/
//QList<QgsColorRampShader::ColorRampItem>* getColorTable ( int theBandNoInt );
protected:
/** reads vector layer specific state from project file Dom node.
@note
protected:
Called by QgsMapLayer::readXML().
/** \brief Read the symbology for the current layer from the Dom node supplied */
bool readSymbology( const QDomNode& node, QString& errorMessage );
*/
/* virtual */ bool readXml( QDomNode & layer_node );
/** \brief Reads layer specific state from project file Dom node */
bool readXml( QDomNode & layer_node );
/** Read the symbology for the current layer from the Dom node supplied.
* @param QDomNode node that will contain the symbology definition for this layer.
* @param errorMessage reference to string that will be updated with any error messages
* @return true in case of success.
*/
bool readSymbology(const QDomNode& node, QString& errorMessage);
/** \brief Write the symbology for the layer into the docment provided */
bool writeSymbology( QDomNode&, QDomDocument& doc, QString& errorMessage ) const;
/** Write the symbology for the layer into the docment provided.
* @param QDomNode the node that will have the style element added to it.
* @param QDomDocument the document that will have the QDomNode added.
* @param errorMessage reference to string that will be updated with any error messages
* @return true in case of success.
*/
bool writeSymbology(QDomNode&, QDomDocument& doc, QString& errorMessage) const;
/** write vector layer specific state to project file Dom node.
@note
Called by QgsMapLayer::writeXML().
*/
/* virtual */ bool writeXml( QDomNode & layer_node, QDomDocument & doc );
/*
*
* New functions that will convert this class to a data provider interface
* (B Morley)
*
*/
public:
//! Constructor in provider mode
// TODO Rename into a general constructor when the old raster interface is retired
// \param dummy is just there to distinguish this function signature from the old non-provider one.
QgsRasterLayer(int dummy,
const QString & baseName = QString(),
const QString & path = QString(),
const QString & providerLib = QString(),
const QStringList & layers = QStringList(),
const QStringList & styles = QStringList(),
const QString & format = QString(),
const QString & crs = QString());
void setDataProvider( const QString & provider,
const QStringList & layers,
const QStringList & styles,
const QString & format,
const QString & crs);
//! Does this layer use a provider for setting/retrieving data?
bool usesProvider();
//! Which provider is being used for this Raster Layer?
QString providerKey();
public slots:
void showStatusMessage(const QString & theMessage);
/** \brief Write layer specific state to project file Dom node */
bool writeXml( QDomNode & layer_node, QDomDocument & doc );
};

View File

@ -391,7 +391,7 @@ void QgsLegendLayer::vectorLayerSymbology( const QgsVectorLayer* layer, double w
void QgsLegendLayer::rasterLayerSymbology( QgsRasterLayer* layer )
{
SymbologyList itemList;
QPixmap legendpixmap = layer->getLegendQPixmap( true ).scaled( 20, 20, Qt::KeepAspectRatio );
QPixmap legendpixmap = layer->legendAsPixmap( true ).scaled( 20, 20, Qt::KeepAspectRatio );
itemList.push_back( std::make_pair( "", legendpixmap ) );
changeSymbologySettings( layer, itemList );
@ -458,7 +458,7 @@ QPixmap QgsLegendLayer::getOriginalPixmap() const
{
QgsRasterLayer* rlayer = dynamic_cast<QgsRasterLayer*>( firstLayer );
QPixmap myPixmap( 32, 32 );
rlayer->drawThumbnail( &myPixmap );
rlayer->thumbnailAsPixmap( &myPixmap );
return myPixmap;
}
}

File diff suppressed because it is too large Load Diff

View File

@ -158,10 +158,10 @@ class QgsRasterLayerProperties : public QDialog, private Ui::QgsRasterLayerPrope
bool ignoreSpinBoxEvent;
/** \brief Flag to indicate if Gray minimum maximum values are actual minimum maximum values */
bool mGrayActualMinimumMaximum;
bool mGrayMinimumMaximumEstimated;
/** \brief Flag to indicate if RGB minimum maximum values are actual minimum maximum values */
bool mRGBActualMinimumMaximum;
bool mRGBMinimumMaximumEstimated;
/** \brief Pointer to the raster layer that this property dilog changes the behaviour of. */
QgsRasterLayer * mRasterLayer;

View File

@ -158,7 +158,7 @@ int QgsLegendModel::addRasterLayerItem( QStandardItem* layerItem, QgsMapLayer* r
return 2;
}
QStandardItem* currentSymbolItem = new QStandardItem( QIcon( rasterLayer->getLegendQPixmap( true ) ), "" );
QStandardItem* currentSymbolItem = new QStandardItem( QIcon( rasterLayer->legendAsPixmap( true ) ), "" );
int currentRowCount = layerItem->rowCount();
layerItem->setChild( currentRowCount, 0, currentSymbolItem );
@ -363,7 +363,7 @@ void QgsLegendModel::updateRasterClassificationItem( QStandardItem* classificati
return;
}
QStandardItem* currentSymbolItem = new QStandardItem( QIcon( rl->getLegendQPixmap( true ) ), "" );
QStandardItem* currentSymbolItem = new QStandardItem( QIcon( rl->legendAsPixmap( true ) ), "" );
parentItem->insertRow( 0, currentSymbolItem );
parentItem->removeRow( 1 );
}
@ -585,7 +585,7 @@ bool QgsLegendModel::readXML( const QDomElement& legendModelElem, const QDomDocu
QgsRasterLayer* rasterLayer = dynamic_cast<QgsRasterLayer*>( currentLayer );
if ( rasterLayer )
{
childItem->setIcon( QIcon( rasterLayer->getLegendQPixmap( true ) ) );
childItem->setIcon( QIcon( rasterLayer->legendAsPixmap( true ) ) );
}
layerItem->setChild( layerItem->rowCount(), 0, childItem );
}

View File

@ -198,7 +198,7 @@ bool QgsColorRampShader::interpolatedColor( double theValue, int* theReturnRedVa
return false;
}
void QgsColorRampShader::setColorRampType( QgsColorRampShader::COLOR_RAMP_TYPE theColorRampType )
void QgsColorRampShader::setColorRampType( QgsColorRampShader::ColorRamp_TYPE theColorRampType )
{
//When the ramp type changes we need to clear out the cache
mColorCache.clear();

View File

@ -46,7 +46,7 @@ class CORE_EXPORT QgsColorRampShader : public QgsRasterShaderFunction
QColor color;
};
enum COLOR_RAMP_TYPE
enum ColorRamp_TYPE
{
INTERPOLATED,
DISCRETE,
@ -57,7 +57,7 @@ class CORE_EXPORT QgsColorRampShader : public QgsRasterShaderFunction
QList<QgsColorRampShader::ColorRampItem> colorRampItemList() const {return mColorRampItemList;}
/** \brief Get the color ramp type */
QgsColorRampShader::COLOR_RAMP_TYPE colorRampType() {return mColorRampType;}
QgsColorRampShader::ColorRamp_TYPE colorRampType() {return mColorRampType;}
/** \brief Get the color ramp type as a string */
QString colorRampTypeAsQString();
@ -69,7 +69,7 @@ class CORE_EXPORT QgsColorRampShader : public QgsRasterShaderFunction
void setColorRampItemList( const QList<QgsColorRampShader::ColorRampItem>& theList ) { mColorRampItemList = theList; } //TODO: sort on set
/** \brief Set the color ramp type*/
void setColorRampType( QgsColorRampShader::COLOR_RAMP_TYPE theColorRampType );
void setColorRampType( QgsColorRampShader::ColorRamp_TYPE theColorRampType );
/** \brief Set the color ramp type*/
void setColorRampType( QString );
@ -87,11 +87,12 @@ class CORE_EXPORT QgsColorRampShader : public QgsRasterShaderFunction
/** Current index from which to start searching the color table*/
int mCurrentColorRampItemIndex;
//TODO: Consider pulling this out as a separate class and internally storing as a QMap rather than a QList
/** This vector holds the information for classification based on values. Each item holds a value, a label and a color. The member mDiscreteClassification holds if one color is applied for all values between two class breaks (true) or if the item values are (linearly) interpolated for values between the item values (false)*/
QList<QgsColorRampShader::ColorRampItem> mColorRampItemList;
/** \brief The color ramp type */
QgsColorRampShader::COLOR_RAMP_TYPE mColorRampType;
QgsColorRampShader::ColorRamp_TYPE mColorRampType;
/** \brief Cache of values that have already been looked up */
QMap<double, QColor> mColorCache;
@ -103,8 +104,10 @@ class CORE_EXPORT QgsColorRampShader : public QgsRasterShaderFunction
/** Gets the color for a pixel value from the classification vector mValueClassification. Assigns the color of the lower class for every pixel between two class breaks.*/
bool discreteColor( double, int*, int*, int* );
/** Gets the color for a pixel value from the classification vector mValueClassification. Assigns the color of the exact matching value in the color ramp item list */
bool exactColor( double, int*, int*, int* );
/** Gets the color for a pixel value from the classification vector mValueClassification. Interpolates the color between two class breaks linearly.*/
bool interpolatedColor( double, int*, int*, int* );
};

View File

@ -31,7 +31,7 @@ QgsContrastEnhancement::QgsContrastEnhancement( QgsRasterDataType theDataType )
mLookupTable = 0;
mContrastEnhancementFunction = 0;
mEnhancementDirty = false;
mContrastEnhancementAlgorithm = NO_STRETCH;
mContrastEnhancementAlgorithm = NoEnhancement;
mRasterDataType = theDataType;
mMinimumValue = minimumValuePossible( mRasterDataType );
@ -173,13 +173,13 @@ int QgsContrastEnhancement::enhanceContrast( double theValue )
generateLookupTable();
}
if ( mLookupTable && NO_STRETCH != mContrastEnhancementAlgorithm )
if ( mLookupTable && NoEnhancement != mContrastEnhancementAlgorithm )
{
return mLookupTable[static_cast <int>( theValue + mLookupTableOffset )];
}
else
{
// Even if the contrast enhancement algorithms is set to NO_STRETCH
// Even if the contrast enhancement algorithms is set to NoEnhancement
// The input values will still have to be scaled for all data types
// greater than 1 byte.
return mContrastEnhancementFunction->enhance( theValue );
@ -194,7 +194,7 @@ bool QgsContrastEnhancement::generateLookupTable()
mEnhancementDirty = false;
if ( 0 == mContrastEnhancementFunction ) { return false; }
if ( NO_STRETCH == mContrastEnhancementAlgorithm ) { return false; }
if ( NoEnhancement == mContrastEnhancementAlgorithm ) { return false; }
if ( QGS_Byte != mRasterDataType && QGS_UInt16 != mRasterDataType && QGS_Int16 != mRasterDataType ) { return false; }
if ( !mLookupTable ) { return false; }
@ -234,7 +234,7 @@ bool QgsContrastEnhancement::isValueInDisplayableRange( double theValue )
@param theAlgorithm The new contrast enhancement algorithm
@param generateTable Flag to overide automatic look up table generation
*/
void QgsContrastEnhancement::setContrastEnhancementAlgorithm( CONTRAST_ENHANCEMENT_ALGORITHM theAlgorithm, bool generateTable )
void QgsContrastEnhancement::setContrastEnhancementAlgorithm( ContrastEnhancementAlgorithm theAlgorithm, bool generateTable )
{
QgsDebugMsg( "called algorithm: " + QString::number(( int )theAlgorithm ) + " generate lookup table: " + QString::number(( int )generateTable ) );
@ -242,16 +242,16 @@ void QgsContrastEnhancement::setContrastEnhancementAlgorithm( CONTRAST_ENHANCEME
{
switch ( theAlgorithm )
{
case STRETCH_TO_MINMAX :
case StretchToMinimumMaximum :
mContrastEnhancementFunction = new QgsLinearMinMaxEnhancement( mRasterDataType, mMinimumValue, mMaximumValue );
break;
case STRETCH_AND_CLIP_TO_MINMAX :
case StretchAndClipToMinimumMaximum :
mContrastEnhancementFunction = new QgsLinearMinMaxEnhancementWithClip( mRasterDataType, mMinimumValue, mMaximumValue );
break;
case CLIP_TO_MINMAX :
case ClipToMinimumMaximum :
mContrastEnhancementFunction = new QgsClipToMinMaxEnhancement( mRasterDataType, mMinimumValue, mMaximumValue );
break;
case USER_DEFINED :
case UserDefined :
//Do nothing
break;
default:
@ -281,7 +281,7 @@ void QgsContrastEnhancement::setContrastEnhancementFunction( QgsContrastEnhancem
if ( 0 != theFunction )
{
mContrastEnhancementFunction = theFunction;
mContrastEnhancementAlgorithm = USER_DEFINED;
mContrastEnhancementAlgorithm = UserDefined;
generateLookupTable();
}
}

View File

@ -28,7 +28,7 @@ class QgsContrastEnhancementFunction;
/** \ingroup core
* Manipulates raster pixel values so that they enhanceContrast or clip into a
* specified numerical range according to the specified
* CONTRAST_ENHANCEMENT_ALGORITHM.
* ContrastEnhancementAlgorithm.
*/
class CORE_EXPORT QgsContrastEnhancement
{
@ -36,13 +36,13 @@ class CORE_EXPORT QgsContrastEnhancement
public:
/** \brief This enumerator describes the types of contrast enhancement algorithms that can be used. */
enum CONTRAST_ENHANCEMENT_ALGORITHM
enum ContrastEnhancementAlgorithm
{
NO_STRETCH, //this should be the default color scaling algorithm
STRETCH_TO_MINMAX, //linear histogram enhanceContrast
STRETCH_AND_CLIP_TO_MINMAX,
CLIP_TO_MINMAX,
USER_DEFINED
NoEnhancement, //this should be the default color scaling algorithm
StretchToMinimumMaximum, //linear histogram enhanceContrast
StretchAndClipToMinimumMaximum,
ClipToMinimumMaximum,
UserDefined
};
/** These are exactly the same as GDAL pixel data types
@ -94,7 +94,7 @@ class CORE_EXPORT QgsContrastEnhancement
/** \brief Return the minimum value for the contrast enhancement range. */
double minimumValue() const { return mMinimumValue; }
CONTRAST_ENHANCEMENT_ALGORITHM getContrastEnhancementAlgorithm() { return mContrastEnhancementAlgorithm; }
ContrastEnhancementAlgorithm contrastEnhancementAlgorithm() { return mContrastEnhancementAlgorithm; }
/*
*
@ -108,7 +108,7 @@ class CORE_EXPORT QgsContrastEnhancement
bool isValueInDisplayableRange( double );
/** \brief Set the contrast enhancement algorithm */
void setContrastEnhancementAlgorithm( CONTRAST_ENHANCEMENT_ALGORITHM, bool generateTable = true );
void setContrastEnhancementAlgorithm( ContrastEnhancementAlgorithm, bool generateTable = true );
/** \brief A public method that allows the user to set their own custom contrast enhancment function */
void setContrastEnhancementFunction( QgsContrastEnhancementFunction* );
@ -121,7 +121,7 @@ class CORE_EXPORT QgsContrastEnhancement
private:
/** \brief Current contrast enhancement algorithm */
CONTRAST_ENHANCEMENT_ALGORITHM mContrastEnhancementAlgorithm;
ContrastEnhancementAlgorithm mContrastEnhancementAlgorithm;
/** \brief Pointer to the contrast enhancement function */
QgsContrastEnhancementFunction* mContrastEnhancementFunction;

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -119,12 +119,12 @@ void TestQgsRasterLayer::isValid()
void TestQgsRasterLayer::pseudoColor()
{
mpRasterLayer->setDrawingStyle( QgsRasterLayer::SINGLE_BAND_PSEUDO_COLOR );
mpRasterLayer->setColorShadingAlgorithm( QgsRasterLayer::PSEUDO_COLOR );
mpRasterLayer->setDrawingStyle( QgsRasterLayer::SingleBandPseudoColor );
mpRasterLayer->setColorShadingAlgorithm( QgsRasterLayer::PseudoColor );
mpRasterLayer->setContrastEnhancementAlgorithm(
QgsContrastEnhancement::STRETCH_TO_MINMAX, false );
mpRasterLayer->setMinimumValue( mpRasterLayer->getGrayBandName(), 0.0, false );
mpRasterLayer->setMaximumValue( mpRasterLayer->getGrayBandName(), 10.0 );
QgsContrastEnhancement::StretchToMinimumMaximum, false );
mpRasterLayer->setMinimumValue( mpRasterLayer->grayBandName(), 0.0, false );
mpRasterLayer->setMaximumValue( mpRasterLayer->grayBandName(), 10.0 );
mpMapRenderer->setExtent( mpRasterLayer->extent() );
QVERIFY( render( "raster_pseudo" ) );
}
@ -149,11 +149,11 @@ void TestQgsRasterLayer::landsatBasic875Qml()
}
void TestQgsRasterLayer::checkDimensions()
{
QVERIFY( mpRasterLayer->getRasterXDim() == 10 );
QVERIFY( mpRasterLayer->getRasterYDim() == 10 );
QVERIFY( mpRasterLayer->width() == 10 );
QVERIFY( mpRasterLayer->height() == 10 );
// regression check for ticket #832
// note getRasterBandStats call is base 1
QVERIFY( mpRasterLayer->getRasterBandStats( 1 ).elementCount == 100 );
// note bandStatistics call is base 1
QVERIFY( mpRasterLayer->bandStatistics( 1 ).elementCount == 100 );
}
void TestQgsRasterLayer::buildExternalOverviews()
@ -174,7 +174,7 @@ void TestQgsRasterLayer::buildExternalOverviews()
//
bool myInternalFlag = false;
QgsRasterLayer::RasterPyramidList myPyramidList = mypLayer->buildRasterPyramidList();
QgsRasterLayer::RasterPyramidList myPyramidList = mypLayer->buildPyramidList();
for ( int myCounterInt = 0; myCounterInt < myPyramidList.count(); myCounterInt++ )
{
//mark to be pyramided
@ -190,7 +190,7 @@ void TestQgsRasterLayer::buildExternalOverviews()
//
// Lets verify we have pyramids now...
//
myPyramidList = mypLayer->buildRasterPyramidList();
myPyramidList = mypLayer->buildPyramidList();
for ( int myCounterInt = 0; myCounterInt < myPyramidList.count(); myCounterInt++ )
{
//mark to be pyramided