pods::...Format(3pm)

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

πŸ’… pods::...Format(3pm)

okay so real talk, the manual name on this one is pods::...Format (that 3pm is just telling you it's a Perl module page, no cap) but the actual star of the show, the main character, is SDL::PixelFormat β€” and yes bestie we're getting into it.


✨ NAME ✨

SDL::PixelFormat β€” it stores surface format information πŸŽ€

🌸 CATEGORY 🌸

Core, Video, Structure β€” she's core, she's video, she's a structure. Versatile icon.


πŸ¦‹ SYNOPSIS πŸ¦‹

my $surface = SDL::Surface->new( ...
$surface->format; #this returns the PixelFormat object attached to this surface

So here's the tea: PixelFormat is only created inside an SDL::Surface. You don't just make one yourself, she doesn't work like that. This module literally just provides getters to the surface's pixelformat β€” read-only era. Later on they'll provide setting capability, but that's a future era, not this one. πŸ’€


πŸ’– DESCRIPTION πŸ’–

An SDL::PixelFormat stores surface format information. That's it, that's the whole gig. She holds the format info, she's iconic for it. ⭐


πŸ‘‘ METHODS πŸ‘‘

πŸ“ palette

$surface->format->palette;

Returns the SDL_Palette and SDL::Palette of the format of the surface. Palette girly pop. πŸ’œ

🌈 BitsPerPixel

$surface->format->BitsPerPixel;

The number of bits used to represent each pixel in a surface. Usually 8, 16, 24 or 32. Heads up though: (1 to 7 are not allowed when creating a surface or open a video mode β€” so like, don't even try it πŸ™ˆ)

🧚 BytesPerPixel

$surface->format->BytesPerPixel;

The number of bytes used to represent each pixel in a surface. Usually one to four. See the BytesPerPixel/BitsPerPixel duo? obsessed. 🫢

πŸŽ€ [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). All four of them, red, blue, green and alpha β€” she's thorough. πŸ’…

πŸ”₯ [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. Shifty little guys, all four. ✨

πŸ’€ [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. Yep β€” that's what the page says for the masks, same line as the shifts, fr fr, iykyk. All four masks listed: Rmask, Bmask, Gmask, Amask. 🎭

🌸 colorkey

$surface->format->colorkey;

Pixel value of transparent pixels. The invisible ones. Ghost aesthetic. πŸ‘»

🌟 alpha

$surface->format->alpha;

Overall surface alpha value. The vibe check of how see-through your surface is. πŸ¦‹


⭐ SEE ALSO ⭐

SDL::Surface β€” go read that one next bestie, it's the whole reason this module even exists. πŸ’–


πŸ™ˆ AUTHORS πŸ™ˆ

See AUTHORS in SDL. (Yes that's all it says, go look it up, they're in there somewhere πŸ’…)


okay that's the whole page, mwah πŸ’‹ β€” this iconic little number comes to you from perl v5.42.0, dated 2024-05-01, and it's literally giving pods::...Format(3pm) energy from start to finish. slay, bye! πŸŽ€βœ¨

πŸ“¦ where this page comes from