widgets/colorplaneexport_ui.ui
widgets/waveform_ui.ui
widgets/rgbparade_ui.ui
- widgets/levels_ui.ui
+ widgets/histogram_ui.ui
)
set(kdenlive_SRCS
configtrackscommand.cpp
abstractscopewidget.cpp
rebuildgroupcommand.cpp
- levels.cpp
+ histogram.cpp
rgbparade.cpp
vectorscope.cpp
waveform.cpp
colorplaneexport.cpp
colortools.cpp
- colorcorrection/levelsgenerator.cpp
+ colorcorrection/histogramgenerator.cpp
colorcorrection/rgbparadegenerator.cpp
colorcorrection/vectorscopegenerator.cpp
colorcorrection/waveformgenerator.cpp
#include <QDebug>
#include <QImage>
#include <QPainter>
-#include "levelsgenerator.h"
+#include "histogramgenerator.h"
-LevelsGenerator::LevelsGenerator()
+HistogramGenerator::HistogramGenerator()
{
}
-QImage LevelsGenerator::calculateLevels(const QSize ¶deSize, const QImage &image, const int &components,
+QImage HistogramGenerator::calculateHistogram(const QSize ¶deSize, const QImage &image, const int &components,
const bool &unscaled, const uint &accelFactor) const
{
- qDebug() << "Levels rect size is: " << paradeSize.width() << "/" << paradeSize.height();
+ qDebug() << "Histogram rect size is: " << paradeSize.width() << "/" << paradeSize.height();
if (paradeSize.height() <= 0 || paradeSize.width() <= 0) {
return QImage();
}
- bool drawY = (components & LevelsGenerator::ComponentY) != 0;
- bool drawR = (components & LevelsGenerator::ComponentR) != 0;
- bool drawG = (components & LevelsGenerator::ComponentG) != 0;
- bool drawB = (components & LevelsGenerator::ComponentB) != 0;
+ bool drawY = (components & HistogramGenerator::ComponentY) != 0;
+ bool drawR = (components & HistogramGenerator::ComponentR) != 0;
+ bool drawG = (components & HistogramGenerator::ComponentG) != 0;
+ bool drawB = (components & HistogramGenerator::ComponentB) != 0;
int r[256], g[256], b[256], y[256];
// Initialize the values to zero
int wy = 0; // Drawing position
- QImage levels(paradeSize, QImage::Format_ARGB32);
- QPainter davinci(&levels);
+ QImage histogram(paradeSize, QImage::Format_ARGB32);
+ QPainter davinci(&histogram);
davinci.setPen(QColor(220, 220, 220, 255));
- levels.fill(qRgba(0, 0, 0, 0));
+ histogram.fill(qRgba(0, 0, 0, 0));
if (drawY) {
qDebug() << "Drawing Y at " << wy << " with height " << partH;
wy += partH + d;
}
- return levels;
+ return histogram;
}
-QImage LevelsGenerator::drawComponent(const int *y, const QSize &size, const float &scaling, const QColor &color, const bool &unscaled) const
+QImage HistogramGenerator::drawComponent(const int *y, const QSize &size, const float &scaling, const QColor &color, const bool &unscaled) const
{
QImage component(256, size.height(), QImage::Format_ARGB32);
component.fill(qRgba(0, 0, 0, 0));
}
}
-void LevelsGenerator::drawComponentFull(QPainter *davinci, const int *y, const float &scaling, const QRect &rect,
+void HistogramGenerator::drawComponentFull(QPainter *davinci, const int *y, const float &scaling, const QRect &rect,
const QColor &color, const int &textSpace, const bool &unscaled) const
{
QImage component = drawComponent(y, rect.size() - QSize(0, textSpace), scaling, color, unscaled);
* (at your option) any later version. *
***************************************************************************/
-#ifndef LEVELSGENERATOR_H
-#define LEVELSGENERATOR_H
+#ifndef HISTOGRAMGENERATOR_H
+#define HISTOGRAMGENERATOR_H
#include <QObject>
class QRect;
class QSize;
-class LevelsGenerator : public QObject
+class HistogramGenerator : public QObject
{
public:
- LevelsGenerator();
+ HistogramGenerator();
/**
- Calculates a levels display from the input image.
- components are OR-ed LevelsGenerator::Components flags and decide with components (Y, R, G, B) to paint.
+ Calculates a histogram display from the input image.
+ components are OR-ed HistogramGenerator::Components flags and decide with components (Y, R, G, B) to paint.
unscaled = true leaves the width at 256 if the widget is wider (to avoid scaling). */
- QImage calculateLevels(const QSize ¶deSize, const QImage &image, const int &components, const bool &unscaled,
+ QImage calculateHistogram(const QSize ¶deSize, const QImage &image, const int &components, const bool &unscaled,
const uint &accelFactor = 1) const;
QImage drawComponent(const int *y, const QSize &size, const float &scaling, const QColor &color, const bool &unscaled) const;
};
-#endif // LEVELSGENERATOR_H
+#endif // HISTOGRAMGENERATOR_H
#include <QMenu>
#include <QTime>
-#include "levelsgenerator.h"
-#include "levels.h"
+#include "histogramgenerator.h"
+#include "histogram.h"
#include "renderer.h"
-Levels::Levels(Monitor *projMonitor, Monitor *clipMonitor, QWidget *parent) :
+Histogram::Histogram(Monitor *projMonitor, Monitor *clipMonitor, QWidget *parent) :
AbstractScopeWidget(projMonitor, clipMonitor, parent)
{
- ui = new Ui::Levels_UI();
+ ui = new Ui::Histogram_UI();
ui->setupUi(this);
ui->cbY->setChecked(true);
}
-Levels::~Levels()
+Histogram::~Histogram()
{
delete ui;
delete m_aUnscaled;
}
-QString Levels::widgetName() const { return QString("Levels"); }
+QString Histogram::widgetName() const { return QString("Histogram"); }
-bool Levels::isHUDDependingOnInput() const { return false; }
-bool Levels::isScopeDependingOnInput() const { return true; }
-bool Levels::isBackgroundDependingOnInput() const { return false; }
+bool Histogram::isHUDDependingOnInput() const { return false; }
+bool Histogram::isScopeDependingOnInput() const { return true; }
+bool Histogram::isBackgroundDependingOnInput() const { return false; }
-QRect Levels::scopeRect()
+QRect Histogram::scopeRect()
{
qDebug() << "According to the spacer, the top left point is " << ui->verticalSpacer->geometry().x() << "/" << ui->verticalSpacer->geometry().y();
QPoint topleft(offset, offset+ ui->verticalSpacer->geometry().y());
return QRect(topleft, this->rect().size() - QSize(topleft.x() + offset, topleft.y() + offset));
}
-QImage Levels::renderHUD(uint)
+QImage Histogram::renderHUD(uint)
{
emit signalHUDRenderingFinished(0, 1);
return QImage();
}
-QImage Levels::renderScope(uint accelFactor)
+QImage Histogram::renderScope(uint accelFactor)
{
QTime start = QTime::currentTime();
start.start();
- const int componentFlags = (ui->cbY->isChecked() ? 1 : 0) * LevelsGenerator::ComponentY
- | (ui->cbR->isChecked() ? 1 : 0) * LevelsGenerator::ComponentR
- | (ui->cbG->isChecked() ? 1 : 0) * LevelsGenerator::ComponentG
- | (ui->cbB->isChecked() ? 1 : 0) * LevelsGenerator::ComponentB;
+ const int componentFlags = (ui->cbY->isChecked() ? 1 : 0) * HistogramGenerator::ComponentY
+ | (ui->cbR->isChecked() ? 1 : 0) * HistogramGenerator::ComponentR
+ | (ui->cbG->isChecked() ? 1 : 0) * HistogramGenerator::ComponentG
+ | (ui->cbB->isChecked() ? 1 : 0) * HistogramGenerator::ComponentB;
- QImage levels = m_levelsGenerator->calculateLevels(m_scopeRect.size(), m_activeRender->extractFrame(m_activeRender->seekFramePosition()),
+ QImage histogram = m_histogramGenerator->calculateHistogram(m_scopeRect.size(), m_activeRender->extractFrame(m_activeRender->seekFramePosition()),
componentFlags, m_aUnscaled->isChecked(), accelFactor);
emit signalScopeRenderingFinished(start.elapsed(), accelFactor);
- return levels;
+ return histogram;
}
-QImage Levels::renderBackground(uint)
+QImage Histogram::renderBackground(uint)
{
emit signalBackgroundRenderingFinished(0, 1);
return QImage();
* (at your option) any later version. *
***************************************************************************/
-#ifndef LEVELS_H
-#define LEVELS_H
+#ifndef HISTOGRAM_H
+#define HISTOGRAM_H
#include "abstractscopewidget.h"
-#include "ui_levels_ui.h"
+#include "ui_histogram_ui.h"
-class LevelsGenerator;
+class HistogramGenerator;
-class Levels : public AbstractScopeWidget {
+class Histogram : public AbstractScopeWidget {
Q_OBJECT
public:
- Levels(Monitor *projMonitor, Monitor *clipMonitor, QWidget *parent = 0);
- ~Levels();
+ Histogram(Monitor *projMonitor, Monitor *clipMonitor, QWidget *parent = 0);
+ ~Histogram();
QString widgetName() const;
private:
- LevelsGenerator *m_levelsGenerator;
+ HistogramGenerator *m_histogramGenerator;
QAction *m_aUnscaled;
QRect scopeRect();
QImage renderHUD(uint accelerationFactor);
QImage renderScope(uint accelerationFactor);
QImage renderBackground(uint accelerationFactor);
- Ui::Levels_UI *ui;
+ Ui::Histogram_UI *ui;
};
-#endif // LEVELS_H
+#endif // HISTOGRAM_H
#include "vectorscope.h"
#include "waveform.h"
#include "rgbparade.h"
-#include "levels.h"
+#include "histogram.h"
#include <KApplication>
#include <KAction>
addDockWidget(Qt::TopDockWidgetArea, m_waveformDock);
m_RGBParade = new RGBParade(m_projectMonitor, m_clipMonitor, this);
- m_RGBParadeDock = new QDockWidget("RGB Parade", this);
+ m_RGBParadeDock = new QDockWidget(i18n("RGB Parade"), this);
m_RGBParadeDock->setObjectName(m_RGBParade->widgetName());
m_RGBParadeDock->setWidget(m_RGBParade);
addDockWidget(Qt::TopDockWidgetArea, m_RGBParadeDock);
- m_levels = new Levels(m_projectMonitor, m_clipMonitor, this);
- m_levelsDock = new QDockWidget("Levels", this);
- m_levelsDock->setObjectName(m_levels->widgetName());
- m_levelsDock->setWidget(m_levels);
- addDockWidget(Qt::TopDockWidgetArea, m_levelsDock);
+ m_histogram = new Histogram(m_projectMonitor, m_clipMonitor, this);
+ m_histogramDock = new QDockWidget(i18n("Histogram"), this);
+ m_histogramDock->setObjectName(m_histogram->widgetName());
+ m_histogramDock->setWidget(m_histogram);
+ addDockWidget(Qt::TopDockWidgetArea, m_histogramDock);
m_undoViewDock = new QDockWidget(i18n("Undo History"), this);
tabifyDockWidget(m_vectorscopeDock, m_waveformDock);
tabifyDockWidget(m_vectorscopeDock, m_RGBParadeDock);
- tabifyDockWidget(m_vectorscopeDock, m_levelsDock);
+ tabifyDockWidget(m_vectorscopeDock, m_histogramDock);
tabifyDockWidget(m_vectorscopeDock, m_undoViewDock);
tabifyDockWidget(m_vectorscopeDock, m_effectListDock);
connect(m_monitorManager, SIGNAL(raiseClipMonitor(bool)), m_vectorscope, SLOT(slotActiveMonitorChanged(bool)));
connect(m_monitorManager, SIGNAL(raiseClipMonitor(bool)), m_waveform, SLOT(slotActiveMonitorChanged(bool)));
connect(m_monitorManager, SIGNAL(raiseClipMonitor(bool)), m_RGBParade, SLOT(slotActiveMonitorChanged(bool)));
- connect(m_monitorManager, SIGNAL(raiseClipMonitor(bool)), m_levels, SLOT(slotActiveMonitorChanged(bool)));
+ connect(m_monitorManager, SIGNAL(raiseClipMonitor(bool)), m_histogram, SLOT(slotActiveMonitorChanged(bool)));
connect(m_effectList, SIGNAL(addEffect(const QDomElement)), this, SLOT(slotAddEffect(const QDomElement)));
connect(m_effectList, SIGNAL(reloadEffects()), this, SLOT(slotReloadEffects()));
m_vectorscopeDock->setTitleBarWidget(0);
m_waveformDock->setTitleBarWidget(0);
m_RGBParadeDock->setTitleBarWidget(0);
- m_levelsDock->setTitleBarWidget(0);
+ m_histogramDock->setTitleBarWidget(0);
} else {
if (!m_effectStackDock->isFloating()) { m_effectStackDock->setTitleBarWidget(new QWidget(this)); }
if (!m_clipMonitorDock->isFloating()) { m_clipMonitorDock->setTitleBarWidget(new QWidget(this)); }
if (!m_vectorscopeDock->isFloating()) { m_vectorscopeDock->setTitleBarWidget(new QWidget(this)); }
if (!m_waveformDock->isFloating()) { m_waveformDock->setTitleBarWidget(new QWidget(this)); }
if (!m_RGBParadeDock->isFloating()) { m_RGBParadeDock->setTitleBarWidget(new QWidget(this)); }
- if (!m_levelsDock->isFloating()) { m_levelsDock->setTitleBarWidget(new QWidget(this)); }
+ if (!m_histogramDock->isFloating()) { m_histogramDock->setTitleBarWidget(new QWidget(this)); }
}
KdenliveSettings::setShowtitlebars(show);
}
class DocClipBase;
class Render;
class Transition;
-class Levels;
+class Histogram;
class Vectorscope;
class Waveform;
class RGBParade;
QDockWidget *m_RGBParadeDock;
RGBParade *m_RGBParade;
- QDockWidget *m_levelsDock;
- Levels *m_levels;
+ QDockWidget *m_histogramDock;
+ Histogram *m_histogram;
QDockWidget *m_undoViewDock;
QUndoView *m_undoView;
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
- <class>Levels_UI</class>
- <widget class="QWidget" name="Levels_UI">
+ <class>Histogram_UI</class>
+ <widget class="QWidget" name="Histogram_UI">
<property name="geometry">
<rect>
<x>0</x>