/
SDL-Overlay.html-inc
138 lines (113 loc) · 4.44 KB
/
SDL-Overlay.html-inc
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
<div class="pod">
<!-- INDEX START -->
<h3 id="TOP">Index</h3>
<ul><li><a href="#NAME">NAME</a>
<ul><li><a href="#CATEGORY">CATEGORY</a></li>
</ul>
</li>
<li><a href="#SYNOPSIS">SYNOPSIS</a></li>
<li><a href="#DESCRIPTION">DESCRIPTION</a></li>
<li><a href="#METHODS">METHODS</a>
<ul><li><a href="#new_width_height_YUV_flag_display">new ( $width, $height, $YUV_flag, $display) </a>
<ul><li><a href="#YUV_Flags">YUV_Flags</a></li>
</ul>
</li>
<li><a href="#format">format</a></li>
<li><a href="#w_h">w, h</a></li>
<li><a href="#planes">planes</a></li>
<li><a href="#pitches">pitches</a></li>
<li><a href="#pixels">pixels</a></li>
<li><a href="#hw_overlay">hw_overlay</a></li>
</ul>
</li>
<li><a href="#AUTHORS">AUTHORS</a>
</li>
</ul><hr />
<!-- INDEX END -->
<h1 id="NAME">NAME</h1><p><a href="#TOP" class="toplink">Top</a></p>
<div id="NAME_CONTENT">
<p>SDL::Overlay - YUV Video overlay</p>
</div>
<h2 id="CATEGORY">CATEGORY</h2>
<div id="CATEGORY_CONTENT">
<p>Core, Video, Structure</p>
</div>
<h1 id="SYNOPSIS">SYNOPSIS</h1><p><a href="#TOP" class="toplink">Top</a></p>
<div id="SYNOPSIS_CONTENT">
<p>First import the following modules to get access to constants and functions needed for overlay.</p>
<pre> use SDL;
use SDL::Video;
use SDL::Overlay;
</pre>
<p>Init the video susbsystem.</p>
<pre> SDL::Init(SDL_INIT_VIDEO);
</pre>
<p>Create a display to use. </p>
<pre> my $display = SDL::Video::set_video_mode(640, 480, 32, SDL_SWSURFACE);
</pre>
<p>Create and attach the display to a new overlay</p>
<pre> my $overlay = SDL::Overlay->new( 100, 100, SDL_YV12_OVERLAY, $display);
</pre>
</div>
<h1 id="DESCRIPTION">DESCRIPTION</h1><p><a href="#TOP" class="toplink">Top</a></p>
<div id="DESCRIPTION_CONTENT">
<p>A <code>SDL_Overlay</code> allows for video rendering on an <code>SDL_Surface</code> which is a display. </p>
<p>The term 'overlay' is a misnomer since, unless the overlay is created in hardware, the contents for the display surface underneath the area where the overlay is shown will be overwritten when the overlay is displayed.</p>
</div>
<h1 id="METHODS">METHODS</h1><p><a href="#TOP" class="toplink">Top</a></p>
<div id="METHODS_CONTENT">
</div>
<h2 id="new_width_height_YUV_flag_display">new ( $width, $height, $YUV_flag, $display) </h2>
<div id="new_width_height_YUV_flag_display_CO">
<p>The constructor creates a SDL::Overlay of the specified width, height and format (see <code>YUV_Flags</code> list below of available formats), for the provided display.</p>
<p>Note the 'display' argument needs to actually be the surface created by <code>SDL::Video::SetVideoMode</code> otherwise this function will segfault. </p>
<pre> my $overlay = SDL::Overlay->new( $width, $height, $YUV_flag, $display );
</pre>
</div>
<h3 id="YUV_Flags">YUV_Flags</h3>
<div id="YUV_Flags_CONTENT">
<p>More information on YUV formats can be found at <a href="http://www.fourcc.org/indexyuv.htm">http://www.fourcc.org/indexyuv.htm</a> . </p>
<dl>
<dt>*
SDL_YV12_OVERLAY 0x32315659 /* Planar mode: Y + V + U */</dt>
<dt>*
SDL_IYUV_OVERLAY 0x56555949 /* Planar mode: Y + U + V */</dt>
<dt>*
SDL_YUY2_OVERLAY 0x32595559 /* Packed mode: Y0+U0+Y1+V0 */</dt>
<dt>*
SDL_UYVY_OVERLAY 0x59565955 /* Packed mode: U0+Y0+V0+Y1 */</dt>
<dt>*
SDL_YVYU_OVERLAY 0x55595659 /* Packed mode: Y0+V0+Y1+U0 */</dt>
</dl>
</div>
<h2 id="format">format</h2>
<div id="format_CONTENT">
<p>Overlay format (see YUV_Flags)</p>
</div>
<h2 id="w_h">w, h</h2>
<div id="w_h_CONTENT">
<p>Width and height of overlay</p>
</div>
<h2 id="planes">planes</h2>
<div id="planes_CONTENT">
<p>Number of planes in the overlay. Usually either 1 or 3</p>
</div>
<h2 id="pitches">pitches</h2>
<div id="pitches_CONTENT">
<p>An array of pitches, one for each plane. Pitch is the length of a row in bytes.</p>
</div>
<h2 id="pixels">pixels</h2>
<div id="pixels_CONTENT">
<p>As of release 2.3 direct right to overlay is disable. </p>
<p>An array of pointers to the data of each plane. The overlay should be locked before these pointers are used.</p>
<p>see <a href="SDL-Video::lock_YUV_overlay.html">SDL::Video::lock_YUV_overlay</a>, <a href="SDL-Video::unload_YUV_overlay.html">SDL::Video::unload_YUV_overlay</a></p>
</div>
<h2 id="hw_overlay">hw_overlay</h2>
<div id="hw_overlay_CONTENT">
<p>This will be set to 1 if the overlay is hardware accelerated.</p>
</div>
<h1 id="AUTHORS">AUTHORS</h1><p><a href="#TOP" class="toplink">Top</a></p>
<div id="AUTHORS_CONTENT">
<p>See <a href="/SDL.html#AUTHORS">/SDL.html#AUTHORS</a>.</p>
</div>
</div>