Skip to content

Commit

Permalink
doxymentation
Browse files Browse the repository at this point in the history
  • Loading branch information
alexbruy committed Jun 30, 2020
1 parent 0214b4f commit 9734b76
Show file tree
Hide file tree
Showing 3 changed files with 114 additions and 1 deletion.
2 changes: 1 addition & 1 deletion python/core/auto_additions/qgsrasterpipe.py
Expand Up @@ -2,5 +2,5 @@
# monkey patching scoped based enum
QgsRasterPipe.ResamplingStage.ResampleFilter.__doc__ = ""
QgsRasterPipe.ResamplingStage.Provider.__doc__ = ""
QgsRasterPipe.ResamplingStage.__doc__ = 'Stage at which resampling occurs.\n@since QGIS 3.16\n\n' + '* ``ResampleFilter``: ' + QgsRasterPipe.ResamplingStage.ResampleFilter.__doc__ + '\n' + '* ``Provider``: ' + QgsRasterPipe.ResamplingStage.Provider.__doc__
QgsRasterPipe.ResamplingStage.__doc__ = 'Stage at which resampling occurs.\n\n.. versionadded:: 3.16\n\n' + '* ``ResampleFilter``: ' + QgsRasterPipe.ResamplingStage.ResampleFilter.__doc__ + '\n' + '* ``Provider``: ' + QgsRasterPipe.ResamplingStage.Provider.__doc__
# --
Expand Up @@ -24,30 +24,94 @@ Brightness/contrast and gamma correction filter pipe for rasters.

virtual QgsBrightnessContrastFilter *clone() const /Factory/;

%Docstring
Clone itself, create deep copy
%End

virtual int bandCount() const;

%Docstring
Gets number of bands
%End

virtual Qgis::DataType dataType( int bandNo ) const;

%Docstring
Returns data type for the band specified by number
%End

virtual bool setInput( QgsRasterInterface *input );

%Docstring
Set input.
Returns ``True`` if set correctly, ``False`` if cannot use that input
%End

virtual QgsRasterBlock *block( int bandNo, const QgsRectangle &extent, int width, int height, QgsRasterBlockFeedback *feedback = 0 ) /Factory/;

%Docstring
Read block of data using given extent and size.
Returns pointer to data.
Caller is responsible to free the memory returned.

:param bandNo: band number
:param extent: extent of block
:param width: pixel width of block
:param height: pixel height of block
:param feedback: optional raster feedback object for cancellation/preview. Added in QGIS 3.0.
%End

void setBrightness( int brightness );
%Docstring
Set brightness level. Acceptable value range is -255…255

.. seealso:: :py:func:`brightness`
%End

int brightness() const;
%Docstring
Returns currect brightness level.

.. seealso:: :py:func:`setBrightness`
%End

void setContrast( int contrast );
%Docstring
Set contrast level. Acceptable value range is -100…100

.. seealso:: :py:func:`contrast`
%End

int contrast() const;
%Docstring
Returns currect contrast level.

.. seealso:: :py:func:`setContrast`
%End

void setGamma( double gamma );
%Docstring
Set gamma value. Acceptable value range is -0.1…10

.. seealso:: :py:func:`gamma`

.. versionadded:: 3.16
%End

double gamma() const;
%Docstring
Returns currect gamma value.

.. seealso:: :py:func:`setGamma`

.. versionadded:: 3.16
%End

virtual void writeXml( QDomDocument &doc, QDomElement &parentElem ) const;

%Docstring
Write base class members to xml.
%End

virtual void readXml( const QDomElement &filterElem );

Expand Down
49 changes: 49 additions & 0 deletions src/core/raster/qgsbrightnesscontrastfilter.h
Expand Up @@ -33,25 +33,74 @@ class CORE_EXPORT QgsBrightnessContrastFilter : public QgsRasterInterface
public:
QgsBrightnessContrastFilter( QgsRasterInterface *input = nullptr );

//! Clone itself, create deep copy
QgsBrightnessContrastFilter *clone() const override SIP_FACTORY;

//! Gets number of bands
int bandCount() const override;

//! Returns data type for the band specified by number
Qgis::DataType dataType( int bandNo ) const override;

/**
* Set input.
* Returns TRUE if set correctly, FALSE if cannot use that input
*/
bool setInput( QgsRasterInterface *input ) override;

/**
* Read block of data using given extent and size.
* Returns pointer to data.
* Caller is responsible to free the memory returned.
* \param bandNo band number
* \param extent extent of block
* \param width pixel width of block
* \param height pixel height of block
* \param feedback optional raster feedback object for cancellation/preview. Added in QGIS 3.0.
*/
QgsRasterBlock *block( int bandNo, const QgsRectangle &extent, int width, int height, QgsRasterBlockFeedback *feedback = nullptr ) override SIP_FACTORY;

/**
* Set brightness level. Acceptable value range is -255…255
* \see brightness()
*/
void setBrightness( int brightness ) { mBrightness = qBound( -255, brightness, 255 ); }

/**
* Returns currect brightness level.
* \see setBrightness()
*/
int brightness() const { return mBrightness; }

/**
* Set contrast level. Acceptable value range is -100…100
* \see contrast()
*/
void setContrast( int contrast ) { mContrast = qBound( -100, contrast, 100 ); }

/**
* Returns currect contrast level.
* \see setContrast()
*/
int contrast() const { return mContrast; }

/**
* Set gamma value. Acceptable value range is -0.1…10
* \see gamma()
*
* \since QGIS 3.16
*/
void setGamma( double gamma ) { mGamma = qBound( 0.1, gamma, 10.0 ); }

/**
* Returns currect gamma value.
* \see setGamma()
*
* \since QGIS 3.16
*/
double gamma() const { return mGamma; }

//! Write base class members to xml.
void writeXml( QDomDocument &doc, QDomElement &parentElem ) const override;

//! Sets base class members from xml. Usually called from create() methods of subclasses
Expand Down

0 comments on commit 9734b76

Please sign in to comment.