5 SDL::PixelFormat - Stores surface format information
9 my $surface = SDL::Surface->new( ...
10 $surface->format; #this returns the PixelFormat object attached to this surface
12 PixelFormat is only created in a C<SDL::Surface>. This module only provides getters to the surface's pixelformat. Later on we will provide setting capability.
17 An C<SDL::PixelFormat > stores surface format information
23 $surface->format->palette;
25 Returns the C<SDL_Palette> and L<SDL::Palette> of the format of the surface.
29 $surface->format->BitsPerPixel;
31 The number of bits used to represent each pixel in a surface. Usually 8, 16, 24 or 32. (1 to 7 are not allowed when creating a surface or open a video mode
35 $surface->format->BytesPerPixel;
37 The number of bytes used to represent each pixel in a surface. Usually one to four.
41 $surface->format->Rloss; #red loss
42 $surface->format->Bloss; #blue loss
43 $surface->format->Gloss; #green loss
44 $surface->format->Aloss; #alpha loss
46 Precision loss of each color component (2[RGBA]loss)
50 $surface->format->Rshift; #red shift
51 $surface->format->Bshift; #blue shift
52 $surface->format->Gshift; #green shift
53 $surface->format->Ashift; #alpha shift
55 Binary left shift of each color component in the pixel value
60 $surface->format->Rmask; #red mask
61 $surface->format->Bmask; #blue mask
62 $surface->format->Gmask; #green mask
63 $surface->format->Amask; #alpha mask
65 Binary left shift of each color component in the pixel value
69 $surface->format->colorkey;
71 Pixel value of transparent pixels.
75 $surface->format->alpha;
77 Overall surface alpha value