Skip to content

Commit

Permalink
Api documentation updates - added class descriptions for all raster c…
Browse files Browse the repository at this point in the history
…lasses

git-svn-id: http://svn.osgeo.org/qgis/trunk@9226 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
timlinux committed Aug 31, 2008
1 parent 2f03fa0 commit 401b8e1
Show file tree
Hide file tree
Showing 18 changed files with 130 additions and 80 deletions.
2 changes: 1 addition & 1 deletion src/core/qgsdistancearea.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
class QgsGeometry;

/** \ingroup core
General purpose distance and area calculator
General purpose distance and area calculator.
- calculations are done on ellipsoid
- it's possible to pass points/features in any CRS, coordinates are transformed
- two options how to use it
Expand Down
6 changes: 6 additions & 0 deletions src/core/raster/qgscliptominmaxenhancement.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,12 @@ email : ersts@amnh.org

#include "qgscontrastenhancementfunction.h"

/** \ingroup core
* A raster contrast enhancement that will clip a value to the specified min/max range.
* For example if a min max range of [10,240] is specified in the constructor, and
* a value of 250 is called using enhanceValue(), the value will be truncated ('clipped')
* to 240.
*/
class CORE_EXPORT QgsClipToMinMaxEnhancement : public QgsContrastEnhancementFunction
{

Expand Down
3 changes: 3 additions & 0 deletions src/core/raster/qgscolorrampshader.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,9 @@ originally part of the larger QgsRasterLayer class

#include "qgsrastershaderfunction.h"

/** \ingroup core
* A ramp shader will color a raster pixel based on a list of values ranges in a ramp.
*/
class CORE_EXPORT QgsColorRampShader : public QgsRasterShaderFunction
{

Expand Down
21 changes: 12 additions & 9 deletions src/core/raster/qgscolortable.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,15 +19,6 @@

#include <QVector>

/*
* Because of performance, this class can store color rules in 2 forms:
* 1) discrete - vector of descrete values and their colors; can be accessed by index (from 0)
* 2) ramp - vector of ramps defined by min and max value and a color for min amd max value,
* colors between min and max are interpolated linearly.
*
* Only one type should be used for one instance.
*
*/


typedef struct
Expand All @@ -41,6 +32,18 @@ typedef struct
unsigned char min_c1, min_c2, min_c3, min_c4;
unsigned char max_c1, max_c2, max_c3, max_c4;
} RAMP;

/** \ingroup core
* A raster color table contains a list of indexed values and the color associated with each index.
* Because of performance, this class can store color rules in 2 forms:
* 1) discrete - vector of descrete values and their colors; can be accessed by index (from 0)
* 2) ramp - vector of ramps defined by min and max value and a color for min amd max value,
* colors between min and max are interpolated linearly.
*
* Only one type should be used for one instance.
*
*/

class CORE_EXPORT QgsColorTable
{
public:
Expand Down
2 changes: 0 additions & 2 deletions src/core/raster/qgscontrastenhancement.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,6 @@ class originally created circa 2004 by T.Sutton, Gary E.Sherman, Steve Halasz

QgsContrastEnhancement::QgsContrastEnhancement( QgsRasterDataType theDataType )
{
QgsDebugMsg( "called" );

mLookupTable = 0;
mContrastEnhancementFunction = 0;
mEnhancementDirty = false;
Expand Down
5 changes: 5 additions & 0 deletions src/core/raster/qgscontrastenhancement.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,11 @@ class originally created circa 2004 by T.Sutton, Gary E.Sherman, Steve Halasz

class QgsContrastEnhancementFunction;

/** \ingroup core
* Manipulates raster pixel values so that they stretch or clip into a
* specified numerical range according to the specified
* CONTRAST_ENHANCEMENT_ALGORITHM.
*/
class CORE_EXPORT QgsContrastEnhancement
{

Expand Down
6 changes: 6 additions & 0 deletions src/core/raster/qgscontrastenhancementfunction.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,12 @@ email : ersts@amnh.org

#include "qgscontrastenhancement.h"

/** \ingroup core
* A contrast enhancement funcion is the base class for all raster contrast enhancements.
*
* The purpose of a contrast enhancement is to stretch or clip a pixel value into
* a specified bounding range.
*/
class CORE_EXPORT QgsContrastEnhancementFunction
{

Expand Down
3 changes: 3 additions & 0 deletions src/core/raster/qgsfreakoutshader.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,9 @@ class originally created circa 2004 by T.Sutton, Gary E.Sherman, Steve Halasz

#include "qgsrastershaderfunction.h"

/** \ingroup core
* A colorful false color shader that will frighten your granny and make your dogs howl.
*/
class CORE_EXPORT QgsFreakOutShader : public QgsRasterShaderFunction
{

Expand Down
3 changes: 3 additions & 0 deletions src/core/raster/qgslinearminmaxenhancement.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,9 @@ email : ersts@amnh.org

#include "qgscontrastenhancementfunction.h"

/** \ingroup core
* A colour enhancement function that performs a linear stretch between min and max.
*/
class CORE_EXPORT QgsLinearMinMaxEnhancement : public QgsContrastEnhancementFunction
{

Expand Down
4 changes: 4 additions & 0 deletions src/core/raster/qgslinearminmaxenhancementwithclip.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,10 @@ email : ersts@amnh.org

#include "qgscontrastenhancementfunction.h"

/** \ingroup core
* A linear stretch enhancement that first clips to min max and then stretches
* linearly between min and max.
*/
class CORE_EXPORT QgsLinearMinMaxEnhancementWithClip : public QgsContrastEnhancementFunction
{

Expand Down
3 changes: 3 additions & 0 deletions src/core/raster/qgspseudocolorshader.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,9 @@ class originally created circa 2004 by T.Sutton, Gary E.Sherman, Steve Halasz

#include "qgsrastershaderfunction.h"

/** \ingroup core
* A raster color shader that highlighs low values in blue and high values in red.
*/
class CORE_EXPORT QgsPseudoColorShader : public QgsRasterShaderFunction
{

Expand Down
8 changes: 2 additions & 6 deletions src/core/raster/qgsrasterbandstats.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,6 @@
***************************************************************************/
/* $Id: qgsrasterlayer.h 4380 2005-12-26 23:37:50Z timlinux $ */

/** \file qgsrasterbandstats
* \brief This class provides statistics for a given raster band.
*
* The qgsrasterbandstats holds various stats relating to a given raster band.
*/
#ifndef QGSRASTERBANDSTATS
#define QGSRASTERBANDSTATS

Expand All @@ -30,7 +25,8 @@
#include <limits>

#include "qgscolortable.h"
/** \brief The RasterBandStats struct is a container for statistics about a single
/** \ingroup core
* The RasterBandStats struct is a container for statistics about a single
* raster band.
*/
class CORE_EXPORT QgsRasterBandStats
Expand Down
125 changes: 66 additions & 59 deletions src/core/raster/qgsrasterlayer.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,61 @@
***************************************************************************/
/* $Id$ */

/** \file qgsrasterlayer.h
* \brief This class provides qgis with the ability to render raster datasets
* onto the mapcanvas


#ifndef QGSRASTERLAYER_H
#define QGSRASTERLAYER_H

//
// Includes
//

#include <QColor>
#include <QDateTime>
#include <QVector>
#include <QList>
#include <QMap>

#include "qgis.h"
#include "qgspoint.h"
#include "qgsmaplayer.h"
#include "qgscontrastenhancement.h"
#include "qgsrastertransparency.h"
#include "qgsrastershader.h"
#include "qgscolorrampshader.h"
#include "qgsrastershaderfunction.h"
#include "qgsrasterdataprovider.h"


#define CPL_SUPRESS_CPLUSPLUS
#include <gdal.h>
/** \ingroup core
* A call back function for showing progress of gdal operations.
*/
int CPL_STDCALL progressCallback( double dfComplete,
const char *pszMessage,
void * pProgressArg );


//
// Forward declarations
//
class QgsColorTable;
class QgsMapToPixel;
class QgsRect;
class QgsRasterBandStats;
class QgsRasterPyramid;
class QgsRasterLayerProperties;
struct QgsRasterViewPort;
class QImage;
class QPixmap;
class QSlider;
class QLibrary;


/** \ingroup core
* This class provides qgis with the ability to render raster datasets
* onto the mapcanvas.
*
* The qgsrasterlayer class makes use of gdal for data io, and thus supports
* any gdal supported format. The constructor attempts to infer what type of
Expand Down Expand Up @@ -57,21 +109,29 @@
*
* Sample usage of the QgsRasterLayer class:
*
* \code
* QString myFileNameQString = "/path/to/file";
* QFileInfo myFileInfo(myFileNameQString);
* QString myBaseNameQString = myFileInfo.baseName();
* QgsRasterLayer *myRasterLayer = new QgsRasterLayer(myFileNameQString, myBaseNameQString);
*
* \endcode
*
* In order to automate redrawing of a raster layer, you should like it to a map canvas like this :
*
* \code
* QObject::connect( myRasterLayer, SIGNAL(repaintRequested()), mapCanvas, SLOT(refresh()) );
* \endcode
*
* A raster layer can also export its legend as a pixmap:
*
* \code
* QPixmap myQPixmap = myRasterLayer->legendPixmap();
* \endcode
*
* Once a layer has been created you can find out what type of layer it is (GRAY_OR_UNDEFINED, PALETTE or MULTIBAND):
*
* \code
* if (rasterLayer->getRasterLayerType()==QgsRasterLayer::MULTIBAND)
* {
* //do something
Expand All @@ -84,10 +144,12 @@
* {
* //do something.
* }
* \endcode
*
* You can combine layer type detection with the setDrawingStyle method to override the default drawing style assigned
* when a layer is loaded:
*
* \code
* if (rasterLayer->getRasterLayerType()==QgsRasterLayer::MULTIBAND)
* {
* myRasterLayer->setDrawingStyle(QgsRasterLayer::MULTI_BAND_SINGLE_BAND_PSEUDO_COLOR);
Expand All @@ -100,6 +162,7 @@
* {
* myRasterLayer->setDrawingStyle(QgsRasterLayer::SINGLE_BAND_PSEUDO_COLOR);
* }
* \endcode
*
* Raster layers can also have an arbitrary level of transparency defined, and have their
* color palettes inverted using the setTransparency and setInvertHistogramFlag methods.
Expand All @@ -116,62 +179,6 @@
* methods.
*/


#ifndef QGSRASTERLAYER_H
#define QGSRASTERLAYER_H

//
// Includes
//

#include <QColor>
#include <QDateTime>
#include <QVector>
#include <QList>
#include <QMap>

#include "qgis.h"
#include "qgspoint.h"
#include "qgsmaplayer.h"
#include "qgscontrastenhancement.h"
#include "qgsrastertransparency.h"
#include "qgsrastershader.h"
#include "qgscolorrampshader.h"
#include "qgsrastershaderfunction.h"
#include "qgsrasterdataprovider.h"


#define CPL_SUPRESS_CPLUSPLUS
#include <gdal.h>

int CPL_STDCALL progressCallback( double dfComplete,
const char *pszMessage,
void * pProgressArg );


//
// Forward declarations
//
class QgsColorTable;
class QgsMapToPixel;
class QgsRect;
class QgsRasterBandStats;
class QgsRasterPyramid;
class QgsRasterLayerProperties;
struct QgsRasterViewPort;
class QImage;
class QPixmap;
class QSlider;
class QLibrary;




/*! \class QgsRasterLayer
* \brief This class provides qgis with the ability to render raster datasets
* onto the mapcanvas..
*/

class CORE_EXPORT QgsRasterLayer : public QgsMapLayer
{
Q_OBJECT
Expand Down
4 changes: 3 additions & 1 deletion src/core/raster/qgsrasterpyramid.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,9 @@
***************************************************************************/
#ifndef QGSRASTERPYRAMID
#define QGSRASTERPYRAMID
/** \brief This struct is used to store pyramid info for the raster layer. */
/** \ingroup core
* This struct is used to store pyramid info for the raster layer.
*/
class CORE_EXPORT QgsRasterPyramid
{
public:
Expand Down
3 changes: 3 additions & 0 deletions src/core/raster/qgsrastershader.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,9 @@ email : ersts@amnh.org

#include "qgsrastershaderfunction.h"

/** \ingroup core
* Interface for all raster shaders.
*/
class CORE_EXPORT QgsRasterShader
{

Expand Down
4 changes: 4 additions & 0 deletions src/core/raster/qgsrastershaderfunction.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,10 @@ email : ersts@amnh.org

#ifndef QGSRASTERSHADERFUNCTION_H
#define QGSRASTERSHADERFUNCTION_H
/** \ingroup core
* The raster shade function applies a shader to a pixel at render time -
* typically used to render grayscale images as false color.
*/

class CORE_EXPORT QgsRasterShaderFunction
{
Expand Down
4 changes: 4 additions & 0 deletions src/core/raster/qgsrastertransparency.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,10 @@ email : ersts@amnh.org
#ifndef QGSRASTERTRANSPARENCY_H
#define QGSRASTERTRANSPARENCY_H

/** \ingroup core
* Defines the list of pixel values to be considered as transparent or semi
* transparent when rendering rasters.
*/
class CORE_EXPORT QgsRasterTransparency
{

Expand Down
4 changes: 2 additions & 2 deletions src/core/raster/qgsrasterviewport.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@

#include <qgspoint.h>

/** \file qgsrasterviewport.h
* \brief This class provides details of the viewable area that a raster will
/** \ingroup core
* This class provides details of the viewable area that a raster will
* be rendered into.
*
* The qgsrasterviewport class sets up a viewport / area of interest to be used
Expand Down

0 comments on commit 401b8e1

Please sign in to comment.