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