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