1SDL::PixelFormat(3)   User Contributed Perl Documentation  SDL::PixelFormat(3)
2
3
4

NAME

6       SDL::PixelFormat - Stores surface format information
7
8   CATEGORY
9       Core, Video, Structure
10

SYNOPSIS

12               my $surface = SDL::Surface->new( ...
13               $surface->format; #this returns the PixelFormat object attached to this surface
14
15       PixelFormat is only created in a "SDL::Surface". This module only
16       provides getters to the surface's pixelformat. Later on we will provide
17       setting capability.
18

DESCRIPTION

20       An "SDL::PixelFormat " stores surface format information
21

METHODS

23   palette
24               $surface->format->palette;
25
26       Returns the "SDL_Palette" and SDL::Palette of the format of the
27       surface.
28
29   BitsPerPixel
30               $surface->format->BitsPerPixel;
31
32       The number of bits used to represent each pixel in a surface. Usually
33       8, 16, 24 or 32. (1 to 7 are not allowed when creating a surface or
34       open a video mode
35
36   BytesPerPixel
37               $surface->format->BytesPerPixel;
38
39       The number of bytes used to represent each pixel in a surface. Usually
40       one to four.
41
42   [RGBA]loss
43               $surface->format->Rloss; #red   loss
44               $surface->format->Bloss; #blue  loss
45               $surface->format->Gloss; #green loss
46               $surface->format->Aloss; #alpha loss
47
48       Precision loss of each color component (2[RGBA]loss)
49
50   [RGBA]shift
51               $surface->format->Rshift; #red   shift
52               $surface->format->Bshift; #blue  shift
53               $surface->format->Gshift; #green shift
54               $surface->format->Ashift; #alpha shift
55
56       Binary left shift of each color component in the pixel value
57
58   [RGBA]mask
59               $surface->format->Rmask; #red   mask
60               $surface->format->Bmask; #blue  mask
61               $surface->format->Gmask; #green mask
62               $surface->format->Amask; #alpha mask
63
64       Binary left shift of each color component in the pixel value
65
66   colorkey
67               $surface->format->colorkey;
68
69       Pixel value of transparent pixels.
70
71   alpha
72               $surface->format->alpha;
73
74       Overall surface alpha value
75

SEE ALSO

77       SDL::Surface
78

AUTHORS

80       See "AUTHORS" in SDL.
81
82
83
84perl v5.30.0                      2019-07-26               SDL::PixelFormat(3)
Impressum