18#include "moc_qgspainteffectwidget.cpp"
39 connect( mDrawModeComboBox,
static_cast<void ( QComboBox::* )(
int )
>( &QComboBox::currentIndexChanged ),
this, &QgsDrawSourceWidget::mDrawModeComboBox_currentIndexChanged );
40 connect( mBlendCmbBx,
static_cast<void ( QComboBox::* )(
int )
>( &QComboBox::currentIndexChanged ),
this, &QgsDrawSourceWidget::mBlendCmbBx_currentIndexChanged );
47 if ( !effect || effect->
type() != QLatin1String(
"drawSource" ) )
56void QgsDrawSourceWidget::initGui()
65 mOpacityWidget->setOpacity( mEffect->
opacity() );
66 mBlendCmbBx->setBlendMode( mEffect->
blendMode() );
67 mDrawModeComboBox->setDrawMode( mEffect->
drawMode() );
69 blockSignals(
false );
72void QgsDrawSourceWidget::blockSignals(
const bool block )
74 mOpacityWidget->blockSignals( block );
75 mBlendCmbBx->blockSignals( block );
76 mDrawModeComboBox->blockSignals( block );
79void QgsDrawSourceWidget::opacityChanged(
double value )
88void QgsDrawSourceWidget::mDrawModeComboBox_currentIndexChanged(
int index )
95 mEffect->
setDrawMode( mDrawModeComboBox->drawMode() );
99void QgsDrawSourceWidget::mBlendCmbBx_currentIndexChanged(
int index )
120 connect( mBlurTypeCombo,
static_cast<void ( QComboBox::* )(
int )
>( &QComboBox::currentIndexChanged ),
this, &QgsBlurWidget::mBlurTypeCombo_currentIndexChanged );
121 connect( mBlurStrengthSpnBx,
static_cast<void ( QDoubleSpinBox::* )(
double )
>( &QDoubleSpinBox::valueChanged ),
this, &QgsBlurWidget::mBlurStrengthSpnBx_valueChanged );
123 connect( mDrawModeComboBox,
static_cast<void ( QComboBox::* )(
int )
>( &QComboBox::currentIndexChanged ),
this, &QgsBlurWidget::mDrawModeComboBox_currentIndexChanged );
124 connect( mBlendCmbBx,
static_cast<void ( QComboBox::* )(
int )
>( &QComboBox::currentIndexChanged ),
this, &QgsBlurWidget::mBlendCmbBx_currentIndexChanged );
138 if ( !effect || effect->
type() != QLatin1String(
"blur" ) )
145void QgsBlurWidget::initGui()
152 blockSignals(
true );
154 mBlurTypeCombo->setCurrentIndex( mBlurTypeCombo->findData( mEffect->
blurMethod() ) );
155 mBlurStrengthSpnBx->setValue( mEffect->
blurLevel() );
156 mOpacityWidget->setOpacity( mEffect->
opacity() );
157 mBlendCmbBx->setBlendMode( mEffect->
blendMode() );
158 mDrawModeComboBox->setDrawMode( mEffect->
drawMode() );
160 mBlurUnitWidget->setUnit( mEffect->
blurUnit() );
163 blockSignals(
false );
166void QgsBlurWidget::blockSignals(
const bool block )
168 mBlurTypeCombo->blockSignals( block );
169 mBlurStrengthSpnBx->blockSignals( block );
170 mOpacityWidget->blockSignals( block );
171 mBlendCmbBx->blockSignals( block );
172 mDrawModeComboBox->blockSignals( block );
175void QgsBlurWidget::mBlurTypeCombo_currentIndexChanged(
int index )
187 mBlurStrengthSpnBx->setMaximum( 16 );
190 mBlurStrengthSpnBx->setMaximum( 200 );
197void QgsBlurWidget::mBlurStrengthSpnBx_valueChanged(
double value )
206void QgsBlurWidget::mBlurUnitWidget_changed()
218void QgsBlurWidget::opacityChanged(
double value )
227void QgsBlurWidget::mDrawModeComboBox_currentIndexChanged(
int index )
234 mEffect->
setDrawMode( mDrawModeComboBox->drawMode() );
238void QgsBlurWidget::mBlendCmbBx_currentIndexChanged(
int index )
259 connect( mShadowOffsetAngleSpnBx,
static_cast<void ( QSpinBox::* )(
int )
>( &QSpinBox::valueChanged ),
this, &QgsShadowEffectWidget::mShadowOffsetAngleSpnBx_valueChanged );
260 connect( mShadowOffsetAngleDial, &QDial::valueChanged,
this, &QgsShadowEffectWidget::mShadowOffsetAngleDial_valueChanged );
261 connect( mShadowOffsetSpnBx,
static_cast<void ( QDoubleSpinBox::* )(
double )
>( &QDoubleSpinBox::valueChanged ),
this, &QgsShadowEffectWidget::mShadowOffsetSpnBx_valueChanged );
264 connect( mDrawModeComboBox,
static_cast<void ( QComboBox::* )(
int )
>( &QComboBox::currentIndexChanged ),
this, &QgsShadowEffectWidget::mDrawModeComboBox_currentIndexChanged );
265 connect( mShadowBlendCmbBx,
static_cast<void ( QComboBox::* )(
int )
>( &QComboBox::currentIndexChanged ),
this, &QgsShadowEffectWidget::mShadowBlendCmbBx_currentIndexChanged );
266 connect( mShadowRadiuSpnBx,
static_cast<void ( QDoubleSpinBox::* )(
double )
>( &QDoubleSpinBox::valueChanged ),
this, &QgsShadowEffectWidget::mShadowRadiuSpnBx_valueChanged );
269 mShadowColorBtn->setAllowOpacity(
false );
270 mShadowColorBtn->setColorDialogTitle( tr(
"Select Shadow Color" ) );
271 mShadowColorBtn->setContext( QStringLiteral(
"symbology" ) );
272 mShadowOffsetAngleSpnBx->setClearValue( 0 );
284 if ( !effect || ( effect->
type() != QLatin1String(
"dropShadow" ) && effect->
type() != QLatin1String(
"innerShadow" ) ) )
291void QgsShadowEffectWidget::initGui()
298 blockSignals(
true );
300 mShadowOffsetAngleSpnBx->setValue( mEffect->
offsetAngle() );
301 mShadowOffsetAngleDial->setValue( mEffect->
offsetAngle() );
303 mOffsetUnitWidget->setUnit( mEffect->
offsetUnit() );
305 mShadowRadiuSpnBx->setValue( mEffect->
blurLevel() );
306 mBlurUnitWidget->setUnit( mEffect->
blurUnit() );
308 mOpacityWidget->setOpacity( mEffect->
opacity() );
309 mShadowColorBtn->setColor( mEffect->
color() );
310 mShadowBlendCmbBx->setBlendMode( mEffect->
blendMode() );
311 mDrawModeComboBox->setDrawMode( mEffect->
drawMode() );
313 blockSignals(
false );
316void QgsShadowEffectWidget::blockSignals(
const bool block )
318 mShadowOffsetAngleSpnBx->blockSignals( block );
319 mShadowOffsetAngleDial->blockSignals( block );
320 mShadowOffsetSpnBx->blockSignals( block );
321 mOffsetUnitWidget->blockSignals( block );
322 mShadowRadiuSpnBx->blockSignals( block );
323 mBlurUnitWidget->blockSignals( block );
324 mOpacityWidget->blockSignals( block );
325 mShadowColorBtn->blockSignals( block );
326 mShadowBlendCmbBx->blockSignals( block );
327 mDrawModeComboBox->blockSignals( block );
330void QgsShadowEffectWidget::mShadowOffsetAngleSpnBx_valueChanged(
int value )
332 mShadowOffsetAngleDial->blockSignals(
true );
333 mShadowOffsetAngleDial->setValue( value );
334 mShadowOffsetAngleDial->blockSignals(
false );
343void QgsShadowEffectWidget::mShadowOffsetAngleDial_valueChanged(
int value )
345 mShadowOffsetAngleSpnBx->setValue( value );
348void QgsShadowEffectWidget::mShadowOffsetSpnBx_valueChanged(
double value )
357void QgsShadowEffectWidget::mOffsetUnitWidget_changed()
369void QgsShadowEffectWidget::opacityChanged(
double value )
378void QgsShadowEffectWidget::mShadowColorBtn_colorChanged(
const QColor &color )
387void QgsShadowEffectWidget::mShadowRadiuSpnBx_valueChanged(
double value )
396void QgsShadowEffectWidget::mBlurUnitWidget_changed()
408void QgsShadowEffectWidget::mDrawModeComboBox_currentIndexChanged(
int index )
415 mEffect->
setDrawMode( mDrawModeComboBox->drawMode() );
419void QgsShadowEffectWidget::mShadowBlendCmbBx_currentIndexChanged(
int index )
426 mEffect->
setBlendMode( mShadowBlendCmbBx->blendMode() );
440 connect( mSpreadSpnBx,
static_cast<void ( QDoubleSpinBox::* )(
double )
>( &QDoubleSpinBox::valueChanged ),
this, &QgsGlowWidget::mSpreadSpnBx_valueChanged );
443 connect( mBlendCmbBx,
static_cast<void ( QComboBox::* )(
int )
>( &QComboBox::currentIndexChanged ),
this, &QgsGlowWidget::mBlendCmbBx_currentIndexChanged );
444 connect( mDrawModeComboBox,
static_cast<void ( QComboBox::* )(
int )
>( &QComboBox::currentIndexChanged ),
this, &QgsGlowWidget::mDrawModeComboBox_currentIndexChanged );
445 connect( mBlurRadiusSpnBx,
static_cast<void ( QDoubleSpinBox::* )(
double )
>( &QDoubleSpinBox::valueChanged ),
this, &QgsGlowWidget::mBlurRadiusSpnBx_valueChanged );
448 mColorBtn->setAllowOpacity(
false );
449 mColorBtn->setColorDialogTitle( tr(
"Select Glow Color" ) );
450 mColorBtn->setContext( QStringLiteral(
"symbology" ) );
455 btnColorRamp->setShowGradientOnly(
true );
460 connect( radioSingleColor, &QAbstractButton::toggled,
this, &QgsGlowWidget::colorModeChanged );
466 if ( !effect || ( effect->
type() != QLatin1String(
"outerGlow" ) && effect->
type() != QLatin1String(
"innerGlow" ) ) )
473void QgsGlowWidget::initGui()
480 blockSignals(
true );
482 mSpreadSpnBx->setValue( mEffect->
spread() );
483 mSpreadUnitWidget->setUnit( mEffect->
spreadUnit() );
485 mBlurRadiusSpnBx->setValue( mEffect->
blurLevel() );
486 mBlurUnitWidget->setUnit( mEffect->
blurUnit() );
488 mOpacityWidget->setOpacity( mEffect->
opacity() );
489 mColorBtn->setColor( mEffect->
color() );
490 mBlendCmbBx->setBlendMode( mEffect->
blendMode() );
492 if ( mEffect->
ramp() )
494 btnColorRamp->setColorRamp( mEffect->
ramp() );
501 mDrawModeComboBox->setDrawMode( mEffect->
drawMode() );
503 blockSignals(
false );
506void QgsGlowWidget::blockSignals(
const bool block )
508 mSpreadSpnBx->blockSignals( block );
509 mSpreadUnitWidget->blockSignals( block );
510 mBlurRadiusSpnBx->blockSignals( block );
511 mOpacityWidget->blockSignals( block );
512 mColorBtn->blockSignals( block );
513 mBlendCmbBx->blockSignals( block );
514 btnColorRamp->blockSignals( block );
515 radioSingleColor->blockSignals( block );
516 radioColorRamp->blockSignals( block );
517 mDrawModeComboBox->blockSignals( block );
520void QgsGlowWidget::colorModeChanged()
527 if ( radioSingleColor->isChecked() )
534 mEffect->
setRamp( btnColorRamp->colorRamp() );
539void QgsGlowWidget::mSpreadSpnBx_valueChanged(
double value )
548void QgsGlowWidget::mSpreadUnitWidget_changed()
560void QgsGlowWidget::opacityChanged(
double value )
569void QgsGlowWidget::mColorBtn_colorChanged(
const QColor &color )
578void QgsGlowWidget::mBlurRadiusSpnBx_valueChanged(
double value )
587void QgsGlowWidget::mBlurUnitWidget_changed()
599void QgsGlowWidget::mBlendCmbBx_currentIndexChanged(
int index )
610void QgsGlowWidget::mDrawModeComboBox_currentIndexChanged(
int index )
617 mEffect->
setDrawMode( mDrawModeComboBox->drawMode() );
621void QgsGlowWidget::applyColorRamp()
645 connect( mDrawModeComboBox,
static_cast<void ( QComboBox::* )(
int )
>( &QComboBox::currentIndexChanged ),
this, &QgsTransformWidget::mDrawModeComboBox_currentIndexChanged );
646 connect( mSpinTranslateX,
static_cast<void ( QDoubleSpinBox::* )(
double )
>( &QDoubleSpinBox::valueChanged ),
this, &QgsTransformWidget::mSpinTranslateX_valueChanged );
647 connect( mSpinTranslateY,
static_cast<void ( QDoubleSpinBox::* )(
double )
>( &QDoubleSpinBox::valueChanged ),
this, &QgsTransformWidget::mSpinTranslateY_valueChanged );
649 connect( mReflectXCheckBox, &QCheckBox::stateChanged,
this, &QgsTransformWidget::mReflectXCheckBox_stateChanged );
650 connect( mReflectYCheckBox, &QCheckBox::stateChanged,
this, &QgsTransformWidget::mReflectYCheckBox_stateChanged );
651 connect( mSpinShearX,
static_cast<void ( QDoubleSpinBox::* )(
double )
>( &QDoubleSpinBox::valueChanged ),
this, &QgsTransformWidget::mSpinShearX_valueChanged );
652 connect( mSpinShearY,
static_cast<void ( QDoubleSpinBox::* )(
double )
>( &QDoubleSpinBox::valueChanged ),
this, &QgsTransformWidget::mSpinShearY_valueChanged );
653 connect( mSpinScaleX,
static_cast<void ( QDoubleSpinBox::* )(
double )
>( &QDoubleSpinBox::valueChanged ),
this, &QgsTransformWidget::mSpinScaleX_valueChanged );
654 connect( mSpinScaleY,
static_cast<void ( QDoubleSpinBox::* )(
double )
>( &QDoubleSpinBox::valueChanged ),
this, &QgsTransformWidget::mSpinScaleY_valueChanged );
655 connect( mRotationSpinBox,
static_cast<void ( QDoubleSpinBox::* )(
double )
>( &QDoubleSpinBox::valueChanged ),
this, &QgsTransformWidget::mRotationSpinBox_valueChanged );
658 mSpinTranslateX->setClearValue( 0 );
659 mSpinTranslateY->setClearValue( 0 );
660 mRotationSpinBox->setClearValue( 0 );
661 mSpinShearX->setClearValue( 0 );
662 mSpinShearY->setClearValue( 0 );
663 mSpinScaleX->setClearValue( 100.0 );
664 mSpinScaleY->setClearValue( 100.0 );
672 if ( !effect || effect->
type() != QLatin1String(
"transform" ) )
679void QgsTransformWidget::initGui()
686 blockSignals(
true );
688 mReflectXCheckBox->setChecked( mEffect->
reflectX() );
689 mReflectYCheckBox->setChecked( mEffect->
reflectY() );
690 mDrawModeComboBox->setDrawMode( mEffect->
drawMode() );
691 mSpinTranslateX->setValue( mEffect->
translateX() );
692 mSpinTranslateY->setValue( mEffect->
translateY() );
695 mSpinShearX->setValue( mEffect->
shearX() );
696 mSpinShearY->setValue( mEffect->
shearY() );
697 mSpinScaleX->setValue( mEffect->
scaleX() * 100.0 );
698 mSpinScaleY->setValue( mEffect->
scaleY() * 100.0 );
699 mRotationSpinBox->setValue( mEffect->
rotation() );
701 blockSignals(
false );
704void QgsTransformWidget::blockSignals(
const bool block )
706 mDrawModeComboBox->blockSignals( block );
707 mTranslateUnitWidget->blockSignals( block );
708 mSpinTranslateX->blockSignals( block );
709 mSpinTranslateY->blockSignals( block );
710 mReflectXCheckBox->blockSignals( block );
711 mReflectYCheckBox->blockSignals( block );
712 mSpinShearX->blockSignals( block );
713 mSpinShearY->blockSignals( block );
714 mSpinScaleX->blockSignals( block );
715 mSpinScaleY->blockSignals( block );
716 mRotationSpinBox->blockSignals( block );
720void QgsTransformWidget::mDrawModeComboBox_currentIndexChanged(
int index )
727 mEffect->
setDrawMode( mDrawModeComboBox->drawMode() );
731void QgsTransformWidget::mSpinTranslateX_valueChanged(
double value )
740void QgsTransformWidget::mSpinTranslateY_valueChanged(
double value )
749void QgsTransformWidget::mTranslateUnitWidget_changed()
761void QgsTransformWidget::mReflectXCheckBox_stateChanged(
int state )
770void QgsTransformWidget::mReflectYCheckBox_stateChanged(
int state )
779void QgsTransformWidget::mSpinShearX_valueChanged(
double value )
788void QgsTransformWidget::mSpinShearY_valueChanged(
double value )
797void QgsTransformWidget::mSpinScaleX_valueChanged(
double value )
806void QgsTransformWidget::mSpinScaleY_valueChanged(
double value )
815void QgsTransformWidget::mRotationSpinBox_valueChanged(
double value )
834 connect( mBlendCmbBx,
static_cast<void ( QComboBox::* )(
int )
>( &QComboBox::currentIndexChanged ),
this, &QgsColorEffectWidget::mBlendCmbBx_currentIndexChanged );
835 connect( mDrawModeComboBox,
static_cast<void ( QComboBox::* )(
int )
>( &QComboBox::currentIndexChanged ),
this, &QgsColorEffectWidget::mDrawModeComboBox_currentIndexChanged );
836 connect( mBrightnessSpinBox,
static_cast<void ( QSpinBox::* )(
int )
>( &QSpinBox::valueChanged ),
this, &QgsColorEffectWidget::mBrightnessSpinBox_valueChanged );
837 connect( mContrastSpinBox,
static_cast<void ( QSpinBox::* )(
int )
>( &QSpinBox::valueChanged ),
this, &QgsColorEffectWidget::mContrastSpinBox_valueChanged );
838 connect( mSaturationSpinBox,
static_cast<void ( QSpinBox::* )(
int )
>( &QSpinBox::valueChanged ),
this, &QgsColorEffectWidget::mSaturationSpinBox_valueChanged );
839 connect( mColorizeStrengthSpinBox,
static_cast<void ( QSpinBox::* )(
int )
>( &QSpinBox::valueChanged ),
this, &QgsColorEffectWidget::mColorizeStrengthSpinBox_valueChanged );
840 connect( mColorizeCheck, &QCheckBox::stateChanged,
this, &QgsColorEffectWidget::mColorizeCheck_stateChanged );
842 connect( mGrayscaleCombo,
static_cast<void ( QComboBox::* )(
int )
>( &QComboBox::currentIndexChanged ),
this, &QgsColorEffectWidget::mGrayscaleCombo_currentIndexChanged );
844 mBrightnessSpinBox->setClearValue( 0 );
845 mContrastSpinBox->setClearValue( 0 );
846 mSaturationSpinBox->setClearValue( 0 );
847 mColorizeStrengthSpinBox->setClearValue( 100 );
848 mColorizeColorButton->setAllowOpacity(
false );
862 if ( !effect || effect->
type() != QLatin1String(
"color" ) )
869void QgsColorEffectWidget::initGui()
876 blockSignals(
true );
878 mSliderBrightness->setValue( mEffect->
brightness() );
879 mSliderContrast->setValue( mEffect->
contrast() );
880 mSliderSaturation->setValue( ( mEffect->
saturation() - 1.0 ) * 100.0 );
881 mColorizeCheck->setChecked( mEffect->
colorizeOn() );
884 const int grayscaleIdx = mGrayscaleCombo->findData( QVariant( (
int ) mEffect->
grayscaleMode() ) );
885 mGrayscaleCombo->setCurrentIndex( grayscaleIdx == -1 ? 0 : grayscaleIdx );
886 mOpacityWidget->setOpacity( mEffect->
opacity() );
887 mBlendCmbBx->setBlendMode( mEffect->
blendMode() );
888 mDrawModeComboBox->setDrawMode( mEffect->
drawMode() );
889 enableColorizeControls( mEffect->
colorizeOn() );
891 blockSignals(
false );
894void QgsColorEffectWidget::blockSignals(
const bool block )
896 mBrightnessSpinBox->blockSignals( block );
897 mContrastSpinBox->blockSignals( block );
898 mSaturationSpinBox->blockSignals( block );
899 mColorizeStrengthSpinBox->blockSignals( block );
900 mColorizeCheck->blockSignals( block );
901 mColorizeColorButton->blockSignals( block );
902 mGrayscaleCombo->blockSignals( block );
903 mOpacityWidget->blockSignals( block );
904 mBlendCmbBx->blockSignals( block );
905 mDrawModeComboBox->blockSignals( block );
908void QgsColorEffectWidget::enableColorizeControls(
const bool enable )
910 mSliderColorizeStrength->setEnabled( enable );
911 mColorizeStrengthSpinBox->setEnabled( enable );
912 mColorizeColorButton->setEnabled( enable );
915void QgsColorEffectWidget::opacityChanged(
double value )
924void QgsColorEffectWidget::mBlendCmbBx_currentIndexChanged(
int index )
935void QgsColorEffectWidget::mDrawModeComboBox_currentIndexChanged(
int index )
942 mEffect->
setDrawMode( mDrawModeComboBox->drawMode() );
946void QgsColorEffectWidget::mBrightnessSpinBox_valueChanged(
int value )
955void QgsColorEffectWidget::mContrastSpinBox_valueChanged(
int value )
964void QgsColorEffectWidget::mSaturationSpinBox_valueChanged(
int value )
973void QgsColorEffectWidget::mColorizeStrengthSpinBox_valueChanged(
int value )
982void QgsColorEffectWidget::mColorizeCheck_stateChanged(
int state )
988 enableColorizeControls( state == Qt::Checked );
992void QgsColorEffectWidget::mColorizeColorButton_colorChanged(
const QColor &color )
1001void QgsColorEffectWidget::mGrayscaleCombo_currentIndexChanged(
int index )
@ Millimeters
Millimeters.
@ Points
Points (e.g., for font sizes)
A paint effect which blurs a source picture, using a number of different blur methods.
const QgsMapUnitScale & blurMapUnitScale() const
Returns the map unit scale used for the blur strength (radius).
void setBlurUnit(const Qgis::RenderUnit unit)
Sets the units used for the blur level (radius).
void setBlurMapUnitScale(const QgsMapUnitScale &scale)
Sets the map unit scale used for the blur strength (radius).
QPainter::CompositionMode blendMode() const
Returns the blend mode for the effect.
Qgis::RenderUnit blurUnit() const
Returns the units used for the blur level (radius).
BlurMethod
Available blur methods (algorithms)
@ GaussianBlur
Gaussian blur, a slower but high quality blur. Blur level values are the distance in pixels for the b...
@ StackBlur
Stack blur, a fast but low quality blur. Valid blur level values are between 0 - 16.
double opacity() const
Returns the opacity for the effect.
void setBlendMode(const QPainter::CompositionMode mode)
Sets the blend mode for the effect.
BlurMethod blurMethod() const
Returns the blur method (algorithm) used for performing the blur.
double blurLevel() const
Returns the blur level (radius)
void setBlurMethod(const BlurMethod method)
Sets the blur method (algorithm) to use for performing the blur.
void setOpacity(const double opacity)
Sets the opacity for the effect.
void setBlurLevel(const double level)
Sets blur level (radius)
A paint effect which alters the colors (e.g., brightness, contrast) in a source picture.
bool colorizeOn() const
Returns whether the effect will colorize a picture.
QgsImageOperation::GrayscaleMode grayscaleMode() const
Returns whether the effect will convert a picture to grayscale.
double opacity() const
Returns the opacity for the effect.
void setOpacity(const double opacity)
Sets the opacity for the effect.
void setSaturation(double saturation)
Sets the saturation modification for the effect.
void setColorizeStrength(int colorizeStrength)
Sets the strength for colorizing a picture.
int colorizeStrength() const
Returns the strength used for colorizing a picture.
void setColorizeColor(const QColor &colorizeColor)
Sets the color used for colorizing a picture.
void setColorizeOn(bool colorizeOn)
Sets whether the effect should colorize a picture.
int contrast() const
Returns the contrast modification for the effect.
int brightness() const
Returns the brightness modification for the effect.
void setContrast(int contrast)
Sets the contrast modification for the effect.
void setBlendMode(const QPainter::CompositionMode mode)
Sets the blend mode for the effect.
double saturation() const
Returns the saturation modification for the effect.
void setBrightness(int brightness)
Sets the brightness modification for the effect.
QColor colorizeColor() const
Returns the color used for colorizing a picture.
QPainter::CompositionMode blendMode() const
Returns the blend mode for the effect.
void setGrayscaleMode(QgsImageOperation::GrayscaleMode grayscaleMode)
Sets whether the effect should convert a picture to grayscale.
Abstract base class for color ramps.
A paint effect which draws the source picture with minor or no alterations.
QPainter::CompositionMode blendMode() const
Returns the blend mode for the effect.
void setBlendMode(const QPainter::CompositionMode mode)
Sets the blend mode for the effect.
double opacity() const
Returns the opacity for the effect.
void setOpacity(const double opacity)
Sets the opacity for the effect.
Base class for paint effect which draw a glow inside or outside a picture.
void setSpread(const double spread)
Sets the spread distance for drawing the glow effect.
void setColorType(GlowColorType colorType)
Sets the color mode to use for the glow.
void setSpreadMapUnitScale(const QgsMapUnitScale &scale)
Sets the map unit scale used for the spread distance.
Qgis::RenderUnit blurUnit() const
Returns the units used for the glow blur level (radius).
void setOpacity(const double opacity)
Sets the opacity for the effect.
double spread() const
Returns the spread distance used for drawing the glow effect.
const QgsMapUnitScale & spreadMapUnitScale() const
Returns the map unit scale used for the spread distance.
@ SingleColor
Use a single color and fade the color to totally transparent.
@ ColorRamp
Use colors from a color ramp.
QPainter::CompositionMode blendMode() const
Returns the blend mode for the effect.
double blurLevel() const
Returns the blur level (radius) for the glow.
double opacity() const
Returns the opacity for the effect.
void setBlendMode(const QPainter::CompositionMode mode)
Sets the blend mode for the effect.
QColor color() const
Returns the color for the glow.
const QgsMapUnitScale & blurMapUnitScale() const
Returns the map unit scale used for the glow blur strength (radius).
void setBlurUnit(const Qgis::RenderUnit unit)
Sets the units used for the glow blur level (radius).
void setBlurLevel(const double level)
Sets blur level (radius) for the glow.
QgsColorRamp * ramp() const
Returns the color ramp used for the glow.
Qgis::RenderUnit spreadUnit() const
Returns the units used for the glow spread distance.
void setRamp(QgsColorRamp *ramp)
Sets the color ramp for the glow.
void setSpreadUnit(const Qgis::RenderUnit unit)
Sets the units used for the glow spread distance.
void setColor(const QColor &color)
Sets the color for the glow.
GlowColorType colorType() const
Returns the color mode used for the glow.
void setBlurMapUnitScale(const QgsMapUnitScale &scale)
Sets the map unit scale used for the glow blur strength (radius).
GrayscaleMode
Modes for converting a QImage to grayscale.
@ GrayscaleLightness
Keep the lightness of the color, drops the saturation.
@ GrayscaleLuminosity
Grayscale by perceptual luminosity (weighted sum of color RGB components)
@ GrayscaleAverage
Grayscale by taking average of color RGB components.
Base class for visual effects which can be applied to QPicture drawings.
void setDrawMode(DrawMode drawMode)
Sets the draw mode for the effect.
DrawMode drawMode() const
Returns the draw mode for the effect.
virtual QString type() const =0
Returns the effect type.
Base class for paint effects which offset, blurred shadows.
int offsetAngle() const
Returns the angle used for offsetting the shadow.
void setOffsetAngle(const int angle)
Sets the angle for offsetting the shadow.
void setOpacity(const double opacity)
Sets the opacity for the effect.
void setColor(const QColor &color)
Sets the color for the shadow.
double opacity() const
Returns the opacity for the effect.
Qgis::RenderUnit offsetUnit() const
Returns the units used for the shadow offset distance.
QColor color() const
Returns the color used for the shadow.
QPainter::CompositionMode blendMode() const
Returns the blend mode for the effect.
Qgis::RenderUnit blurUnit() const
Returns the units used for the shadow blur level (radius).
void setBlurLevel(const double level)
Sets blur level (radius) for the shadow.
void setOffsetUnit(const Qgis::RenderUnit unit)
Sets the units used for the shadow offset distance.
void setOffsetDistance(const double distance)
Sets the distance for offsetting the shadow.
double blurLevel() const
Returns the blur level (radius) for the shadow.
void setBlurUnit(const Qgis::RenderUnit unit)
Sets the units used for the shadow blur level (radius).
const QgsMapUnitScale & offsetMapUnitScale() const
Returns the map unit scale used for the shadow offset distance.
void setOffsetMapUnitScale(const QgsMapUnitScale &scale)
Sets the map unit scale used for the shadow offset distance.
void setBlendMode(const QPainter::CompositionMode mode)
Sets the blend mode for the effect.
double offsetDistance() const
Returns the distance used for offsetting the shadow.
const QgsMapUnitScale & blurMapUnitScale() const
Returns the map unit scale used for the shadow blur strength (radius).
void setBlurMapUnitScale(const QgsMapUnitScale &scale)
Sets the map unit scale used for the shadow blur strength (radius).
QList< Qgis::RenderUnit > RenderUnitList
List of render units.