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
60f260e0
Commit
60f260e0
authored
Aug 20, 2007
by
Søren Bøg
Committed by
Jean-Paul Saman
Apr 09, 2008
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Overlay - Added text demonstrations
Overlay - Added text demonstrations
parent
d8a9f942
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
65 additions
and
0 deletions
+65
-0
extras/misc/overlay-test.c
extras/misc/overlay-test.c
+65
-0
No files found.
extras/misc/overlay-test.c
View file @
60f260e0
...
@@ -141,6 +141,29 @@ void SetVisibility( FILE *p_cmd, FILE *p_res, int i_overlay, int i_visible ) {
...
@@ -141,6 +141,29 @@ void SetVisibility( FILE *p_cmd, FILE *p_res, int i_overlay, int i_visible ) {
i_visible
);
i_visible
);
}
}
void
SetTextAlpha
(
FILE
*
p_cmd
,
FILE
*
p_res
,
int
i_overlay
,
int
i_alpha
)
{
CheckedCommand
(
p_cmd
,
p_res
,
"SetTextAlpha %d %d
\n
"
,
i_overlay
,
i_alpha
);
}
void
SetTextColor
(
FILE
*
p_cmd
,
FILE
*
p_res
,
int
i_overlay
,
int
i_red
,
int
i_green
,
int
i_blue
)
{
CheckedCommand
(
p_cmd
,
p_res
,
"SetTextColor %d %d %d %d
\n
"
,
i_overlay
,
i_red
,
i_green
,
i_blue
);
}
void
SetTextSize
(
FILE
*
p_cmd
,
FILE
*
p_res
,
int
i_overlay
,
int
i_size
)
{
CheckedCommand
(
p_cmd
,
p_res
,
"SetTextSize %d %d
\n
"
,
i_overlay
,
i_size
);
}
int
GetTextSize
(
FILE
*
p_cmd
,
FILE
*
p_res
,
int
i_overlay
)
{
int
i_size
;
CheckedCommand
(
p_cmd
,
p_res
,
"GetTextSize %d
\n
"
,
i_overlay
);
fscanf
(
p_res
,
"%d"
,
&
i_size
);
return
i_size
;
}
/*****************************************************************************
/*****************************************************************************
* Test Routines
* Test Routines
*****************************************************************************/
*****************************************************************************/
...
@@ -181,6 +204,47 @@ void BasicTest( FILE *p_cmd, FILE *p_res, int i_overlay ) {
...
@@ -181,6 +204,47 @@ void BasicTest( FILE *p_cmd, FILE *p_res, int i_overlay ) {
sleep
(
5
);
sleep
(
5
);
}
}
void
TextTest
(
FILE
*
p_cmd
,
FILE
*
p_res
,
int
i_overlay
)
{
printf
(
"Sweeping (text) alpha..."
);
for
(
int
i_alpha
=
0xFF
;
i_alpha
>=
-
0xFF
;
i_alpha
-=
8
)
{
SetTextAlpha
(
p_cmd
,
p_res
,
i_overlay
,
abs
(
i_alpha
)
);
usleep
(
20000
);
}
SetTextAlpha
(
p_cmd
,
p_res
,
i_overlay
,
255
);
printf
(
" done
\n
"
);
printf
(
"Sweeping colors..."
);
for
(
int
i_red
=
0xFF
;
i_red
>=
0x00
;
i_red
-=
8
)
{
SetTextColor
(
p_cmd
,
p_res
,
i_overlay
,
i_red
,
0xFF
,
0xFF
);
usleep
(
20000
);
}
for
(
int
i_green
=
0xFF
;
i_green
>=
0x00
;
i_green
-=
8
)
{
SetTextColor
(
p_cmd
,
p_res
,
i_overlay
,
0x00
,
i_green
,
0xFF
);
usleep
(
20000
);
}
for
(
int
i_blue
=
0xFF
;
i_blue
>=
0x00
;
i_blue
-=
8
)
{
SetTextColor
(
p_cmd
,
p_res
,
i_overlay
,
0x00
,
0x00
,
i_blue
);
usleep
(
20000
);
}
SetTextColor
(
p_cmd
,
p_res
,
i_overlay
,
0x00
,
0x00
,
0x00
);
printf
(
" done
\n
"
);
printf
(
"Getting size..."
);
int
i_basesize
=
GetTextSize
(
p_cmd
,
p_res
,
i_overlay
);
printf
(
" done. Size is %d
\n
"
,
i_basesize
);
printf
(
"Sweeping size..."
);
for
(
float
f_theta
=
0
;
f_theta
<=
M_PI
;
f_theta
+=
M_PI
/
128
.
0
)
{
SetTextSize
(
p_cmd
,
p_res
,
i_overlay
,
i_basesize
*
(
1
+
3
*
sin
(
f_theta
)
)
);
usleep
(
20000
);
}
SetTextSize
(
p_cmd
,
p_res
,
i_overlay
,
i_basesize
);
printf
(
" done
\n
"
);
sleep
(
5
);
}
/*****************************************************************************
/*****************************************************************************
* main
* main
*****************************************************************************/
*****************************************************************************/
...
@@ -280,6 +344,7 @@ int main( int i_argc, char *ppsz_argv[] ) {
...
@@ -280,6 +344,7 @@ int main( int i_argc, char *ppsz_argv[] ) {
BasicTest
(
p_cmd
,
p_res
,
i_overlay_image
);
BasicTest
(
p_cmd
,
p_res
,
i_overlay_image
);
BasicTest
(
p_cmd
,
p_res
,
i_overlay_text
);
BasicTest
(
p_cmd
,
p_res
,
i_overlay_text
);
TextTest
(
p_cmd
,
p_res
,
i_overlay_text
);
DeleteImage
(
p_cmd
,
p_res
,
i_overlay_image
);
DeleteImage
(
p_cmd
,
p_res
,
i_overlay_image
);
DeleteImage
(
p_cmd
,
p_res
,
i_overlay_text
);
DeleteImage
(
p_cmd
,
p_res
,
i_overlay_text
);
...
...
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