3 <h3 id="TOP">Index</h3>
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>
19 <li><a href="#SEE_ALSO">SEE ALSO</a>
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>
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->new( ...
32 $surface->format; #this returns the PixelFormat object attached to this surface
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>
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>
47 <h1 id="METHODS">METHODS</h1><p><a href="#TOP" class="toplink">Top</a></p>
48 <div id="METHODS_CONTENT">
51 <h2 id="palette">palette</h2>
52 <div id="palette_CONTENT">
53 <pre> $surface->format->palette;
56 <p>Returns the <code>SDL_Palette</code> and <cite>SDL::Palette</cite> of the format of the surface.</p>
59 <h2 id="BitsPerPixel">BitsPerPixel </h2>
60 <div id="BitsPerPixel_CONTENT">
61 <pre> $surface->format->BitsPerPixel;
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>
67 <h2 id="BytesPerPixel">BytesPerPixel</h2>
68 <div id="BytesPerPixel_CONTENT">
69 <pre> $surface->format->BytesPerPixel;
72 <p>The number of bytes used to represent each pixel in a surface. Usually one to four.</p>
75 <h2 id="RGBA_loss">[RGBA]loss</h2>
76 <div id="RGBA_loss_CONTENT">
77 <pre> $surface->format->Rloss; #red loss
78 $surface->format->Bloss; #blue loss
79 $surface->format->Gloss; #green loss
80 $surface->format->Aloss; #alpha loss
83 <p>Precision loss of each color component (2[RGBA]loss)</p>
86 <h2 id="RGBA_shift">[RGBA]shift</h2>
87 <div id="RGBA_shift_CONTENT">
88 <pre> $surface->format->Rshift; #red shift
89 $surface->format->Bshift; #blue shift
90 $surface->format->Gshift; #green shift
91 $surface->format->Ashift; #alpha shift
94 <p>Binary left shift of each color component in the pixel value</p>
101 <h2 id="RGBA_mask">[RGBA]mask</h2>
102 <div id="RGBA_mask_CONTENT">
103 <pre> $surface->format->Rmask; #red mask
104 $surface->format->Bmask; #blue mask
105 $surface->format->Gmask; #green mask
106 $surface->format->Amask; #alpha mask
109 <p>Binary left shift of each color component in the pixel value</p>
112 <h2 id="colorkey">colorkey</h2>
113 <div id="colorkey_CONTENT">
114 <pre> $surface->format->colorkey;
117 <p>Pixel value of transparent pixels. </p>
120 <h2 id="alpha">alpha</h2>
121 <div id="alpha_CONTENT">
122 <pre> $surface->format->alpha;
125 <p>Overall surface alpha value</p>
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>