pods::...verlay(3pm)

πŸ“¦ version 2.548, in opensuse-leap 16.0

πŸ’– NAME πŸ’–

okay so this page β€” pods::...verlay(3pm) β€” comes from the User Contributed Perl Documentation, and it's all about SDL::Overlay, aka YUV Video overlay. Slay. πŸ’…

πŸŽ€ CATEGORY πŸŽ€

Core, Video, Structure.


✨ SYNOPSIS ✨

First, import these modules so you get access to the constants and functions needed for overlay, bestie:

use SDL;
use SDL::Video;
use SDL::Overlay;

Init the video subsystem:

SDL::Init(SDL_INIT_VIDEO);

Create a display to use:

my $display = SDL::Video::set_video_mode(640, 480, 32, SDL_SWSURFACE);

Create and attach the display to a new overlay:

my $overlay = SDL::Overlay->new( 100, 100, SDL_YV12_OVERLAY, $display);

πŸ¦‹ DESCRIPTION πŸ¦‹

An SDL_Overlay lets you do video rendering on an SDL_Surface that's a display. Periodt. πŸ’–

The term 'overlay' is lowkey a misnomer, because unless the overlay is created in hardware, the contents of the display surface underneath the area where the overlay is shown will be overwritten when the overlay is displayed. No cap.


πŸ’… METHODS πŸ’…

πŸ› οΈ new ( $width, $height, $YUV_flag, $display) πŸ› οΈ

The constructor creates an SDL::Overlay with the specified width, height, and format (peep the YUV_Flags list below for the available formats), for the provided display. 🫢

🚨 Note: the display argument needs to actually be the surface created by SDL::Video::SetVideoMode, otherwise this function will segfault. Not cute. At all. 😭
my $overlay = SDL::Overlay->new( $width, $height, $YUV_flag, $display );

🌈 YUV_Flags 🌈

More information on YUV formats can be found at http://www.fourcc.org/indexyuv.htm .

  • SDL_YV12_OVERLAY β€” 0x32315659 β€” /* Planar mode: Y + V + U */
  • SDL_IYUV_OVERLAY β€” 0x56555949 β€” /* Planar mode: Y + U + V */
  • SDL_YUY2_OVERLAY β€” 0x32595559 β€” /* Packed mode: Y0+U0+Y1+V0 */
  • SDL_UYVY_OVERLAY β€” 0x59565955 β€” /* Packed mode: U0+Y0+V0+Y1 */
  • SDL_YVYU_OVERLAY β€” 0x55595659 β€” /* Packed mode: Y0+V0+Y1+U0 */

πŸ“ format πŸ“

Overlay format (see YUV_Flags).

πŸ“ w, h πŸ“

Width and height of overlay.

🧚 planes 🧚

Number of planes in the overlay. Usually either 1 or 3.

πŸŽ€ pitches πŸŽ€

An array of pitches, one for each plane. Pitch is the length of a row in bytes.

πŸ‘‘ pixels πŸ‘‘

As of release 2.3 direct right to overlay is disable.

An array of pointers to the data of each plane. The overlay should be locked before these pointers are used.

see SDL::Video::lock_YUV_overlay, SDL::Video::unload_YUV_overlay

⭐ hw_overlay ⭐

This will be set to 1 if the overlay is hardware accelerated.


🌸 AUTHORS 🌸

See "AUTHORS" in SDL.


πŸ’œ source/version: perl v5.42.0 Β· date: 2024-05-01 Β· page: pods::...verlay(3pm) β€” bye bestie! πŸ’œ

πŸ“¦ where this page comes from