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
94ca70d4
Commit
94ca70d4
authored
Aug 19, 2014
by
Rémi Denis-Courmont
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
adjust: convert hue from [0..360] integer to [-180..+180] float
parent
30838535
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
8 additions
and
8 deletions
+8
-8
lib/media_player.c
lib/media_player.c
+1
-1
lib/video.c
lib/video.c
+1
-1
modules/video_filter/adjust.c
modules/video_filter/adjust.c
+6
-6
No files found.
lib/media_player.c
View file @
94ca70d4
...
...
@@ -556,7 +556,7 @@ libvlc_media_player_new( libvlc_instance_t *instance )
var_Create
(
mp
,
"contrast"
,
VLC_VAR_FLOAT
|
VLC_VAR_DOINHERIT
);
var_Create
(
mp
,
"brightness"
,
VLC_VAR_FLOAT
|
VLC_VAR_DOINHERIT
);
var_Create
(
mp
,
"hue"
,
VLC_VAR_
INTEGER
|
VLC_VAR_DOINHERIT
);
var_Create
(
mp
,
"hue"
,
VLC_VAR_
FLOAT
|
VLC_VAR_DOINHERIT
);
var_Create
(
mp
,
"saturation"
,
VLC_VAR_FLOAT
|
VLC_VAR_DOINHERIT
);
var_Create
(
mp
,
"gamma"
,
VLC_VAR_FLOAT
|
VLC_VAR_DOINHERIT
);
...
...
lib/video.c
View file @
94ca70d4
...
...
@@ -869,7 +869,7 @@ adjust_option_bynumber( unsigned option )
{
"adjust"
,
0
},
{
"contrast"
,
VLC_VAR_FLOAT
},
{
"brightness"
,
VLC_VAR_FLOAT
},
{
"hue"
,
VLC_VAR_
INTEGER
},
{
"hue"
,
VLC_VAR_
FLOAT
},
{
"saturation"
,
VLC_VAR_FLOAT
},
{
"gamma"
,
VLC_VAR_FLOAT
},
};
...
...
modules/video_filter/adjust.c
View file @
94ca70d4
...
...
@@ -91,7 +91,7 @@ vlc_module_begin ()
add_float_with_range
(
"brightness"
,
1
.
0
,
0
.
0
,
2
.
0
,
LUM_TEXT
,
LUM_LONGTEXT
,
false
)
change_safe
()
add_
integer_with_range
(
"hue"
,
0
,
0
,
360
,
add_
float_with_range
(
"hue"
,
0
,
-
180
.,
+
180
.
,
HUE_TEXT
,
HUE_LONGTEXT
,
false
)
change_safe
()
add_float_with_range
(
"saturation"
,
1
.
0
,
0
.
0
,
3
.
0
,
...
...
@@ -121,7 +121,7 @@ struct filter_sys_t
vlc_mutex_t
lock
;
double
f_contrast
;
double
f_brightness
;
int
i
_hue
;
float
f
_hue
;
double
f_saturation
;
double
f_gamma
;
bool
b_brightness_threshold
;
...
...
@@ -158,7 +158,7 @@ static int Create( vlc_object_t *p_this )
p_sys
->
f_contrast
=
var_CreateGetFloatCommand
(
p_filter
,
"contrast"
);
p_sys
->
f_brightness
=
var_CreateGetFloatCommand
(
p_filter
,
"brightness"
);
p_sys
->
i_hue
=
var_CreateGetInteger
Command
(
p_filter
,
"hue"
);
p_sys
->
f_hue
=
var_CreateGetFloat
Command
(
p_filter
,
"hue"
);
p_sys
->
f_saturation
=
var_CreateGetFloatCommand
(
p_filter
,
"saturation"
);
p_sys
->
f_gamma
=
var_CreateGetFloatCommand
(
p_filter
,
"gamma"
);
p_sys
->
b_brightness_threshold
=
...
...
@@ -254,7 +254,7 @@ static picture_t *FilterPlanar( filter_t *p_filter, picture_t *p_pic )
vlc_mutex_lock
(
&
p_sys
->
lock
);
i_cont
=
(
int
)(
p_sys
->
f_contrast
*
255
);
i_lum
=
(
int
)(
(
p_sys
->
f_brightness
-
1
.
0
)
*
255
);
f_hue
=
(
float
)(
p_sys
->
i_hue
*
M_PI
/
180
);
f_hue
=
p_sys
->
f_hue
*
(
float
)(
M_PI
/
180
.
);
i_sat
=
(
int
)(
p_sys
->
f_saturation
*
256
);
f_gamma
=
1
.
0
/
p_sys
->
f_gamma
;
b_thres
=
p_sys
->
b_brightness_threshold
;
...
...
@@ -415,7 +415,7 @@ static picture_t *FilterPacked( filter_t *p_filter, picture_t *p_pic )
vlc_mutex_lock
(
&
p_sys
->
lock
);
i_cont
=
(
int
)(
p_sys
->
f_contrast
*
255
);
i_lum
=
(
int
)(
(
p_sys
->
f_brightness
-
1
.
0
)
*
255
);
f_hue
=
(
float
)(
p_sys
->
i_hue
*
M_PI
/
180
);
f_hue
=
p_sys
->
f_hue
*
(
float
)(
M_PI
/
180
.
);
i_sat
=
(
int
)(
p_sys
->
f_saturation
*
256
);
f_gamma
=
1
.
0
/
p_sys
->
f_gamma
;
b_thres
=
p_sys
->
b_brightness_threshold
;
...
...
@@ -550,7 +550,7 @@ static int AdjustCallback( vlc_object_t *p_this, char const *psz_var,
else
if
(
!
strcmp
(
psz_var
,
"brightness"
)
)
p_sys
->
f_brightness
=
newval
.
f_float
;
else
if
(
!
strcmp
(
psz_var
,
"hue"
)
)
p_sys
->
i_hue
=
newval
.
i_in
t
;
p_sys
->
f_hue
=
newval
.
f_floa
t
;
else
if
(
!
strcmp
(
psz_var
,
"saturation"
)
)
p_sys
->
f_saturation
=
newval
.
f_float
;
else
if
(
!
strcmp
(
psz_var
,
"gamma"
)
)
...
...
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