Commit | Line | Data |
896b04ee |
1 | =pod |
2 | |
3 | =head1 NAME |
4 | |
5 | SDL::PixelFormat - Stores surface format information |
6 | |
7 | =head1 SYNOPSIS |
8 | |
9 | my $surface = SDL::Surface->new( ... |
10 | $surface->format; #this returns the PixelFormat object attached to this surface |
11 | |
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. |
13 | |
14 | |
15 | =head1 DESCRIPTION |
16 | |
17 | An C<SDL::PixelFormat > stores surface format information |
18 | |
19 | =head1 METHODS |
20 | |
21 | =head2 palette |
22 | |
23 | $surface->format->palette; |
24 | |
25 | Returns the C<SDL_Palette> and L<SDL::Palette> of the format of the surface. |
26 | |
27 | =head2 BitsPerPixel |
28 | |
29 | $surface->format->BitsPerPixel; |
30 | |
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 |
32 | |
33 | =head2 BytesPerPixel |
34 | |
35 | $surface->format->BytesPerPixel; |
36 | |
37 | The number of bytes used to represent each pixel in a surface. Usually one to four. |
38 | |
39 | =head2 [RGBA]loss |
40 | |
41 | $surface->format->Rloss; #red loss |
42 | $surface->format->Bloss; #blue loss |
43 | $surface->format->Gloss; #green loss |
44 | $surface->format->Aloss; #alpha loss |
45 | |
46 | Precision loss of each color component (2[RGBA]loss) |
47 | |
48 | =head2 [RGBA]shift |
49 | |
50 | $surface->format->Rshift; #red shift |
51 | $surface->format->Bshift; #blue shift |
52 | $surface->format->Gshift; #green shift |
53 | $surface->format->Ashift; #alpha shift |
54 | |
55 | Binary left shift of each color component in the pixel value |
56 | |
57 | |
58 | =head2 [RGBA]mask |
59 | |
60 | $surface->format->Rmask; #red mask |
61 | $surface->format->Bmask; #blue mask |
62 | $surface->format->Gmask; #green mask |
63 | $surface->format->Amask; #alpha mask |
64 | |
65 | Binary left shift of each color component in the pixel value |
66 | |
67 | =head2 colorkey |
68 | |
69 | $surface->format->colorkey; |
70 | |
71 | Pixel value of transparent pixels. |
72 | |
73 | =head2 alpha |
74 | |
75 | $surface->format->alpha; |
76 | |
77 | Overall surface alpha value |
78 | |
79 | |
80 | |
81 | =head1 SEE ALSO |
82 | |
83 | L<SDL::Surface> |
84 | |
85 | =cut |