Updated pods and merge
[sdlgit/SDL-Site.git] / pages / blib-lib-pods-SDL-Overlay.html-inc
CommitLineData
35f7648e 1<div class="pod">
2<!-- INDEX START -->
3<h3 id="TOP">Index</h3>
4
5<ul><li><a href="#NAME">NAME</a></li>
6<li><a href="#SYNOPSIS">SYNOPSIS</a></li>
7<li><a href="#DESCRIPTION">DESCRIPTION</a></li>
8<li><a href="#METHODS">METHODS</a>
9<ul><li><a href="#new_width_height_YUV_flag_display">new ( $width, $height, $YUV_flag, $display) </a>
10<ul><li><a href="#YUV_Flags">YUV_Flags</a>
11</li>
12</ul>
13</li>
14</ul>
15</li>
16</ul><hr />
17<!-- INDEX END -->
18
19<h1 id="NAME">NAME</h1><p><a href="#TOP" class="toplink">Top</a></p>
20<div id="NAME_CONTENT">
21<p>SDL::Overlay - YUV Video overlay</p>
22
23</div>
24<h1 id="SYNOPSIS">SYNOPSIS</h1><p><a href="#TOP" class="toplink">Top</a></p>
25<div id="SYNOPSIS_CONTENT">
26<p>First import the following modules to get access to constants and functions needed for overlay.</p>
27<pre> use SDL;
28 use SDL::Video;
29 use SDL::Overlay;
30
31</pre>
32<p>Init the video susbsystem.</p>
33<pre> SDL::Init(SDL_INIT_VIDEO);
34
35</pre>
36<p>Create a display to use. </p>
37<pre> my $display = SDL::SetVideoMore(640, 480, 32, SDL_SWSURFACE);
38
39</pre>
40<p>Create and attach the display to a new overlay
41 my $overlay = SDL::Overlay-&gt;new( 100, 100, SDL_YV12_OVERLAY, $display);</p>
42
43</div>
44<h1 id="DESCRIPTION">DESCRIPTION</h1><p><a href="#TOP" class="toplink">Top</a></p>
45<div id="DESCRIPTION_CONTENT">
46<p>A <code>SDL_Overlay</code> allows for video rendering on an <code>SDL_Surface</code> which is a display. </p>
47<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>
48
49</div>
50<h1 id="METHODS">METHODS</h1><p><a href="#TOP" class="toplink">Top</a></p>
51<div id="METHODS_CONTENT">
52
53</div>
54<h2 id="new_width_height_YUV_flag_display">new ( $width, $height, $YUV_flag, $display) </h2>
55<div id="new_width_height_YUV_flag_display_CO">
56<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>
57<p>Note the 'display' argument needs to actually be the surface created by <code>SDL::Video::SetVideoMode</code> otherwise this function will segfault. </p>
58<pre> my $overlay = SDL::Overlay-&gt;new( $width, $height, $YUV_flag, $display );
59
60</pre>
61
62</div>
63<h3 id="YUV_Flags">YUV_Flags</h3>
64<div id="YUV_Flags_CONTENT">
65<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>
66<dl>
67 <dt>*
68SDL_YV12_OVERLAY 0x32315659 /* Planar mode: Y + V + U */</dt>
69 <dt>*
70SDL_IYUV_OVERLAY 0x56555949 /* Planar mode: Y + U + V */</dt>
71 <dt>*
72SDL_YUY2_OVERLAY 0x32595559 /* Packed mode: Y0+U0+Y1+V0 */</dt>
73 <dt>*
74SDL_UYVY_OVERLAY 0x59565955 /* Packed mode: U0+Y0+V0+Y1 */</dt>
75 <dt>*
76SDL_YVYU_OVERLAY 0x55595659 /* Packed mode: Y0+V0+Y1+U0 */</dt>
77</dl>
78
79</div>
80</div>