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