1 /*************************************************************************** 2 qgspainting.h 3 --------------------- 4 begin : July 2016 5 copyright : (C) 2016 by Martin Dobias 6 email : wonder dot sk at gmail dot com 7 *************************************************************************** 8 * * 9 * This program is free software; you can redistribute it and/or modify * 10 * it under the terms of the GNU General Public License as published by * 11 * the Free Software Foundation; either version 2 of the License, or * 12 * (at your option) any later version. * 13 * * 14 ***************************************************************************/ 15 #ifndef QGSPAINTING_H 16 #define QGSPAINTING_H 17 18 #include <QPainter> 19 20 #include "qgis_core.h" 21 22 /** 23 * \ingroup core 24 * \brief Misc painting enums and functions. 25 * 26 * \since QGIS 3.0 27 */ 28 class CORE_EXPORT QgsPainting 29 { 30 public: 31 32 /** 33 * Blending modes enum defining the available composition modes that can 34 * be used when rendering a layer 35 */ 36 enum BlendMode 37 { 38 BlendNormal, 39 BlendLighten, 40 BlendScreen, 41 BlendDodge, 42 BlendAddition, 43 BlendDarken, 44 BlendMultiply, 45 BlendBurn, 46 BlendOverlay, 47 BlendSoftLight, 48 BlendHardLight, 49 BlendDifference, 50 BlendSubtract, 51 BlendSource, 52 BlendDestinationOver, 53 BlendClear, 54 BlendDestination, 55 BlendSourceIn, 56 BlendDestinationIn, 57 BlendSourceOut, 58 BlendDestinationOut, 59 BlendSourceAtop, 60 BlendDestinationAtop, 61 BlendXor, 62 }; 63 64 //! Returns a QPainter::CompositionMode corresponding to a BlendMode 65 static QPainter::CompositionMode getCompositionMode( QgsPainting::BlendMode blendMode ); 66 //! Returns a BlendMode corresponding to a QPainter::CompositionMode 67 static QgsPainting::BlendMode getBlendModeEnum( QPainter::CompositionMode blendMode ); 68 69 }; 70 71 #endif // QGSPAINTING_H 72