PageRenderTime 35ms CodeModel.GetById 28ms app.highlight 2ms RepoModel.GetById 1ms app.codeStats 1ms

/lib/pods/SDL/Overlay.pod

http://github.com/PerlGameDev/SDL
Unknown | 105 lines | 55 code | 50 blank | 0 comment | 0 complexity | eb344effdf719c94edee3f73341acb17 MD5 | raw file
  1
  2=pod 
  3
  4=head1 NAME
  5
  6SDL::Overlay - YUV Video overlay
  7
  8=head2 CATEGORY
  9
 10Core, Video, Structure
 11
 12=head1 SYNOPSIS
 13
 14First import the following modules to get access to constants and functions needed for overlay.
 15
 16   use SDL;
 17   use SDL::Video;
 18   use SDL::Overlay;
 19
 20Init the video subsystem.
 21
 22   SDL::Init(SDL_INIT_VIDEO);
 23
 24Create a display to use.  
 25
 26   my $display = SDL::Video::set_video_mode(640, 480, 32, SDL_SWSURFACE);
 27
 28Create and attach the display to a new overlay
 29
 30   my $overlay = SDL::Overlay->new( 100, 100, SDL_YV12_OVERLAY, $display);
 31   
 32=head1 DESCRIPTION
 33
 34A C<SDL_Overlay> allows for video rendering on an C<SDL_Surface> which is a display.  
 35
 36The 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.
 37
 38=head1 METHODS
 39
 40=head2 new ( $width, $height, $YUV_flag, $display) 
 41
 42The constructor creates a SDL::Overlay of the specified width, height and format (see C<YUV_Flags> list below of available formats), for the provided display.
 43
 44Note the 'display' argument needs to actually be the surface created by C<SDL::Video::SetVideoMode> otherwise this function will segfault. 
 45    
 46   my $overlay = SDL::Overlay->new( $width, $height, $YUV_flag, $display );
 47
 48=head3 YUV_Flags
 49
 50More information on YUV formats can be found at L<http://www.fourcc.org/indexyuv.htm> . 
 51
 52=over 4
 53
 54=item *
 55SDL_YV12_OVERLAY  0x32315659  /* Planar mode: Y + V + U */
 56
 57=item *
 58SDL_IYUV_OVERLAY  0x56555949  /* Planar mode: Y + U + V */
 59
 60=item *
 61SDL_YUY2_OVERLAY  0x32595559  /* Packed mode: Y0+U0+Y1+V0 */
 62
 63=item *
 64SDL_UYVY_OVERLAY  0x59565955  /* Packed mode: U0+Y0+V0+Y1 */
 65
 66=item *
 67SDL_YVYU_OVERLAY  0x55595659  /* Packed mode: Y0+V0+Y1+U0 */
 68
 69=back
 70
 71
 72=head2 format
 73
 74Overlay format (see YUV_Flags)
 75
 76=head2 w, h
 77
 78Width and height of overlay
 79
 80=head2 planes
 81
 82Number of planes in the overlay. Usually either 1 or 3
 83
 84=head2 pitches
 85
 86An array of pitches, one for each plane. Pitch is the length of a row in bytes.
 87
 88=head2 pixels
 89
 90As of release 2.3 direct right to overlay is disable. 
 91
 92An array of pointers to the data of each plane. The overlay should be locked before these pointers are used.
 93
 94see L<SDL::Video::lock_YUV_overlay>, L<SDL::Video::unload_YUV_overlay>
 95
 96=head2 hw_overlay
 97
 98This will be set to 1 if the overlay is hardware accelerated.
 99
100=head1 AUTHORS
101
102See L<SDL/AUTHORS>.
103
104=cut
105