pods::...Format(3pm)
π NAME π
okay so bestie, this is pods::...Format(3pm) from the User Contributed Perl Documentation β and it's giving pixel format realness. The star of the show is SDL::PixelFormat β Stores surface format information. periodt.
π CATEGORY π
Core, Video, Structure β yes, all three, she contains multitudes π .
β¨ SYNOPSIS β¨
my $surface = SDL::Surface->new( ...
$surface->format; #this returns the PixelFormat object attached to this surface
Okay so quick vibe check: PixelFormat is only created in an SDL::Surface. This module only provides getters to the surface's pixelformat β later on we will provide setting capability, so hold that thought, bestie π«Ά.
π¦ DESCRIPTION π¦
An "SDL::PixelFormat " stores surface format information. Yes, the space is literally part of the quote β we don't erase details here π
.
π METHODS π
π palette
$surface->format->palette;
Returns the SDL_Palette and SDL::Palette of the format of the surface. Two palette names, one iconic little getter πΈ.
β BitsPerPixel
$surface->format->BitsPerPixel;
The number of bits used to represent each pixel in a surface. Usually 8, 16, 24 or 32. (Heads up: 1 to 7 are not allowed when creating a surface or open a video mode β literally not allowed, so don't try it π.)
π BytesPerPixel
$surface->format->BytesPerPixel;
The number of bytes used to represent each pixel in a surface. Usually one to four. Small but mighty π«Ά.
π [RGBA]loss
$surface->format->Rloss; #red loss
$surface->format->Bloss; #blue loss
$surface->format->Gloss; #green loss
$surface->format->Aloss; #alpha loss
Precision loss of each color component (2[RGBA]loss). That's the whole tea β.
π₯ [RGBA]shift
$surface->format->Rshift; #red shift
$surface->format->Bshift; #blue shift
$surface->format->Gshift; #green shift
$surface->format->Ashift; #alpha shift
Binary left shift of each color component in the pixel value. Shifting, shifting, slay π .
π [RGBA]mask
$surface->format->Rmask; #red mask
$surface->format->Bmask; #blue mask
$surface->format->Gmask; #green mask
$surface->format->Amask; #alpha mask
Binary left shift of each color component in the pixel value.
not me noticing the original literally repeats the shift sentence for masks too β keeping it exactly as written, bestie π.
π colorkey
$surface->format->colorkey;
Pixel value of transparent pixels. Transparent icon behavior β¨.
π§ alpha
$surface->format->alpha;
Overall surface alpha value. Soft-launch that transparency, queen π«Ά.
π SEE ALSO π
SDL::Surface β that's the whole see-also squad. Go peek, iykyk.
π AUTHORS π
See "AUTHORS" in SDL. Go check the author squad π.
mwah π β this page is from perl v5.42.3, dated 2026-08-19, and it lives under pods::...Format(3pm). byeee bestie π«Ά
π¦ where this page comes from
- ubuntu stonking: libsdl-perl 2.548-6build1 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms