Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
GSoC
GSoC2018
macOS
vlc
Commits
a40c82c8
Commit
a40c82c8
authored
Dec 18, 2010
by
Laurent Aimar
Browse files
Made SpuRegionPlace() code a bit more obvious.
parent
8f85c827
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/video_output/vout_subpictures.c
View file @
a40c82c8
...
...
@@ -530,45 +530,40 @@ static void SpuRegionPlace( int *pi_x, int *pi_y,
const
subpicture_t
*
p_subpic
,
const
subpicture_region_t
*
p_region
)
{
const
int
i_delta_x
=
p_region
->
i_x
;
const
int
i_delta_y
=
p_region
->
i_y
;
int
i_x
,
i_y
;
assert
(
p_region
->
i_x
!=
INT_MAX
&&
p_region
->
i_y
!=
INT_MAX
);
if
(
p_region
->
i_align
&
SUBPICTURE_ALIGN_TOP
)
{
i_y
=
i_delta_y
;
}
else
if
(
p_region
->
i_align
&
SUBPICTURE_ALIGN_BOTTOM
)
{
i_y
=
p_subpic
->
i_original_picture_height
-
p_region
->
fmt
.
i_height
-
i_delta_y
;
}
else
{
i_y
=
p_subpic
->
i_original_picture_height
/
2
-
p_region
->
fmt
.
i_height
/
2
;
}
if
(
p_region
->
i_align
&
SUBPICTURE_ALIGN_LEFT
)
{
i_x
=
i_delta_x
;
}
else
if
(
p_region
->
i_align
&
SUBPICTURE_ALIGN_RIGHT
)
if
(
p_subpic
->
b_absolute
)
{
i_x
=
p_subpic
->
i_original_picture_width
-
p_region
->
fmt
.
i_width
-
i_delta_x
;
*
pi_x
=
p_region
->
i_x
;
*
pi_y
=
p_region
->
i_y
;
}
else
{
i_x
=
p_subpic
->
i_original_picture_width
/
2
-
p_region
->
fmt
.
i_width
/
2
;
}
if
(
p_region
->
i_align
&
SUBPICTURE_ALIGN_TOP
)
{
*
pi_y
=
p_region
->
i_y
;
}
else
if
(
p_region
->
i_align
&
SUBPICTURE_ALIGN_BOTTOM
)
{
*
pi_y
=
p_subpic
->
i_original_picture_height
-
p_region
->
fmt
.
i_height
-
p_region
->
i_y
;
}
else
{
*
pi_y
=
p_subpic
->
i_original_picture_height
/
2
-
p_region
->
fmt
.
i_height
/
2
;
}
if
(
p_subpic
->
b_absolute
)
{
i_x
=
i_delta_x
;
i_y
=
i_delta_y
;
if
(
p_region
->
i_align
&
SUBPICTURE_ALIGN_LEFT
)
{
*
pi_x
=
p_region
->
i_x
;
}
else
if
(
p_region
->
i_align
&
SUBPICTURE_ALIGN_RIGHT
)
{
*
pi_x
=
p_subpic
->
i_original_picture_width
-
p_region
->
fmt
.
i_width
-
p_region
->
i_x
;
}
else
{
*
pi_x
=
p_subpic
->
i_original_picture_width
/
2
-
p_region
->
fmt
.
i_width
/
2
;
}
}
*
pi_x
=
i_x
;
*
pi_y
=
i_y
;
}
/**
...
...
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