30 : mColorizeColor( QColor::fromRgb( 255, 128, 128 ) )
40 QPainter *painter = context.
painter();
54 painter->setCompositionMode( mBlendMode );
55 painter->drawImage(
imageOffset( context ), image );
63 props.insert( QStringLiteral(
"enabled" ),
mEnabled ? QStringLiteral(
"1" ) : QStringLiteral(
"0" ) );
64 props.insert( QStringLiteral(
"draw_mode" ), QString::number(
int(
mDrawMode ) ) );
65 props.insert( QStringLiteral(
"blend_mode" ), QString::number(
int( mBlendMode ) ) );
66 props.insert( QStringLiteral(
"opacity" ), QString::number( mOpacity ) );
67 props.insert( QStringLiteral(
"brightness" ), QString::number( mBrightness ) );
68 props.insert( QStringLiteral(
"contrast" ), QString::number( mContrast ) );
69 props.insert( QStringLiteral(
"saturation" ), QString::number( mSaturation ) );
70 props.insert( QStringLiteral(
"grayscale_mode" ), QString::number(
int( mGrayscaleMode ) ) );
71 props.insert( QStringLiteral(
"colorize" ), mColorizeOn ? QStringLiteral(
"1" ) : QStringLiteral(
"0" ) );
73 props.insert( QStringLiteral(
"colorize_strength" ), QString::number( mColorizeStrength ) );
81 QPainter::CompositionMode mode =
static_cast< QPainter::CompositionMode
>( props.value( QStringLiteral(
"blend_mode" ) ).toInt( &ok ) );
86 if ( props.contains( QStringLiteral(
"transparency" ) ) )
88 double transparency = props.value( QStringLiteral(
"transparency" ) ).toDouble( &ok );
91 mOpacity = 1.0 - transparency;
96 double opacity = props.value( QStringLiteral(
"opacity" ) ).toDouble( &ok );
102 mEnabled = props.value( QStringLiteral(
"enabled" ), QStringLiteral(
"1" ) ).toInt();
105 mBrightness = props.value( QStringLiteral(
"brightness" ), QStringLiteral(
"0" ) ).toInt();
106 mContrast = props.value( QStringLiteral(
"contrast" ), QStringLiteral(
"0" ) ).toInt();
107 mSaturation = props.value( QStringLiteral(
"saturation" ), QStringLiteral(
"1.0" ) ).toDouble();
109 mColorizeOn = props.value( QStringLiteral(
"colorize" ), QStringLiteral(
"0" ) ).toInt();
110 if ( props.contains( QStringLiteral(
"colorize_color" ) ) )
114 mColorizeStrength = props.value( QStringLiteral(
"colorize_strength" ), QStringLiteral(
"100" ) ).toInt();