3 <h3 id="TOP">Index</h3>
5 <ul><li><a href="#NAME">NAME</a>
6 <ul><li><a href="#CATEGORY">CATEGORY</a></li>
9 <li><a href="#SYNOPSIS">SYNOPSIS</a></li>
10 <li><a href="#DESCRIPTION">DESCRIPTION</a></li>
11 <li><a href="#METHODS">METHODS</a>
12 <ul><li><a href="#palette">palette</a></li>
13 <li><a href="#BitsPerPixel">BitsPerPixel </a></li>
14 <li><a href="#BytesPerPixel">BytesPerPixel</a></li>
15 <li><a href="#RGBA_loss">[RGBA]loss</a></li>
16 <li><a href="#RGBA_shift">[RGBA]shift</a></li>
17 <li><a href="#RGBA_mask">[RGBA]mask</a></li>
18 <li><a href="#colorkey">colorkey</a></li>
19 <li><a href="#alpha">alpha</a></li>
22 <li><a href="#SEE_ALSO">SEE ALSO</a>
27 <h1 id="NAME">NAME</h1><p><a href="#TOP" class="toplink">Top</a></p>
28 <div id="NAME_CONTENT">
29 <p>SDL::PixelFormat - Stores surface format information</p>
32 <h2 id="CATEGORY">CATEGORY</h2>
33 <div id="CATEGORY_CONTENT">
34 <p>Core, Video, Structure</p>
37 <h1 id="SYNOPSIS">SYNOPSIS</h1><p><a href="#TOP" class="toplink">Top</a></p>
38 <div id="SYNOPSIS_CONTENT">
39 <pre> my $surface = SDL::Surface->new( ...
40 $surface->format; #this returns the PixelFormat object attached to this surface
43 <p>PixelFormat is only created in a <code>SDL::Surface</code>. This module only provides getters to the surface's pixelformat. Later on we will provide setting capability.</p>
50 <h1 id="DESCRIPTION">DESCRIPTION</h1><p><a href="#TOP" class="toplink">Top</a></p>
51 <div id="DESCRIPTION_CONTENT">
52 <p>An <code>SDL::PixelFormat </code> stores surface format information</p>
55 <h1 id="METHODS">METHODS</h1><p><a href="#TOP" class="toplink">Top</a></p>
56 <div id="METHODS_CONTENT">
59 <h2 id="palette">palette</h2>
60 <div id="palette_CONTENT">
61 <pre> $surface->format->palette;
64 <p>Returns the <code>SDL_Palette</code> and <a href="SDL-Palette.html">SDL::Palette</a> of the format of the surface.</p>
67 <h2 id="BitsPerPixel">BitsPerPixel </h2>
68 <div id="BitsPerPixel_CONTENT">
69 <pre> $surface->format->BitsPerPixel;
72 <p>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</p>
75 <h2 id="BytesPerPixel">BytesPerPixel</h2>
76 <div id="BytesPerPixel_CONTENT">
77 <pre> $surface->format->BytesPerPixel;
80 <p>The number of bytes used to represent each pixel in a surface. Usually one to four.</p>
83 <h2 id="RGBA_loss">[RGBA]loss</h2>
84 <div id="RGBA_loss_CONTENT">
85 <pre> $surface->format->Rloss; #red loss
86 $surface->format->Bloss; #blue loss
87 $surface->format->Gloss; #green loss
88 $surface->format->Aloss; #alpha loss
91 <p>Precision loss of each color component (2[RGBA]loss)</p>
94 <h2 id="RGBA_shift">[RGBA]shift</h2>
95 <div id="RGBA_shift_CONTENT">
96 <pre> $surface->format->Rshift; #red shift
97 $surface->format->Bshift; #blue shift
98 $surface->format->Gshift; #green shift
99 $surface->format->Ashift; #alpha shift
102 <p>Binary left shift of each color component in the pixel value</p>
109 <h2 id="RGBA_mask">[RGBA]mask</h2>
110 <div id="RGBA_mask_CONTENT">
111 <pre> $surface->format->Rmask; #red mask
112 $surface->format->Bmask; #blue mask
113 $surface->format->Gmask; #green mask
114 $surface->format->Amask; #alpha mask
117 <p>Binary left shift of each color component in the pixel value</p>
120 <h2 id="colorkey">colorkey</h2>
121 <div id="colorkey_CONTENT">
122 <pre> $surface->format->colorkey;
125 <p>Pixel value of transparent pixels. </p>
128 <h2 id="alpha">alpha</h2>
129 <div id="alpha_CONTENT">
130 <pre> $surface->format->alpha;
133 <p>Overall surface alpha value</p>
143 <h1 id="SEE_ALSO">SEE ALSO</h1><p><a href="#TOP" class="toplink">Top</a></p>
144 <div id="SEE_ALSO_CONTENT">
145 <p><a href="SDL-Surface.html">SDL::Surface</a></p>