QGIS API Documentation
2.4.0-Chugiak
|
A graphics effect which can be applied to a widget to simulate various printing and color blindness modes. More...
#include <qgsprevieweffect.h>
Public Types | |
enum | PreviewMode { PreviewGrayscale, PreviewMono, PreviewProtanope, PreviewDeuteranope } |
Public Member Functions | |
QgsPreviewEffect (QObject *parent) | |
~QgsPreviewEffect () | |
void | setMode (PreviewMode mode) |
Sets the mode for the preview effect, which controls how the effect modifies a widgets appearance. More... | |
PreviewMode | mode () const |
Returns the mode used for the preview effect. More... | |
Protected Member Functions | |
virtual void | draw (QPainter *painter) |
Private Member Functions | |
QRgb | simulateColorBlindness (QRgb &originalColor, PreviewMode type) |
void | simulateProtanopeLMS (double &L, double &M, double &S) |
void | simulateDeuteranopeLMS (double &L, double &M, double &S) |
Private Attributes | |
PreviewMode | mMode |
A graphics effect which can be applied to a widget to simulate various printing and color blindness modes.
Definition at line 28 of file qgsprevieweffect.h.
Enumerator | |
---|---|
PreviewGrayscale | |
PreviewMono | |
PreviewProtanope | |
PreviewDeuteranope |
Definition at line 33 of file qgsprevieweffect.h.
QgsPreviewEffect::QgsPreviewEffect | ( | QObject * | parent | ) |
Definition at line 22 of file qgsprevieweffect.cpp.
QgsPreviewEffect::~QgsPreviewEffect | ( | ) |
Definition at line 30 of file qgsprevieweffect.cpp.
|
protectedvirtual |
Definition at line 41 of file qgsprevieweffect.cpp.
References mMode, PreviewDeuteranope, PreviewGrayscale, PreviewMono, PreviewProtanope, and simulateColorBlindness().
|
inline |
Returns the mode used for the preview effect.
Definition at line 55 of file qgsprevieweffect.h.
Referenced by QgsMapCanvas::previewMode(), and setMode().
void QgsPreviewEffect::setMode | ( | QgsPreviewEffect::PreviewMode | mode | ) |
Sets the mode for the preview effect, which controls how the effect modifies a widgets appearance.
mode | PreviewMode to use to draw the widget |
Definition at line 35 of file qgsprevieweffect.cpp.
Referenced by QgsComposerView::setPreviewMode(), and QgsMapCanvas::setPreviewMode().
|
private |
Definition at line 106 of file qgsprevieweffect.cpp.
References PreviewDeuteranope, PreviewProtanope, simulateDeuteranopeLMS(), and simulateProtanopeLMS().
Referenced by draw().
|
private |
Definition at line 152 of file qgsprevieweffect.cpp.
Referenced by simulateColorBlindness().
|
private |
Definition at line 145 of file qgsprevieweffect.cpp.
Referenced by simulateColorBlindness().
|
private |
Definition at line 62 of file qgsprevieweffect.h.