207 QPoint topLeftExtreme, QPoint bottomRightExtreme,
217 if(
rawImage.isNull()) {
return NULL; }
223 topLeftExtreme.setX( QMAX( topLeftExtreme.x(), 0 ) );
224 topLeftExtreme.setY( QMAX( topLeftExtreme.y(), 0 ) );
225 bottomRightExtreme.setX( QMIN( bottomRightExtreme.x(),
rawImage.width()-1 ) );
226 bottomRightExtreme.setY( QMIN( bottomRightExtreme.y(),
rawImage.height()-1 ) );
229 QString statusMessage = qApp->translate(
"removeRedeyeRegions",
"Removing Red-Eye:" );
231 qApp->processEvents();
235 ( bottomRightExtreme.x() - topLeftExtreme.x() + 1 ) *
236 ( bottomRightExtreme.y() - topLeftExtreme.y() + 1 ) );
247 qApp->processEvents();
263 qApp->processEvents();
272 editedImage =
new QImage( tmp->convertDepth( 32, Qt::AutoColor ) );
273 delete tmp; tmp=NULL;
293 qApp->processEvents();
394 rgb = ((QRgb*)scanLine+x);
396 bool threshMet = qRed(*rgb) > 2*qGreen(*rgb) &&
418 pushPixel( point.x()-1, point.y()-1,
id );
420 pushPixel( point.x()+1, point.y()-1,
id );
423 pushPixel( point.x()-1, point.y()+1,
id );
425 pushPixel( point.x()+1, point.y()+1,
id );
435 blobIDs.push( (nextValidID - 1) );
462 blobIDs.push( (nextValidID - 1) );
649 for( y=topLeftExtreme.y(); y<=bottomRightExtreme.y(); y++)
652 for( x=topLeftExtreme.x(); x<=bottomRightExtreme.x(); x++)
654 rgb = ((QRgb*)scanLine+x);
655 if( qRed(*rgb) > 2*qGreen(*rgb) )
657 *rgb = qRgb( (
int) (0.05*qRed(*rgb) + 0.6*qGreen(*rgb) + 0.3*qBlue(*rgb)),