2017-06-02 23:35:10 +02:00
|
|
|
/************************************************************************
|
|
|
|
* This file has been generated automatically from *
|
|
|
|
* *
|
|
|
|
* src/core/raster/qgsrastertransparency.h *
|
|
|
|
* *
|
|
|
|
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
|
|
|
|
************************************************************************/
|
|
|
|
|
|
|
|
|
2008-01-11 06:42:56 +00:00
|
|
|
|
|
|
|
class QgsRasterTransparency
|
|
|
|
{
|
2017-06-02 23:35:10 +02:00
|
|
|
%Docstring
|
2017-12-15 10:36:55 -04:00
|
|
|
Defines the list of pixel values to be considered as transparent or semi
|
|
|
|
transparent when rendering rasters.
|
2008-01-11 06:42:56 +00:00
|
|
|
%End
|
|
|
|
|
2017-06-02 23:35:10 +02:00
|
|
|
%TypeHeaderCode
|
|
|
|
#include "qgsrastertransparency.h"
|
|
|
|
%End
|
2012-09-24 02:28:15 +02:00
|
|
|
public:
|
2017-09-11 21:55:20 +10:00
|
|
|
|
2008-01-11 06:42:56 +00:00
|
|
|
QgsRasterTransparency();
|
2017-09-11 21:55:20 +10:00
|
|
|
%Docstring
|
2017-12-15 10:36:55 -04:00
|
|
|
Constructor for QgsRasterTransparency.
|
2017-09-11 21:55:20 +10:00
|
|
|
%End
|
2012-09-24 02:28:15 +02:00
|
|
|
|
2008-01-11 06:42:56 +00:00
|
|
|
struct TransparentThreeValuePixel
|
|
|
|
{
|
|
|
|
double red;
|
|
|
|
double green;
|
|
|
|
double blue;
|
|
|
|
double percentTransparent;
|
|
|
|
};
|
|
|
|
|
|
|
|
struct TransparentSingleValuePixel
|
|
|
|
{
|
2012-08-22 19:40:37 +02:00
|
|
|
double min;
|
|
|
|
double max;
|
2008-01-11 06:42:56 +00:00
|
|
|
double percentTransparent;
|
|
|
|
};
|
2012-09-24 02:28:15 +02:00
|
|
|
|
2018-05-26 17:01:58 +10:00
|
|
|
|
2012-09-24 02:28:15 +02:00
|
|
|
QList<QgsRasterTransparency::TransparentSingleValuePixel> transparentSingleValuePixelList() const;
|
2017-06-02 23:35:10 +02:00
|
|
|
%Docstring
|
2018-05-26 17:01:58 +10:00
|
|
|
Returns the transparent single value pixel list.
|
|
|
|
|
|
|
|
.. seealso:: :py:func:`setTransparentSingleValuePixelList`
|
2017-06-02 23:35:10 +02:00
|
|
|
%End
|
2012-09-24 02:28:15 +02:00
|
|
|
|
|
|
|
QList<QgsRasterTransparency::TransparentThreeValuePixel> transparentThreeValuePixelList() const;
|
2017-06-02 23:35:10 +02:00
|
|
|
%Docstring
|
2018-05-26 17:01:58 +10:00
|
|
|
Returns the transparent three value pixel list.
|
|
|
|
|
|
|
|
.. seealso:: :py:func:`setTransparentThreeValuePixelList`
|
2017-06-02 23:35:10 +02:00
|
|
|
%End
|
2012-09-24 02:28:15 +02:00
|
|
|
|
2018-04-03 09:49:00 +10:00
|
|
|
void initializeTransparentPixelList( double value );
|
2017-06-02 23:35:10 +02:00
|
|
|
%Docstring
|
2018-04-03 09:49:00 +10:00
|
|
|
Resets the transparency list to a single ``value``.
|
2017-06-02 23:35:10 +02:00
|
|
|
%End
|
2012-09-24 02:28:15 +02:00
|
|
|
|
2018-04-03 09:49:00 +10:00
|
|
|
void initializeTransparentPixelList( double redValue, double greenValue, double blueValue );
|
2017-06-02 23:35:10 +02:00
|
|
|
%Docstring
|
2018-04-03 09:49:00 +10:00
|
|
|
Resets the transparency list to single red, green, and blue values.
|
2017-06-02 23:35:10 +02:00
|
|
|
%End
|
2008-01-11 06:42:56 +00:00
|
|
|
|
2018-05-26 14:25:21 +10:00
|
|
|
void setTransparentSingleValuePixelList( const QList<QgsRasterTransparency::TransparentSingleValuePixel> &newList );
|
2017-06-02 23:35:10 +02:00
|
|
|
%Docstring
|
2018-05-26 14:25:21 +10:00
|
|
|
Sets the transparent single value pixel list, replacing the whole existing list.
|
2018-05-26 17:01:58 +10:00
|
|
|
|
|
|
|
.. seealso:: :py:func:`transparentSingleValuePixelList`
|
2017-06-02 23:35:10 +02:00
|
|
|
%End
|
2012-09-24 02:28:15 +02:00
|
|
|
|
2018-05-26 14:25:21 +10:00
|
|
|
void setTransparentThreeValuePixelList( const QList<QgsRasterTransparency::TransparentThreeValuePixel> &newList );
|
2017-06-02 23:35:10 +02:00
|
|
|
%Docstring
|
2018-05-26 14:25:21 +10:00
|
|
|
Sets the transparent three value pixel list, replacing the whole existing list.
|
2018-05-26 17:01:58 +10:00
|
|
|
|
|
|
|
.. seealso:: :py:func:`transparentThreeValuePixelList`
|
2017-06-02 23:35:10 +02:00
|
|
|
%End
|
2012-09-24 02:28:15 +02:00
|
|
|
|
2018-04-03 09:49:00 +10:00
|
|
|
int alphaValue( double value, int globalTransparency = 255 ) const;
|
2017-06-02 23:35:10 +02:00
|
|
|
%Docstring
|
2018-04-03 09:49:00 +10:00
|
|
|
Returns the transparency value for a single ``value`` pixel.
|
|
|
|
|
|
|
|
Searches through the transparency list, and if a match is found, the global transparency value is scaled
|
|
|
|
by the stored transparency value.
|
|
|
|
|
|
|
|
:param value: the needle to search for in the transparency hay stack
|
|
|
|
:param globalTransparency: the overal transparency level for the layer
|
2017-06-02 23:35:10 +02:00
|
|
|
%End
|
2012-09-24 02:28:15 +02:00
|
|
|
|
2018-04-03 09:49:00 +10:00
|
|
|
|
|
|
|
int alphaValue( double redValue, double greenValue, double blueValue, int globalTransparency = 255 ) const;
|
2017-06-02 23:35:10 +02:00
|
|
|
%Docstring
|
2018-04-03 09:49:00 +10:00
|
|
|
Returns the transparency value for a RGB pixel.
|
|
|
|
|
|
|
|
Searches through the transparency list, if a match is found, the global transparency value is scaled
|
|
|
|
by the stored transparency value.
|
|
|
|
|
|
|
|
:param redValue: the red portion of the needle to search for in the transparency hay stack
|
2018-05-27 16:42:41 +10:00
|
|
|
:param greenValue: the green portion of the needle to search for in the transparency hay stack
|
2018-04-03 09:49:00 +10:00
|
|
|
:param blueValue: the green portion of the needle to search for in the transparency hay stack
|
|
|
|
:param globalTransparency: the overal transparency level for the layer
|
2017-06-02 23:35:10 +02:00
|
|
|
%End
|
2012-09-24 02:28:15 +02:00
|
|
|
|
2014-10-20 22:50:15 +02:00
|
|
|
bool isEmpty() const;
|
2017-06-02 23:35:10 +02:00
|
|
|
%Docstring
|
|
|
|
True if there are no entries in the pixel lists except the nodata value
|
|
|
|
%End
|
2012-09-24 02:28:15 +02:00
|
|
|
|
2017-05-01 18:13:15 +02:00
|
|
|
void writeXml( QDomDocument &doc, QDomElement &parentElem ) const;
|
2017-09-11 21:55:20 +10:00
|
|
|
%Docstring
|
2017-12-15 10:36:55 -04:00
|
|
|
Writes the transparency information to an XML document.
|
2017-09-11 21:55:20 +10:00
|
|
|
%End
|
2012-09-24 02:28:15 +02:00
|
|
|
|
2017-05-01 18:13:15 +02:00
|
|
|
void readXml( const QDomElement &elem );
|
2017-09-11 21:55:20 +10:00
|
|
|
%Docstring
|
2017-12-15 10:36:55 -04:00
|
|
|
Reads the transparency information from an XML document.
|
2017-09-11 21:55:20 +10:00
|
|
|
%End
|
2017-06-02 23:35:10 +02:00
|
|
|
|
2008-01-11 06:42:56 +00:00
|
|
|
};
|
2017-06-02 23:35:10 +02:00
|
|
|
/************************************************************************
|
|
|
|
* This file has been generated automatically from *
|
|
|
|
* *
|
|
|
|
* src/core/raster/qgsrastertransparency.h *
|
|
|
|
* *
|
|
|
|
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
|
|
|
|
************************************************************************/
|