1 package SDL::PixelFormat;
6 our @ISA = qw(Exporter DynaLoader);
7 bootstrap SDL::PixelFormat;
17 SDL::PixelFormat - Stores surface format information
21 my $surface = SDL::Surface->new( ...
22 $surface->format; #this returns the PixelFormat object attached to this surface
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.
29 An C<SDL::PixelFormat > stores surface format information
36 $surface->format->BitsPerPixel;
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
42 $surface->format->BytesPerPixel;
44 The number of bytes used to represent each pixel in a surface. Usually one to four.
48 $surface->format->Rloss; #red loss
49 $surface->format->Bloss; #blue loss
50 $surface->format->Gloss; #green loss
51 $surface->format->Aloss; #alpha loss
53 Precision loss of each color component (2[RGBA]loss)
57 $surface->format->Rshift; #red shift
58 $surface->format->Bshift; #blue shift
59 $surface->format->Gshift; #green shift
60 $surface->format->Ashift; #alpha shift
62 Binary left shift of each color component in the pixel value
67 $surface->format->Rmask; #red mask
68 $surface->format->Bmask; #blue mask
69 $surface->format->Gmask; #green mask
70 $surface->format->Amask; #alpha mask
72 Binary left shift of each color component in the pixel value
76 $surface->format->colorkey;
78 Pixel value of transparent pixels.
82 $surface->format->alpha;
84 Overall surface alpha value