fixed url-generator
[sdlgit/SDL-Site.git] / pages / SDL-PixelFormat.html-inc
1 <div class="pod">
2 <!-- INDEX START -->
3 <h3 id="TOP">Index</h3>
4
5 <ul><li><a href="#NAME">NAME</a>
6 <ul><li><a href="#CATEGORY">CATEGORY</a></li>
7 </ul>
8 </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>
20 </ul>
21 </li>
22 <li><a href="#SEE_ALSO">SEE ALSO</a>
23 </li>
24 </ul><hr />
25 <!-- INDEX END -->
26
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>
30
31 </div>
32 <h2 id="CATEGORY">CATEGORY</h2>
33 <div id="CATEGORY_CONTENT">
34 <p>Core, Video, Structure</p>
35
36 </div>
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-&gt;new( ...
40         $surface-&gt;format; #this returns the PixelFormat object attached to this surface
41
42 </pre>
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>
44
45
46
47
48
49 </div>
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>
53
54 </div>
55 <h1 id="METHODS">METHODS</h1><p><a href="#TOP" class="toplink">Top</a></p>
56 <div id="METHODS_CONTENT">
57
58 </div>
59 <h2 id="palette">palette</h2>
60 <div id="palette_CONTENT">
61 <pre>   $surface-&gt;format-&gt;palette;
62
63 </pre>
64 <p>Returns the <code>SDL_Palette</code> and <a href="SDL-Palette.html">SDL::Palette</a> of the format of the surface.</p>
65
66 </div>
67 <h2 id="BitsPerPixel">BitsPerPixel </h2>
68 <div id="BitsPerPixel_CONTENT">
69 <pre>   $surface-&gt;format-&gt;BitsPerPixel;
70
71 </pre>
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>
73
74 </div>
75 <h2 id="BytesPerPixel">BytesPerPixel</h2>
76 <div id="BytesPerPixel_CONTENT">
77 <pre>   $surface-&gt;format-&gt;BytesPerPixel;
78
79 </pre>
80 <p>The number of bytes used to represent each pixel in a surface. Usually one to four.</p>
81
82 </div>
83 <h2 id="RGBA_loss">[RGBA]loss</h2>
84 <div id="RGBA_loss_CONTENT">
85 <pre>   $surface-&gt;format-&gt;Rloss; #red   loss
86         $surface-&gt;format-&gt;Bloss; #blue  loss
87         $surface-&gt;format-&gt;Gloss; #green loss      
88         $surface-&gt;format-&gt;Aloss; #alpha loss
89
90 </pre>
91 <p>Precision loss of each color component (2[RGBA]loss)</p>
92
93 </div>
94 <h2 id="RGBA_shift">[RGBA]shift</h2>
95 <div id="RGBA_shift_CONTENT">
96 <pre>   $surface-&gt;format-&gt;Rshift; #red   shift
97         $surface-&gt;format-&gt;Bshift; #blue  shift
98         $surface-&gt;format-&gt;Gshift; #green shift    
99         $surface-&gt;format-&gt;Ashift; #alpha shift
100
101 </pre>
102 <p>Binary left shift of each color component in the pixel value</p>
103
104
105
106
107
108 </div>
109 <h2 id="RGBA_mask">[RGBA]mask</h2>
110 <div id="RGBA_mask_CONTENT">
111 <pre>   $surface-&gt;format-&gt;Rmask; #red   mask
112         $surface-&gt;format-&gt;Bmask; #blue  mask
113         $surface-&gt;format-&gt;Gmask; #green mask      
114         $surface-&gt;format-&gt;Amask; #alpha mask
115
116 </pre>
117 <p>Binary left shift of each color component in the pixel value</p>
118
119 </div>
120 <h2 id="colorkey">colorkey</h2>
121 <div id="colorkey_CONTENT">
122 <pre>   $surface-&gt;format-&gt;colorkey;
123
124 </pre>
125 <p>Pixel value of transparent pixels.   </p>
126
127 </div>
128 <h2 id="alpha">alpha</h2>
129 <div id="alpha_CONTENT">
130 <pre>   $surface-&gt;format-&gt;alpha;
131
132 </pre>
133 <p>Overall surface alpha value</p>
134
135
136
137
138
139
140
141
142 </div>
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>
146
147 </div>
148 </div>