Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Kdenlive
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
259
Issues
259
List
Boards
Labels
Service Desk
Milestones
Merge Requests
14
Merge Requests
14
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Multimedia
Kdenlive
Commits
f705c75c
Commit
f705c75c
authored
Jul 23, 2010
by
Simon Eugster
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Renamed Levels to Histogram (Levels = the Levels effect)
svn path=/trunk/kdenlive/; revision=4636
parent
e6d13a7c
Changes
8
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
70 additions
and
70 deletions
+70
-70
src/CMakeLists.txt
src/CMakeLists.txt
+3
-3
src/colorcorrection/histogramgenerator.cpp
src/colorcorrection/histogramgenerator.cpp
+14
-14
src/colorcorrection/histogramgenerator.h
src/colorcorrection/histogramgenerator.h
+8
-8
src/histogram.cpp
src/histogram.cpp
+19
-19
src/histogram.h
src/histogram.h
+10
-10
src/mainwindow.cpp
src/mainwindow.cpp
+11
-11
src/mainwindow.h
src/mainwindow.h
+3
-3
src/widgets/histogram_ui.ui
src/widgets/histogram_ui.ui
+2
-2
No files found.
src/CMakeLists.txt
View file @
f705c75c
...
...
@@ -94,7 +94,7 @@ kde4_add_ui_files(kdenlive_UI
widgets/colorplaneexport_ui.ui
widgets/waveform_ui.ui
widgets/rgbparade_ui.ui
widgets/
levels
_ui.ui
widgets/
histogram
_ui.ui
)
set
(
kdenlive_SRCS
...
...
@@ -198,13 +198,13 @@ set(kdenlive_SRCS
configtrackscommand.cpp
abstractscopewidget.cpp
rebuildgroupcommand.cpp
levels
.cpp
histogram
.cpp
rgbparade.cpp
vectorscope.cpp
waveform.cpp
colorplaneexport.cpp
colortools.cpp
colorcorrection/
levels
generator.cpp
colorcorrection/
histogram
generator.cpp
colorcorrection/rgbparadegenerator.cpp
colorcorrection/vectorscopegenerator.cpp
colorcorrection/waveformgenerator.cpp
...
...
src/colorcorrection/
levels
generator.cpp
→
src/colorcorrection/
histogram
generator.cpp
View file @
f705c75c
...
...
@@ -13,24 +13,24 @@
#include <QDebug>
#include <QImage>
#include <QPainter>
#include "
levels
generator.h"
#include "
histogram
generator.h"
LevelsGenerator
::
Levels
Generator
()
HistogramGenerator
::
Histogram
Generator
()
{
}
QImage
LevelsGenerator
::
calculateLevels
(
const
QSize
&
paradeSize
,
const
QImage
&
image
,
const
int
&
components
,
QImage
HistogramGenerator
::
calculateHistogram
(
const
QSize
&
paradeSize
,
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
&
Levels
Generator
::
ComponentY
)
!=
0
;
bool
drawR
=
(
components
&
Levels
Generator
::
ComponentR
)
!=
0
;
bool
drawG
=
(
components
&
Levels
Generator
::
ComponentG
)
!=
0
;
bool
drawB
=
(
components
&
Levels
Generator
::
ComponentB
)
!=
0
;
bool
drawY
=
(
components
&
Histogram
Generator
::
ComponentY
)
!=
0
;
bool
drawR
=
(
components
&
Histogram
Generator
::
ComponentR
)
!=
0
;
bool
drawG
=
(
components
&
Histogram
Generator
::
ComponentG
)
!=
0
;
bool
drawB
=
(
components
&
Histogram
Generator
::
ComponentB
)
!=
0
;
int
r
[
256
],
g
[
256
],
b
[
256
],
y
[
256
];
// Initialize the values to zero
...
...
@@ -76,10 +76,10 @@ QImage LevelsGenerator::calculateLevels(const QSize ¶deSize, const QImage &i
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
;
...
...
@@ -108,10 +108,10 @@ QImage LevelsGenerator::calculateLevels(const QSize ¶deSize, const QImage &i
wy
+=
partH
+
d
;
}
return
levels
;
return
histogram
;
}
QImage
Levels
Generator
::
drawComponent
(
const
int
*
y
,
const
QSize
&
size
,
const
float
&
scaling
,
const
QColor
&
color
,
const
bool
&
unscaled
)
const
QImage
Histogram
Generator
::
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
));
...
...
@@ -138,7 +138,7 @@ QImage LevelsGenerator::drawComponent(const int *y, const QSize &size, const flo
}
}
void
Levels
Generator
::
drawComponentFull
(
QPainter
*
davinci
,
const
int
*
y
,
const
float
&
scaling
,
const
QRect
&
rect
,
void
Histogram
Generator
::
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
);
...
...
src/colorcorrection/
levels
generator.h
→
src/colorcorrection/
histogram
generator.h
View file @
f705c75c
...
...
@@ -8,8 +8,8 @@
* (at your option) any later version. *
***************************************************************************/
#ifndef
LEVELS
GENERATOR_H
#define
LEVELS
GENERATOR_H
#ifndef
HISTOGRAM
GENERATOR_H
#define
HISTOGRAM
GENERATOR_H
#include <QObject>
...
...
@@ -19,16 +19,16 @@ class QPainter;
class
QRect
;
class
QSize
;
class
Levels
Generator
:
public
QObject
class
Histogram
Generator
:
public
QObject
{
public:
Levels
Generator
();
Histogram
Generator
();
/**
Calculates a
levels
display from the input image.
components are OR-ed
Levels
Generator::Components flags and decide with components (Y, R, G, B) to paint.
Calculates a
histogram
display from the input image.
components are OR-ed
Histogram
Generator::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
calculate
Levels
(
const
QSize
&
paradeSize
,
const
QImage
&
image
,
const
int
&
components
,
const
bool
&
unscaled
,
QImage
calculate
Histogram
(
const
QSize
&
paradeSize
,
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
;
...
...
@@ -40,4 +40,4 @@ public:
};
#endif //
LEVELS
GENERATOR_H
#endif //
HISTOGRAM
GENERATOR_H
src/
levels
.cpp
→
src/
histogram
.cpp
View file @
f705c75c
...
...
@@ -10,14 +10,14 @@
#include <QMenu>
#include <QTime>
#include "
levels
generator.h"
#include "
levels
.h"
#include "
histogram
generator.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
);
...
...
@@ -41,47 +41,47 @@ Levels::Levels(Monitor *projMonitor, Monitor *clipMonitor, QWidget *parent) :
}
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
)
*
Levels
Generator
::
ComponentY
|
(
ui
->
cbR
->
isChecked
()
?
1
:
0
)
*
Levels
Generator
::
ComponentR
|
(
ui
->
cbG
->
isChecked
()
?
1
:
0
)
*
Levels
Generator
::
ComponentG
|
(
ui
->
cbB
->
isChecked
()
?
1
:
0
)
*
Levels
Generator
::
ComponentB
;
const
int
componentFlags
=
(
ui
->
cbY
->
isChecked
()
?
1
:
0
)
*
Histogram
Generator
::
ComponentY
|
(
ui
->
cbR
->
isChecked
()
?
1
:
0
)
*
Histogram
Generator
::
ComponentR
|
(
ui
->
cbG
->
isChecked
()
?
1
:
0
)
*
Histogram
Generator
::
ComponentG
|
(
ui
->
cbB
->
isChecked
()
?
1
:
0
)
*
Histogram
Generator
::
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
();
...
...
src/
levels
.h
→
src/
histogram
.h
View file @
f705c75c
...
...
@@ -8,25 +8,25 @@
* (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
Levels
Generator
;
class
Histogram
Generator
;
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_levels
Generator
;
HistogramGenerator
*
m_histogram
Generator
;
QAction
*
m_aUnscaled
;
QRect
scopeRect
();
...
...
@@ -36,8 +36,8 @@ private:
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
src/mainwindow.cpp
View file @
f705c75c
...
...
@@ -55,7 +55,7 @@
#include "vectorscope.h"
#include "waveform.h"
#include "rgbparade.h"
#include "
levels
.h"
#include "
histogram
.h"
#include <KApplication>
#include <KAction>
...
...
@@ -229,16 +229,16 @@ MainWindow::MainWindow(const QString &MltPath, const KUrl & Url, QWidget *parent
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_
levels
Dock
);
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_
histogram
Dock
);
m_undoViewDock
=
new
QDockWidget
(
i18n
(
"Undo History"
),
this
);
...
...
@@ -271,7 +271,7 @@ MainWindow::MainWindow(const QString &MltPath, const KUrl & Url, QWidget *parent
tabifyDockWidget
(
m_vectorscopeDock
,
m_waveformDock
);
tabifyDockWidget
(
m_vectorscopeDock
,
m_RGBParadeDock
);
tabifyDockWidget
(
m_vectorscopeDock
,
m_
levels
Dock
);
tabifyDockWidget
(
m_vectorscopeDock
,
m_
histogram
Dock
);
tabifyDockWidget
(
m_vectorscopeDock
,
m_undoViewDock
);
tabifyDockWidget
(
m_vectorscopeDock
,
m_effectListDock
);
...
...
@@ -433,7 +433,7 @@ MainWindow::MainWindow(const QString &MltPath, const KUrl & Url, QWidget *parent
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
()));
...
...
@@ -3622,7 +3622,7 @@ void MainWindow::slotShowTitleBars(bool show)
m_vectorscopeDock
->
setTitleBarWidget
(
0
);
m_waveformDock
->
setTitleBarWidget
(
0
);
m_RGBParadeDock
->
setTitleBarWidget
(
0
);
m_
levels
Dock
->
setTitleBarWidget
(
0
);
m_
histogram
Dock
->
setTitleBarWidget
(
0
);
}
else
{
if
(
!
m_effectStackDock
->
isFloating
())
{
m_effectStackDock
->
setTitleBarWidget
(
new
QWidget
(
this
));
}
if
(
!
m_clipMonitorDock
->
isFloating
())
{
m_clipMonitorDock
->
setTitleBarWidget
(
new
QWidget
(
this
));
}
...
...
@@ -3637,7 +3637,7 @@ void MainWindow::slotShowTitleBars(bool show)
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_levels
Dock
->
setTitleBarWidget
(
new
QWidget
(
this
));
}
if
(
!
m_
histogramDock
->
isFloating
())
{
m_histogram
Dock
->
setTitleBarWidget
(
new
QWidget
(
this
));
}
}
KdenliveSettings
::
setShowtitlebars
(
show
);
}
...
...
src/mainwindow.h
View file @
f705c75c
...
...
@@ -61,7 +61,7 @@ class JogShuttle;
class
DocClipBase
;
class
Render
;
class
Transition
;
class
Levels
;
class
Histogram
;
class
Vectorscope
;
class
Waveform
;
class
RGBParade
;
...
...
@@ -163,8 +163,8 @@ private:
QDockWidget
*
m_RGBParadeDock
;
RGBParade
*
m_RGBParade
;
QDockWidget
*
m_
levels
Dock
;
Levels
*
m_levels
;
QDockWidget
*
m_
histogram
Dock
;
Histogram
*
m_histogram
;
QDockWidget
*
m_undoViewDock
;
QUndoView
*
m_undoView
;
...
...
src/widgets/
levels
_ui.ui
→
src/widgets/
histogram
_ui.ui
View file @
f705c75c
<?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>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment