Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc-2-2
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-2-2
Commits
1e48c75e
Commit
1e48c75e
authored
Apr 13, 2010
by
Laurent Aimar
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed and simplify a bit puzzle filter.
Pitch of input and output pictures can be differents... BP.
parent
3eacdd5a
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
29 additions
and
41 deletions
+29
-41
modules/video_filter/puzzle.c
modules/video_filter/puzzle.c
+29
-41
No files found.
modules/video_filter/puzzle.c
View file @
1e48c75e
...
@@ -223,65 +223,53 @@ static picture_t *Filter( filter_t *p_filter, picture_t *p_pic )
...
@@ -223,65 +223,53 @@ static picture_t *Filter( filter_t *p_filter, picture_t *p_pic )
for
(
int
i_plane
=
0
;
i_plane
<
p_outpic
->
i_planes
;
i_plane
++
)
for
(
int
i_plane
=
0
;
i_plane
<
p_outpic
->
i_planes
;
i_plane
++
)
{
{
const
plane_t
*
p_in
=
&
p_pic
->
p
[
i_plane
];
const
plane_t
*
p_in
=
&
p_pic
->
p
[
i_plane
];
const
int
i_pitch
=
p_in
->
i_pitch
;
plane_t
*
p_out
=
&
p_outpic
->
p
[
i_plane
];
plane_t
*
p_out
=
&
p_outpic
->
p
[
i_plane
];
for
(
int
i
=
0
;
i
<
i_cols
*
i_rows
;
i
++
)
for
(
int
i
=
0
;
i
<
i_cols
*
i_rows
;
i
++
)
{
{
int
i_col
=
i
%
i_cols
;
int
i_piece_height
=
p_out
->
i_visible_lines
/
i_rows
;
int
i_row
=
i
/
i_cols
;
int
i_piece_width
=
p_out
->
i_visible_pitch
/
i_cols
;
int
i_ocol
=
p_sys
->
pi_order
[
i
]
%
i_cols
;
int
i_orow
=
p_sys
->
pi_order
[
i
]
/
i_cols
;
int
i_col
=
(
i
%
i_cols
)
*
i_piece_width
;
int
i_last_row
=
i_row
+
1
;
int
i_row
=
(
i
/
i_cols
)
*
i_piece_height
;
i_orow
*=
p_in
->
i_lines
/
i_rows
;
int
i_last_row
=
i_row
+
i_piece_height
;
i_row
*=
p_in
->
i_lines
/
i_rows
;
i_last_row
*=
p_in
->
i_lines
/
i_rows
;
int
i_ocol
=
(
p_sys
->
pi_order
[
i
]
%
i_cols
)
*
i_piece_width
;
int
i_orow
=
(
p_sys
->
pi_order
[
i
]
/
i_cols
)
*
i_piece_height
;
if
(
p_sys
->
b_blackslot
&&
!
p_sys
->
b_finished
&&
i
==
p_sys
->
i_selected
)
if
(
p_sys
->
b_blackslot
&&
!
p_sys
->
b_finished
&&
i
==
p_sys
->
i_selected
)
{
{
uint8_t
color
=
(
i_plane
==
Y_PLANE
?
0x0
:
0x80
);
uint8_t
color
=
(
i_plane
==
Y_PLANE
?
0x0
:
0x80
);
for
(
;
i_row
<
i_last_row
;
i_row
++
,
i_orow
++
)
for
(
int
r
=
i_row
;
r
<
i_last_row
;
r
++
)
{
{
memset
(
p_out
->
p_pixels
+
i_row
*
i_pitch
+
i_col
*
i_pitch
/
i_cols
,
memset
(
p_out
->
p_pixels
+
r
*
p_out
->
i_pitch
+
i_col
,
color
,
i_pi
tch
/
i_cols
);
color
,
i_pi
ece_width
);
}
}
}
}
else
else
{
{
for
(
;
i_row
<
i_last_row
;
i_row
++
,
i_orow
++
)
for
(
int
r
=
i_row
,
or
=
i_orow
;
r
<
i_last_row
;
r
++
,
or
++
)
{
{
memcpy
(
p_out
->
p_pixels
+
i_row
*
i_pitch
+
i_col
*
i_pitch
/
i_cols
,
memcpy
(
p_out
->
p_pixels
+
r
*
p_out
->
i_pitch
+
i_col
,
p_in
->
p_pixels
+
i_orow
*
i_pitch
+
i_ocol
*
i_pitch
/
i_cols
,
p_in
->
p_pixels
+
or
*
p_in
->
i_pitch
+
i_ocol
,
i_pi
tch
/
i_cols
);
i_pi
ece_width
);
}
}
}
}
}
}
/* Draw the borders of the selected slot */
if
(
p_sys
->
i_selected
!=
-
1
&&
!
p_sys
->
b_blackslot
)
{
const
plane_t
*
p_in
=
&
p_pic
->
p
[
Y_PLANE
];
const
int
i_pitch
=
p_in
->
i_pitch
;
plane_t
*
p_out
=
&
p_outpic
->
p
[
Y_PLANE
];
int
i_col
=
p_sys
->
i_selected
%
i_cols
;
/* Draw the borders of the selected slot */
int
i_row
=
p_sys
->
i_selected
/
i_cols
;
if
(
i_plane
==
0
&&
!
p_sys
->
b_blackslot
&&
p_sys
->
i_selected
==
i
)
int
i_last_row
=
i_row
+
1
;
{
i_row
*=
p_in
->
i_lines
/
i_rows
;
memset
(
p_out
->
p_pixels
+
i_row
*
p_out
->
i_pitch
+
i_col
,
i_last_row
*=
p_in
->
i_lines
/
i_rows
;
0xff
,
i_piece_width
)
;
memset
(
p_out
->
p_pixels
+
i_row
*
i_pitch
+
i_col
*
i_pitch
/
i_cols
,
for
(
int
r
=
i_row
;
r
<
i_last_row
;
r
++
)
0xff
,
i_pitch
/
i_cols
);
{
for
(
;
i_row
<
i_last_row
;
i_row
++
)
p_out
->
p_pixels
[
r
*
p_out
->
i_pitch
+
i_col
+
0
+
0
]
=
0xff
;
{
p_out
->
p_pixels
[
r
*
p_out
->
i_pitch
+
i_col
+
i_piece_width
-
1
]
=
0xff
;
p_out
->
p_pixels
[
i_row
*
i_pitch
}
+
i_col
*
i_pitch
/
i_cols
]
=
0xff
;
memset
(
p_out
->
p_pixels
+
(
i_last_row
-
1
)
*
p_out
->
i_pitch
+
i_col
,
p_out
->
p_pixels
[
i_row
*
i_pitch
0xff
,
i_piece_width
);
+
(
i_col
+
1
)
*
i_pitch
/
i_cols
-
1
]
=
0xff
;
}
}
}
i_row
--
;
memset
(
p_out
->
p_pixels
+
i_row
*
i_pitch
+
i_col
*
i_pitch
/
i_cols
,
0xff
,
i_pitch
/
i_cols
);
}
}
/* Draw the 'Shuffle' button if the puzzle is finished */
/* Draw the 'Shuffle' button if the puzzle is finished */
...
...
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