Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Redmine
Redmine
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Metrics
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
videolan
vlc
Commits
19cb1a18
Commit
19cb1a18
authored
Jan 22, 2004
by
Sigmund Augdal Helberg
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
all: gamma correction patch by Arwed von Merkatz <v.merkatz@gmx.net>
parent
a1c2c16b
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
43 additions
and
5 deletions
+43
-5
modules/gui/wxwindows/interface.cpp
modules/gui/wxwindows/interface.cpp
+25
-1
modules/gui/wxwindows/wxwindows.h
modules/gui/wxwindows/wxwindows.h
+3
-1
modules/video_filter/adjust.c
modules/video_filter/adjust.c
+15
-3
No files found.
modules/gui/wxwindows/interface.cpp
View file @
19cb1a18
...
@@ -2,7 +2,7 @@
...
@@ -2,7 +2,7 @@
* interface.cpp : wxWindows plugin for vlc
* interface.cpp : wxWindows plugin for vlc
*****************************************************************************
*****************************************************************************
* Copyright (C) 2000-2001, 2003 VideoLAN
* Copyright (C) 2000-2001, 2003 VideoLAN
* $Id: interface.cpp,v 1.8
3 2004/01/05 13:00:39 zorglub
Exp $
* $Id: interface.cpp,v 1.8
4 2004/01/22 15:00:10 sigmunau
Exp $
*
*
* Authors: Gildas Bazin <gbazin@netcourrier.com>
* Authors: Gildas Bazin <gbazin@netcourrier.com>
*
*
...
@@ -145,6 +145,7 @@ enum
...
@@ -145,6 +145,7 @@ enum
Contrast_Event
,
Contrast_Event
,
Brightness_Event
,
Brightness_Event
,
Saturation_Event
,
Saturation_Event
,
Gamma_Event
,
Ratio_Event
,
Ratio_Event
,
Visual_Event
,
Visual_Event
,
...
@@ -200,6 +201,7 @@ BEGIN_EVENT_TABLE(Interface, wxFrame)
...
@@ -200,6 +201,7 @@ BEGIN_EVENT_TABLE(Interface, wxFrame)
EVT_COMMAND_SCROLL
(
Contrast_Event
,
Interface
::
OnContrastUpdate
)
EVT_COMMAND_SCROLL
(
Contrast_Event
,
Interface
::
OnContrastUpdate
)
EVT_COMMAND_SCROLL
(
Brightness_Event
,
Interface
::
OnBrightnessUpdate
)
EVT_COMMAND_SCROLL
(
Brightness_Event
,
Interface
::
OnBrightnessUpdate
)
EVT_COMMAND_SCROLL
(
Saturation_Event
,
Interface
::
OnSaturationUpdate
)
EVT_COMMAND_SCROLL
(
Saturation_Event
,
Interface
::
OnSaturationUpdate
)
EVT_COMMAND_SCROLL
(
Gamma_Event
,
Interface
::
OnGammaUpdate
)
END_EVENT_TABLE
()
END_EVENT_TABLE
()
...
@@ -546,11 +548,21 @@ void Interface::CreateOurExtraPanel()
...
@@ -546,11 +548,21 @@ void Interface::CreateOurExtraPanel()
saturation_sizer
->
Add
(
saturation_slider
,
1
,
0
,
0
);
saturation_sizer
->
Add
(
saturation_slider
,
1
,
0
,
0
);
saturation_sizer
->
Layout
();
saturation_sizer
->
Layout
();
wxBoxSizer
*
gamma_sizer
=
new
wxBoxSizer
(
wxHORIZONTAL
);
wxStaticText
*
gamma_text
=
new
wxStaticText
(
extra_frame
,
-
1
,
wxU
(
_
(
"Gamma"
))
);
gamma_slider
=
new
wxSlider
(
extra_frame
,
Gamma_Event
,
0
,
0
,
100
,
wxDefaultPosition
,
wxDefaultSize
);
gamma_sizer
->
Add
(
gamma_text
,
1
,
0
,
0
);
gamma_sizer
->
Add
(
gamma_slider
,
1
,
0
,
0
);
gamma_sizer
->
Layout
();
adjust_sizer
->
Add
(
adjust_check
,
1
,
wxEXPAND
,
0
);
adjust_sizer
->
Add
(
adjust_check
,
1
,
wxEXPAND
,
0
);
adjust_sizer
->
Add
(
hue_sizer
,
1
,
wxEXPAND
,
0
);
adjust_sizer
->
Add
(
hue_sizer
,
1
,
wxEXPAND
,
0
);
adjust_sizer
->
Add
(
contrast_sizer
,
1
,
wxEXPAND
,
0
);
adjust_sizer
->
Add
(
contrast_sizer
,
1
,
wxEXPAND
,
0
);
adjust_sizer
->
Add
(
brightness_sizer
,
1
,
wxEXPAND
,
0
);
adjust_sizer
->
Add
(
brightness_sizer
,
1
,
wxEXPAND
,
0
);
adjust_sizer
->
Add
(
saturation_sizer
,
1
,
wxEXPAND
,
0
);
adjust_sizer
->
Add
(
saturation_sizer
,
1
,
wxEXPAND
,
0
);
adjust_sizer
->
Add
(
gamma_sizer
,
1
,
wxEXPAND
,
0
);
extra_sizer
->
Add
(
adjust_sizer
,
1
,
wxBOTTOM
,
5
);
extra_sizer
->
Add
(
adjust_sizer
,
1
,
wxBOTTOM
,
5
);
...
@@ -637,6 +649,7 @@ void Interface::CreateOurExtraPanel()
...
@@ -637,6 +649,7 @@ void Interface::CreateOurExtraPanel()
contrast_slider
->
Enable
();
contrast_slider
->
Enable
();
brightness_slider
->
Enable
();
brightness_slider
->
Enable
();
hue_slider
->
Enable
();
hue_slider
->
Enable
();
gamma_slider
->
Enable
();
}
}
else
else
{
{
...
@@ -645,6 +658,7 @@ void Interface::CreateOurExtraPanel()
...
@@ -645,6 +658,7 @@ void Interface::CreateOurExtraPanel()
contrast_slider
->
Disable
();
contrast_slider
->
Disable
();
brightness_slider
->
Disable
();
brightness_slider
->
Disable
();
hue_slider
->
Disable
();
hue_slider
->
Disable
();
gamma_slider
->
Disable
();
}
}
if
(
psz_filters
)
free
(
psz_filters
);
if
(
psz_filters
)
free
(
psz_filters
);
...
@@ -662,6 +676,9 @@ void Interface::CreateOurExtraPanel()
...
@@ -662,6 +676,9 @@ void Interface::CreateOurExtraPanel()
f_value
=
config_GetFloat
(
p_intf
,
"brightness"
);
f_value
=
config_GetFloat
(
p_intf
,
"brightness"
);
if
(
f_value
>
0
&&
f_value
<
2
)
if
(
f_value
>
0
&&
f_value
<
2
)
brightness_slider
->
SetValue
(
(
int
)(
100
*
f_value
)
);
brightness_slider
->
SetValue
(
(
int
)(
100
*
f_value
)
);
f_value
=
config_GetFloat
(
p_intf
,
"gamma"
);
if
(
f_value
>
0
&&
f_value
<
10
)
gamma_slider
->
SetValue
(
(
int
)(
10
*
f_value
)
);
extra_frame
->
Hide
();
extra_frame
->
Hide
();
}
}
...
@@ -983,6 +1000,7 @@ void Interface::OnEnableAdjust(wxCommandEvent& event)
...
@@ -983,6 +1000,7 @@ void Interface::OnEnableAdjust(wxCommandEvent& event)
saturation_slider
->
Enable
();
saturation_slider
->
Enable
();
contrast_slider
->
Enable
();
contrast_slider
->
Enable
();
hue_slider
->
Enable
();
hue_slider
->
Enable
();
gamma_slider
->
Enable
();
}
}
else
else
{
{
...
@@ -1025,6 +1043,7 @@ void Interface::OnEnableAdjust(wxCommandEvent& event)
...
@@ -1025,6 +1043,7 @@ void Interface::OnEnableAdjust(wxCommandEvent& event)
saturation_slider
->
Disable
();
saturation_slider
->
Disable
();
contrast_slider
->
Disable
();
contrast_slider
->
Disable
();
hue_slider
->
Disable
();
hue_slider
->
Disable
();
gamma_slider
->
Disable
();
}
}
if
(
psz_filters
)
free
(
psz_filters
);
if
(
psz_filters
)
free
(
psz_filters
);
if
(
psz_new
)
free
(
psz_new
);
if
(
psz_new
)
free
(
psz_new
);
...
@@ -1051,6 +1070,11 @@ void Interface::OnContrastUpdate(wxScrollEvent& event)
...
@@ -1051,6 +1070,11 @@ void Interface::OnContrastUpdate(wxScrollEvent& event)
}
}
void
Interface
::
OnGammaUpdate
(
wxScrollEvent
&
event
)
{
config_PutFloat
(
p_intf
,
"gamma"
,
(
float
)
event
.
GetPosition
()
/
10
);
}
void
Interface
::
OnRatio
(
wxCommandEvent
&
event
)
void
Interface
::
OnRatio
(
wxCommandEvent
&
event
)
{
{
config_PutPsz
(
p_intf
,
"aspect-ratio"
,
ratio_combo
->
GetValue
().
mb_str
()
);
config_PutPsz
(
p_intf
,
"aspect-ratio"
,
ratio_combo
->
GetValue
().
mb_str
()
);
...
...
modules/gui/wxwindows/wxwindows.h
View file @
19cb1a18
...
@@ -2,7 +2,7 @@
...
@@ -2,7 +2,7 @@
* wxwindows.h: private wxWindows interface description
* wxwindows.h: private wxWindows interface description
*****************************************************************************
*****************************************************************************
* Copyright (C) 1999, 2000 VideoLAN
* Copyright (C) 1999, 2000 VideoLAN
* $Id: wxwindows.h,v 1.8
5 2004/01/15 21:49:07
sigmunau Exp $
* $Id: wxwindows.h,v 1.8
6 2004/01/22 15:00:10
sigmunau Exp $
*
*
* Authors: Gildas Bazin <gbazin@netcourrier.com>
* Authors: Gildas Bazin <gbazin@netcourrier.com>
*
*
...
@@ -178,6 +178,7 @@ public:
...
@@ -178,6 +178,7 @@ public:
wxSlider
*
contrast_slider
;
wxSlider
*
contrast_slider
;
wxSlider
*
saturation_slider
;
wxSlider
*
saturation_slider
;
wxSlider
*
hue_slider
;
wxSlider
*
hue_slider
;
wxSlider
*
gamma_slider
;
wxStaticBox
*
other_box
;
wxStaticBox
*
other_box
;
wxComboBox
*
ratio_combo
;
wxComboBox
*
ratio_combo
;
...
@@ -218,6 +219,7 @@ private:
...
@@ -218,6 +219,7 @@ private:
void
OnContrastUpdate
(
wxScrollEvent
&
event
);
void
OnContrastUpdate
(
wxScrollEvent
&
event
);
void
OnBrightnessUpdate
(
wxScrollEvent
&
event
);
void
OnBrightnessUpdate
(
wxScrollEvent
&
event
);
void
OnSaturationUpdate
(
wxScrollEvent
&
event
);
void
OnSaturationUpdate
(
wxScrollEvent
&
event
);
void
OnGammaUpdate
(
wxScrollEvent
&
event
);
void
OnRatio
(
wxCommandEvent
&
event
);
void
OnRatio
(
wxCommandEvent
&
event
);
void
OnEnableVisual
(
wxCommandEvent
&
event
);
void
OnEnableVisual
(
wxCommandEvent
&
event
);
...
...
modules/video_filter/adjust.c
View file @
19cb1a18
...
@@ -2,7 +2,7 @@
...
@@ -2,7 +2,7 @@
* adjust.c : Contrast/Hue/Saturation/Brightness video plugin for vlc
* adjust.c : Contrast/Hue/Saturation/Brightness video plugin for vlc
*****************************************************************************
*****************************************************************************
* Copyright (C) 2000, 2001, 2002, 2003 VideoLAN
* Copyright (C) 2000, 2001, 2002, 2003 VideoLAN
* $Id: adjust.c,v 1.1
4 2003/10/15 22:49:48 gbazin
Exp $
* $Id: adjust.c,v 1.1
5 2004/01/22 15:00:10 sigmunau
Exp $
*
*
* Authors: Simon Latapie <garf@via.ecp.fr>
* Authors: Simon Latapie <garf@via.ecp.fr>
*
*
...
@@ -65,6 +65,8 @@ static int SendEvents( vlc_object_t *, char const *,
...
@@ -65,6 +65,8 @@ static int SendEvents( vlc_object_t *, char const *,
#define SAT_LONGTEXT N_("Set the image saturation, between 0 and 3. Defaults to 1")
#define SAT_LONGTEXT N_("Set the image saturation, between 0 and 3. Defaults to 1")
#define LUM_TEXT N_("Set image brightness")
#define LUM_TEXT N_("Set image brightness")
#define LUM_LONGTEXT N_("Set the image brightness, between 0 and 2. Defaults to 1")
#define LUM_LONGTEXT N_("Set the image brightness, between 0 and 2. Defaults to 1")
#define GAMMA_TEXT N_("Set image gamma")
#define GAMMA_LONGTEXT N_("Set the image gamma, between 0.01 and 10. Defaults to 1")
vlc_module_begin
();
vlc_module_begin
();
...
@@ -73,7 +75,8 @@ vlc_module_begin();
...
@@ -73,7 +75,8 @@ vlc_module_begin();
add_float_with_range
(
"brightness"
,
1
.
0
,
0
.
0
,
2
.
0
,
NULL
,
LUM_TEXT
,
LUM_LONGTEXT
,
VLC_FALSE
);
add_float_with_range
(
"brightness"
,
1
.
0
,
0
.
0
,
2
.
0
,
NULL
,
LUM_TEXT
,
LUM_LONGTEXT
,
VLC_FALSE
);
add_integer_with_range
(
"hue"
,
0
,
0
,
360
,
NULL
,
HUE_TEXT
,
HUE_LONGTEXT
,
VLC_FALSE
);
add_integer_with_range
(
"hue"
,
0
,
0
,
360
,
NULL
,
HUE_TEXT
,
HUE_LONGTEXT
,
VLC_FALSE
);
add_float_with_range
(
"saturation"
,
1
.
0
,
0
.
0
,
3
.
0
,
NULL
,
SAT_TEXT
,
SAT_LONGTEXT
,
VLC_FALSE
);
add_float_with_range
(
"saturation"
,
1
.
0
,
0
.
0
,
3
.
0
,
NULL
,
SAT_TEXT
,
SAT_LONGTEXT
,
VLC_FALSE
);
set_description
(
_
(
"contrast/hue/saturation/brightness filter"
)
);
add_float_with_range
(
"gamma"
,
1
.
0
,
0
.
01
,
10
.
0
,
NULL
,
GAMMA_TEXT
,
GAMMA_LONGTEXT
,
VLC_FALSE
);
set_description
(
_
(
"contrast/hue/saturation/brightness/gamma filter"
)
);
set_capability
(
"video filter"
,
0
);
set_capability
(
"video filter"
,
0
);
add_shortcut
(
"adjust"
);
add_shortcut
(
"adjust"
);
set_callbacks
(
Create
,
Destroy
);
set_callbacks
(
Create
,
Destroy
);
...
@@ -204,12 +207,14 @@ static void Destroy( vlc_object_t *p_this )
...
@@ -204,12 +207,14 @@ static void Destroy( vlc_object_t *p_this )
static
void
Render
(
vout_thread_t
*
p_vout
,
picture_t
*
p_pic
)
static
void
Render
(
vout_thread_t
*
p_vout
,
picture_t
*
p_pic
)
{
{
int
pi_luma
[
256
];
int
pi_luma
[
256
];
int
pi_gamma
[
256
];
picture_t
*
p_outpic
;
picture_t
*
p_outpic
;
uint8_t
*
p_in
,
*
p_in_v
,
*
p_in_end
,
*
p_line_end
;
uint8_t
*
p_in
,
*
p_in_v
,
*
p_in_end
,
*
p_line_end
;
uint8_t
*
p_out
,
*
p_out_v
;
uint8_t
*
p_out
,
*
p_out_v
;
double
f_hue
;
double
f_hue
;
double
f_gamma
;
int32_t
i_cont
,
i_lum
;
int32_t
i_cont
,
i_lum
;
int
i_sat
,
i_sin
,
i_cos
,
i_x
,
i_y
;
int
i_sat
,
i_sin
,
i_cos
,
i_x
,
i_y
;
int
i
;
int
i
;
...
@@ -233,15 +238,22 @@ static void Render( vout_thread_t *p_vout, picture_t *p_pic )
...
@@ -233,15 +238,22 @@ static void Render( vout_thread_t *p_vout, picture_t *p_pic )
i_lum
=
(
config_GetFloat
(
p_vout
,
"brightness"
)
-
1
.
0
)
*
255
;
i_lum
=
(
config_GetFloat
(
p_vout
,
"brightness"
)
-
1
.
0
)
*
255
;
f_hue
=
config_GetInt
(
p_vout
,
"hue"
)
*
M_PI
/
180
;
f_hue
=
config_GetInt
(
p_vout
,
"hue"
)
*
M_PI
/
180
;
i_sat
=
config_GetFloat
(
p_vout
,
"saturation"
)
*
256
;
i_sat
=
config_GetFloat
(
p_vout
,
"saturation"
)
*
256
;
f_gamma
=
1
.
0
/
config_GetFloat
(
p_vout
,
"gamma"
);
/* Contrast is a fast but kludged function, so I put this gap to be
/* Contrast is a fast but kludged function, so I put this gap to be
* cleaner :) */
* cleaner :) */
i_lum
+=
128
-
i_cont
/
2
;
i_lum
+=
128
-
i_cont
/
2
;
/* Fill the gamma lookup table */
for
(
i
=
0
;
i
<
256
;
i
++
)
{
pi_gamma
[
i
]
=
clip
(
pow
(
i
/
255
.
0
,
f_gamma
)
*
255
.
0
);
}
/* Fill the luma lookup table */
/* Fill the luma lookup table */
for
(
i
=
0
;
i
<
256
;
i
++
)
for
(
i
=
0
;
i
<
256
;
i
++
)
{
{
pi_luma
[
i
]
=
clip
(
i_lum
+
i_cont
*
i
/
256
)
;
pi_luma
[
i
]
=
pi_gamma
[
clip
(
i_lum
+
i_cont
*
i
/
256
)]
;
}
}
/*
/*
...
...
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