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