Skip to content

Commit 3a7bcd4

Browse files
author
timlinux
committedAug 31, 2008
Api documentation updates - added class descriptions for all raster classes
git-svn-id: http://svn.osgeo.org/qgis/trunk/qgis@9226 c8812cc2-4d05-0410-92ff-de0c093fc19c

18 files changed

+130
-80
lines changed
 

‎src/core/qgsdistancearea.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
class QgsGeometry;
2424

2525
/** \ingroup core
26-
General purpose distance and area calculator
26+
General purpose distance and area calculator.
2727
- calculations are done on ellipsoid
2828
- it's possible to pass points/features in any CRS, coordinates are transformed
2929
- two options how to use it

‎src/core/raster/qgscliptominmaxenhancement.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,12 @@ email : ersts@amnh.org
2121

2222
#include "qgscontrastenhancementfunction.h"
2323

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

‎src/core/raster/qgscolorrampshader.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,9 @@ originally part of the larger QgsRasterLayer class
2525

2626
#include "qgsrastershaderfunction.h"
2727

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

‎src/core/raster/qgscolortable.h

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -19,15 +19,6 @@
1919

2020
#include <QVector>
2121

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

3223

3324
typedef struct
@@ -41,6 +32,18 @@ typedef struct
4132
unsigned char min_c1, min_c2, min_c3, min_c4;
4233
unsigned char max_c1, max_c2, max_c3, max_c4;
4334
} RAMP;
35+
36+
/** \ingroup core
37+
* A raster color table contains a list of indexed values and the color associated with each index.
38+
* Because of performance, this class can store color rules in 2 forms:
39+
* 1) discrete - vector of descrete values and their colors; can be accessed by index (from 0)
40+
* 2) ramp - vector of ramps defined by min and max value and a color for min amd max value,
41+
* colors between min and max are interpolated linearly.
42+
*
43+
* Only one type should be used for one instance.
44+
*
45+
*/
46+
4447
class CORE_EXPORT QgsColorTable
4548
{
4649
public:

‎src/core/raster/qgscontrastenhancement.cpp

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,6 @@ class originally created circa 2004 by T.Sutton, Gary E.Sherman, Steve Halasz
2828

2929
QgsContrastEnhancement::QgsContrastEnhancement( QgsRasterDataType theDataType )
3030
{
31-
QgsDebugMsg( "called" );
32-
3331
mLookupTable = 0;
3432
mContrastEnhancementFunction = 0;
3533
mEnhancementDirty = false;

‎src/core/raster/qgscontrastenhancement.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,11 @@ class originally created circa 2004 by T.Sutton, Gary E.Sherman, Steve Halasz
2525

2626
class QgsContrastEnhancementFunction;
2727

28+
/** \ingroup core
29+
* Manipulates raster pixel values so that they stretch or clip into a
30+
* specified numerical range according to the specified
31+
* CONTRAST_ENHANCEMENT_ALGORITHM.
32+
*/
2833
class CORE_EXPORT QgsContrastEnhancement
2934
{
3035

‎src/core/raster/qgscontrastenhancementfunction.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,12 @@ email : ersts@amnh.org
2121

2222
#include "qgscontrastenhancement.h"
2323

24+
/** \ingroup core
25+
* A contrast enhancement funcion is the base class for all raster contrast enhancements.
26+
*
27+
* The purpose of a contrast enhancement is to stretch or clip a pixel value into
28+
* a specified bounding range.
29+
*/
2430
class CORE_EXPORT QgsContrastEnhancementFunction
2531
{
2632

‎src/core/raster/qgsfreakoutshader.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,9 @@ class originally created circa 2004 by T.Sutton, Gary E.Sherman, Steve Halasz
2323

2424
#include "qgsrastershaderfunction.h"
2525

26+
/** \ingroup core
27+
* A colorful false color shader that will frighten your granny and make your dogs howl.
28+
*/
2629
class CORE_EXPORT QgsFreakOutShader : public QgsRasterShaderFunction
2730
{
2831

‎src/core/raster/qgslinearminmaxenhancement.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,9 @@ email : ersts@amnh.org
2121

2222
#include "qgscontrastenhancementfunction.h"
2323

24+
/** \ingroup core
25+
* A colour enhancement function that performs a linear stretch between min and max.
26+
*/
2427
class CORE_EXPORT QgsLinearMinMaxEnhancement : public QgsContrastEnhancementFunction
2528
{
2629

‎src/core/raster/qgslinearminmaxenhancementwithclip.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,10 @@ email : ersts@amnh.org
2121

2222
#include "qgscontrastenhancementfunction.h"
2323

24+
/** \ingroup core
25+
* A linear stretch enhancement that first clips to min max and then stretches
26+
* linearly between min and max.
27+
*/
2428
class CORE_EXPORT QgsLinearMinMaxEnhancementWithClip : public QgsContrastEnhancementFunction
2529
{
2630

‎src/core/raster/qgspseudocolorshader.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,9 @@ class originally created circa 2004 by T.Sutton, Gary E.Sherman, Steve Halasz
2323

2424
#include "qgsrastershaderfunction.h"
2525

26+
/** \ingroup core
27+
* A raster color shader that highlighs low values in blue and high values in red.
28+
*/
2629
class CORE_EXPORT QgsPseudoColorShader : public QgsRasterShaderFunction
2730
{
2831

‎src/core/raster/qgsrasterbandstats.h

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,6 @@
1616
***************************************************************************/
1717
/* $Id: qgsrasterlayer.h 4380 2005-12-26 23:37:50Z timlinux $ */
1818

19-
/** \file qgsrasterbandstats
20-
* \brief This class provides statistics for a given raster band.
21-
*
22-
* The qgsrasterbandstats holds various stats relating to a given raster band.
23-
*/
2419
#ifndef QGSRASTERBANDSTATS
2520
#define QGSRASTERBANDSTATS
2621

@@ -30,7 +25,8 @@
3025
#include <limits>
3126

3227
#include "qgscolortable.h"
33-
/** \brief The RasterBandStats struct is a container for statistics about a single
28+
/** \ingroup core
29+
* The RasterBandStats struct is a container for statistics about a single
3430
* raster band.
3531
*/
3632
class CORE_EXPORT QgsRasterBandStats

‎src/core/raster/qgsrasterlayer.h

Lines changed: 66 additions & 59 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,61 @@
1616
***************************************************************************/
1717
/* $Id$ */
1818

19-
/** \file qgsrasterlayer.h
20-
* \brief This class provides qgis with the ability to render raster datasets
21-
* onto the mapcanvas
19+
20+
21+
#ifndef QGSRASTERLAYER_H
22+
#define QGSRASTERLAYER_H
23+
24+
//
25+
// Includes
26+
//
27+
28+
#include <QColor>
29+
#include <QDateTime>
30+
#include <QVector>
31+
#include <QList>
32+
#include <QMap>
33+
34+
#include "qgis.h"
35+
#include "qgspoint.h"
36+
#include "qgsmaplayer.h"
37+
#include "qgscontrastenhancement.h"
38+
#include "qgsrastertransparency.h"
39+
#include "qgsrastershader.h"
40+
#include "qgscolorrampshader.h"
41+
#include "qgsrastershaderfunction.h"
42+
#include "qgsrasterdataprovider.h"
43+
44+
45+
#define CPL_SUPRESS_CPLUSPLUS
46+
#include <gdal.h>
47+
/** \ingroup core
48+
* A call back function for showing progress of gdal operations.
49+
*/
50+
int CPL_STDCALL progressCallback( double dfComplete,
51+
const char *pszMessage,
52+
void * pProgressArg );
53+
54+
55+
//
56+
// Forward declarations
57+
//
58+
class QgsColorTable;
59+
class QgsMapToPixel;
60+
class QgsRect;
61+
class QgsRasterBandStats;
62+
class QgsRasterPyramid;
63+
class QgsRasterLayerProperties;
64+
struct QgsRasterViewPort;
65+
class QImage;
66+
class QPixmap;
67+
class QSlider;
68+
class QLibrary;
69+
70+
71+
/** \ingroup core
72+
* This class provides qgis with the ability to render raster datasets
73+
* onto the mapcanvas.
2274
*
2375
* The qgsrasterlayer class makes use of gdal for data io, and thus supports
2476
* any gdal supported format. The constructor attempts to infer what type of
@@ -57,21 +109,29 @@
57109
*
58110
* Sample usage of the QgsRasterLayer class:
59111
*
112+
* \code
60113
* QString myFileNameQString = "/path/to/file";
61114
* QFileInfo myFileInfo(myFileNameQString);
62115
* QString myBaseNameQString = myFileInfo.baseName();
63116
* QgsRasterLayer *myRasterLayer = new QgsRasterLayer(myFileNameQString, myBaseNameQString);
64117
*
118+
* \endcode
119+
*
65120
* In order to automate redrawing of a raster layer, you should like it to a map canvas like this :
66121
*
122+
* \code
67123
* QObject::connect( myRasterLayer, SIGNAL(repaintRequested()), mapCanvas, SLOT(refresh()) );
124+
* \endcode
68125
*
69126
* A raster layer can also export its legend as a pixmap:
70127
*
128+
* \code
71129
* QPixmap myQPixmap = myRasterLayer->legendPixmap();
130+
* \endcode
72131
*
73132
* Once a layer has been created you can find out what type of layer it is (GRAY_OR_UNDEFINED, PALETTE or MULTIBAND):
74133
*
134+
* \code
75135
* if (rasterLayer->getRasterLayerType()==QgsRasterLayer::MULTIBAND)
76136
* {
77137
* //do something
@@ -84,10 +144,12 @@
84144
* {
85145
* //do something.
86146
* }
147+
* \endcode
87148
*
88149
* You can combine layer type detection with the setDrawingStyle method to override the default drawing style assigned
89150
* when a layer is loaded:
90151
*
152+
* \code
91153
* if (rasterLayer->getRasterLayerType()==QgsRasterLayer::MULTIBAND)
92154
* {
93155
* myRasterLayer->setDrawingStyle(QgsRasterLayer::MULTI_BAND_SINGLE_BAND_PSEUDO_COLOR);
@@ -100,6 +162,7 @@
100162
* {
101163
* myRasterLayer->setDrawingStyle(QgsRasterLayer::SINGLE_BAND_PSEUDO_COLOR);
102164
* }
165+
* \endcode
103166
*
104167
* Raster layers can also have an arbitrary level of transparency defined, and have their
105168
* color palettes inverted using the setTransparency and setInvertHistogramFlag methods.
@@ -116,62 +179,6 @@
116179
* methods.
117180
*/
118181

119-
120-
#ifndef QGSRASTERLAYER_H
121-
#define QGSRASTERLAYER_H
122-
123-
//
124-
// Includes
125-
//
126-
127-
#include <QColor>
128-
#include <QDateTime>
129-
#include <QVector>
130-
#include <QList>
131-
#include <QMap>
132-
133-
#include "qgis.h"
134-
#include "qgspoint.h"
135-
#include "qgsmaplayer.h"
136-
#include "qgscontrastenhancement.h"
137-
#include "qgsrastertransparency.h"
138-
#include "qgsrastershader.h"
139-
#include "qgscolorrampshader.h"
140-
#include "qgsrastershaderfunction.h"
141-
#include "qgsrasterdataprovider.h"
142-
143-
144-
#define CPL_SUPRESS_CPLUSPLUS
145-
#include <gdal.h>
146-
147-
int CPL_STDCALL progressCallback( double dfComplete,
148-
const char *pszMessage,
149-
void * pProgressArg );
150-
151-
152-
//
153-
// Forward declarations
154-
//
155-
class QgsColorTable;
156-
class QgsMapToPixel;
157-
class QgsRect;
158-
class QgsRasterBandStats;
159-
class QgsRasterPyramid;
160-
class QgsRasterLayerProperties;
161-
struct QgsRasterViewPort;
162-
class QImage;
163-
class QPixmap;
164-
class QSlider;
165-
class QLibrary;
166-
167-
168-
169-
170-
/*! \class QgsRasterLayer
171-
* \brief This class provides qgis with the ability to render raster datasets
172-
* onto the mapcanvas..
173-
*/
174-
175182
class CORE_EXPORT QgsRasterLayer : public QgsMapLayer
176183
{
177184
Q_OBJECT

‎src/core/raster/qgsrasterpyramid.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,9 @@
1717
***************************************************************************/
1818
#ifndef QGSRASTERPYRAMID
1919
#define QGSRASTERPYRAMID
20-
/** \brief This struct is used to store pyramid info for the raster layer. */
20+
/** \ingroup core
21+
* This struct is used to store pyramid info for the raster layer.
22+
*/
2123
class CORE_EXPORT QgsRasterPyramid
2224
{
2325
public:

‎src/core/raster/qgsrastershader.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,9 @@ email : ersts@amnh.org
2222

2323
#include "qgsrastershaderfunction.h"
2424

25+
/** \ingroup core
26+
* Interface for all raster shaders.
27+
*/
2528
class CORE_EXPORT QgsRasterShader
2629
{
2730

‎src/core/raster/qgsrastershaderfunction.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,10 @@ email : ersts@amnh.org
1919

2020
#ifndef QGSRASTERSHADERFUNCTION_H
2121
#define QGSRASTERSHADERFUNCTION_H
22+
/** \ingroup core
23+
* The raster shade function applies a shader to a pixel at render time -
24+
* typically used to render grayscale images as false color.
25+
*/
2226

2327
class CORE_EXPORT QgsRasterShaderFunction
2428
{

‎src/core/raster/qgsrastertransparency.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,10 @@ email : ersts@amnh.org
1818
#ifndef QGSRASTERTRANSPARENCY_H
1919
#define QGSRASTERTRANSPARENCY_H
2020

21+
/** \ingroup core
22+
* Defines the list of pixel values to be considered as transparent or semi
23+
* transparent when rendering rasters.
24+
*/
2125
class CORE_EXPORT QgsRasterTransparency
2226
{
2327

‎src/core/raster/qgsrasterviewport.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,8 @@
2020

2121
#include <qgspoint.h>
2222

23-
/** \file qgsrasterviewport.h
24-
* \brief This class provides details of the viewable area that a raster will
23+
/** \ingroup core
24+
* This class provides details of the viewable area that a raster will
2525
* be rendered into.
2626
*
2727
* The qgsrasterviewport class sets up a viewport / area of interest to be used

0 commit comments

Comments
 (0)
Please sign in to comment.