1SDL::Overlay(3)       User Contributed Perl Documentation      SDL::Overlay(3)
2
3
4

NAME

6       SDL::Overlay - YUV Video overlay
7
8   CATEGORY
9       Core, Video, Structure
10

SYNOPSIS

12       First import the following modules to get access to constants and
13       functions needed for overlay.
14
15          use SDL;
16          use SDL::Video;
17          use SDL::Overlay;
18
19       Init the video subsystem.
20
21          SDL::Init(SDL_INIT_VIDEO);
22
23       Create a display to use.
24
25          my $display = SDL::Video::set_video_mode(640, 480, 32, SDL_SWSURFACE);
26
27       Create and attach the display to a new overlay
28
29          my $overlay = SDL::Overlay->new( 100, 100, SDL_YV12_OVERLAY, $display);
30

DESCRIPTION

32       A "SDL_Overlay" allows for video rendering on an "SDL_Surface" which is
33       a display.
34
35       The term 'overlay' is a misnomer since, unless the overlay is created
36       in hardware, the contents for the display surface underneath the area
37       where the overlay is shown will be overwritten when the overlay is
38       displayed.
39

METHODS

41   new ( $width, $height, $YUV_flag, $display)
42       The constructor creates a SDL::Overlay of the specified width, height
43       and format (see "YUV_Flags" list below of available formats), for the
44       provided display.
45
46       Note the 'display' argument needs to actually be the surface created by
47       "SDL::Video::SetVideoMode" otherwise this function will segfault.
48
49          my $overlay = SDL::Overlay->new( $width, $height, $YUV_flag, $display );
50
51       YUV_Flags
52
53       More information on YUV formats can be found at
54       <http://www.fourcc.org/indexyuv.htm> .
55
56       •   SDL_YV12_OVERLAY  0x32315659  /* Planar mode: Y + V + U */
57
58       •   SDL_IYUV_OVERLAY  0x56555949  /* Planar mode: Y + U + V */
59
60       •   SDL_YUY2_OVERLAY  0x32595559  /* Packed mode: Y0+U0+Y1+V0 */
61
62       •   SDL_UYVY_OVERLAY  0x59565955  /* Packed mode: U0+Y0+V0+Y1 */
63
64       •   SDL_YVYU_OVERLAY  0x55595659  /* Packed mode: Y0+V0+Y1+U0 */
65
66   format
67       Overlay format (see YUV_Flags)
68
69   w, h
70       Width and height of overlay
71
72   planes
73       Number of planes in the overlay. Usually either 1 or 3
74
75   pitches
76       An array of pitches, one for each plane. Pitch is the length of a row
77       in bytes.
78
79   pixels
80       As of release 2.3 direct right to overlay is disable.
81
82       An array of pointers to the data of each plane. The overlay should be
83       locked before these pointers are used.
84
85       see SDL::Video::lock_YUV_overlay, SDL::Video::unload_YUV_overlay
86
87   hw_overlay
88       This will be set to 1 if the overlay is hardware accelerated.
89

AUTHORS

91       See "AUTHORS" in SDL.
92
93
94
95perl v5.36.0                      2023-03-10                   SDL::Overlay(3)
Impressum