14 #include <qapplication.h> 19 #include "../../gui/statusWidget.h" 60 if( editedImage->depth() < 32 )
63 editedImage =
new QImage( tmp->convertDepth( 32, Qt::AutoColor ) );
68 bool useBusyIndicators =
false;
70 if( options != NULL && options->
getStatus() != NULL )
72 useBusyIndicators =
true;
79 QString statusMessage = qApp->translate(
"sepiaEffect",
"Applying Sepia Effect:" );
81 qApp->processEvents();
85 const int updateIncrement = (int) ( 0.01 * editedImage->width() * editedImage->height() );
89 int sepiaH, sepiaS, sepiaL;
90 QColor(162,128,101).getHsv( &sepiaH, &sepiaS, &sepiaL );
93 int x, y, pixelLuminance;
98 for( y=0; y<editedImage->height(); y++)
101 scanLine = editedImage->scanLine(y);
102 for( x=0; x<editedImage->width(); x++)
105 rgb = ((QRgb*)scanLine+x);
106 pixelLuminance = (int) (0.2125*qRed(*rgb) + 0.7154*qGreen(*rgb) + 0.0721*qBlue(*rgb));
109 sepiaColor.setHsv( sepiaH, sepiaS, pixelLuminance );
110 *rgb = sepiaColor.rgb();
113 if(useBusyIndicators)
116 if(newProgress >= updateIncrement)
120 qApp->processEvents();
StatusWidget * getStatus()
QImage * sepiaEffect(QString filename, ManipulationOptions *options)