Re-format code

This commit is contained in:
jfmcarreira committed 2017-03-23 04:29:34 +00:00
1 parent fd68d340bd
commit ebc10d1b84
85 files changed
+8092 -4419

No files matched your search

+20 -12
View File
@@ -25,11 +25,11 @@
// TODO:
// - Optimizar paintEvent. Parece haver codigo redundante !!
#include "config.h"
#include <cmath>
#include <QtGui>
#include <QtDebug>
#include "HistogramWidget.h"
#include "config.h"
#include <QtDebug>
#include <QtGui>
#include <cmath>
class HistogramWorker : public QThread
{
@@ -177,7 +177,8 @@ HistogramWidget::HistogramWidget( Int width, Int height, QWidget* parent ) : QWi
m_colorType = FirstChannelColor;
m_renderingType = FullImageHistogram;
setOptions( HistogramWidget::BlinkComputation | HistogramWidget::SelectMode | HistogramWidget::ShowLumaChannel );
setOptions( HistogramWidget::BlinkComputation | HistogramWidget::SelectMode |
HistogramWidget::ShowLumaChannel );
setMouseTracking( true );
setMinimumSize( width, height );
@@ -439,7 +440,8 @@ Void HistogramWidget::paintEvent( QPaintEvent* )
QPainter p1( this );
p1.fillRect( 0, 0, maxX, maxY, palette().color( QPalette::Disabled, QPalette::Window ) );
p1.setPen( QPen( palette().color( QPalette::Disabled, QPalette::WindowText ), 1, Qt::SolidLine ) );
p1.setPen(
QPen( palette().color( QPalette::Disabled, QPalette::WindowText ), 1, Qt::SolidLine ) );
p1.drawRect( 0, 0, maxX, maxY );
return;
@@ -461,7 +463,8 @@ Void HistogramWidget::paintEvent( QPaintEvent* )
if( d->clearFlag == HistogramWidgetPrivate::HistogramDataLoading )
p1.drawText( 0, 0, maxX, maxY, Qt::AlignCenter, tr( "Loading image..." ) );
else
p1.drawText( 0, 0, maxX, maxY, Qt::AlignCenter, tr( "Histogram\ncalculation\nin progress..." ) );
p1.drawText( 0, 0, maxX, maxY, Qt::AlignCenter,
tr( "Histogram\ncalculation\nin progress..." ) );
return;
}
@@ -526,7 +529,8 @@ Void HistogramWidget::paintEvent( QPaintEvent* )
break;
case HistogramWidget::ColorChannelsHistogram: // All color channels.
max = qMax( qMax( frame->getMaximum( LUMA ), frame->getMaximum( CHROMA_U ) ), frame->getMaximum( CHROMA_V ) );
max = qMax( qMax( frame->getMaximum( LUMA ), frame->getMaximum( CHROMA_U ) ),
frame->getMaximum( CHROMA_V ) );
break;
// case HistogramWidget::LumaHistogram: // Luminance.
// max = frame->getMaximum( LUMA );
@@ -893,7 +897,8 @@ Void HistogramWidget::paintEvent( QPaintEvent* )
break;
// case HistogramWidget::LumaHistogram:
// guidePos = qMax( qMax( d->colorGuide.red(), d->colorGuide.green() ), d->colorGuide.blue() );
// guidePos = qMax( qMax( d->colorGuide.red(), d->colorGuide.green()
// ), d->colorGuide.blue() );
// break;
default: // Alpha.
@@ -1025,7 +1030,8 @@ Void HistogramWidget::mouseMoveEvent( QMouseEvent* e )
if( d->inSelected )
{
double max = ( (double)e->pos().x() ) / ( (double)width() );
// int max = (int)(e->pos().x()*((float)m_imageHistogram->getHistogramSegment()/(float)width()));
// int max =
// (int)(e->pos().x()*((float)m_imageHistogram->getHistogramSegment()/(float)width()));
if( max < d->xminOrg )
{
@@ -1040,7 +1046,8 @@ Void HistogramWidget::mouseMoveEvent( QMouseEvent* e )
}
notifyValuesChanged();
// emit signalMaxValueChanged( d->xmax == 0.0 ? d->range : (int)(d->xmax * d->range) );
// emit signalMaxValueChanged( d->xmax == 0.0 ? d->range : (int)(d->xmax *
// d->range) );
update();
}
@@ -1051,7 +1058,8 @@ Void HistogramWidget::mouseMoveEvent( QMouseEvent* e )
Void HistogramWidget::notifyValuesChanged()
{
emit signalIntervalChanged( (int)( d->xmin * d->range ), d->xmax == 0.0 ? d->range : (int)( d->xmax * d->range ) );
emit signalIntervalChanged( (int)( d->xmin * d->range ),
d->xmax == 0.0 ? d->range : (int)( d->xmax * d->range ) );
}
Void HistogramWidget::slotMinValueChanged( int min )