| 1 |
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> |
| 2 |
<html xmlns="http://www.w3.org/1999/xhtml"> |
| 3 |
<head> |
| 4 |
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/> |
| 5 |
<meta http-equiv="X-UA-Compatible" content="IE=9"/> |
| 6 |
<title>SDL_gfx: I:/Sources/sdlgfx/SDL_gfxBlitFunc.c File Reference</title> |
| 7 |
|
| 8 |
<link href="tabs.css" rel="stylesheet" type="text/css"/> |
| 9 |
<link href="doxygen.css" rel="stylesheet" type="text/css" /> |
| 10 |
|
| 11 |
|
| 12 |
|
| 13 |
</head> |
| 14 |
<body> |
| 15 |
<div id="top"><!-- do not remove this div! --> |
| 16 |
|
| 17 |
|
| 18 |
<div id="titlearea"> |
| 19 |
<table cellspacing="0" cellpadding="0"> |
| 20 |
<tbody> |
| 21 |
<tr style="height: 56px;"> |
| 22 |
|
| 23 |
|
| 24 |
<td style="padding-left: 0.5em;"> |
| 25 |
<div id="projectname">SDL_gfx |
| 26 |
 <span id="projectnumber">2.0.25</span> |
| 27 |
</div> |
| 28 |
|
| 29 |
</td> |
| 30 |
|
| 31 |
|
| 32 |
|
| 33 |
</tr> |
| 34 |
</tbody> |
| 35 |
</table> |
| 36 |
</div> |
| 37 |
|
| 38 |
<!-- Generated by Doxygen 1.8.0 --> |
| 39 |
<div id="navrow1" class="tabs"> |
| 40 |
<ul class="tablist"> |
| 41 |
<li><a href="index.html"><span>Main Page</span></a></li> |
| 42 |
<li><a href="annotated.html"><span>Data Structures</span></a></li> |
| 43 |
<li class="current"><a href="files.html"><span>Files</span></a></li> |
| 44 |
</ul> |
| 45 |
</div> |
| 46 |
<div id="navrow2" class="tabs2"> |
| 47 |
<ul class="tablist"> |
| 48 |
<li><a href="files.html"><span>File List</span></a></li> |
| 49 |
<li><a href="globals.html"><span>Globals</span></a></li> |
| 50 |
</ul> |
| 51 |
</div> |
| 52 |
</div> |
| 53 |
<div class="header"> |
| 54 |
<div class="summary"> |
| 55 |
<a href="#func-members">Functions</a> | |
| 56 |
<a href="#var-members">Variables</a> </div> |
| 57 |
<div class="headertitle"> |
| 58 |
<div class="title">I:/Sources/sdlgfx/SDL_gfxBlitFunc.c File Reference</div> </div> |
| 59 |
</div><!--header--> |
| 60 |
<div class="contents"> |
| 61 |
<div class="textblock"><code>#include "<a class="el" href="_s_d_l__gfx_blit_func_8h_source.html">SDL_gfxBlitFunc.h</a>"</code><br/> |
| 62 |
</div> |
| 63 |
<p><a href="_s_d_l__gfx_blit_func_8c_source.html">Go to the source code of this file.</a></p> |
| 64 |
<table class="memberdecls"> |
| 65 |
<tr><td colspan="2"><h2><a name="func-members"></a> |
| 66 |
Functions</h2></td></tr> |
| 67 |
<tr class="memitem:a7ec9cde56a58eee4e6182c32dd8cbee7"><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="_s_d_l__gfx_blit_func_8c.html#a7ec9cde56a58eee4e6182c32dd8cbee7">_SDL_gfxBlitBlitterRGBA</a> (<a class="el" href="struct_s_d_l__gfx_blit_info.html">SDL_gfxBlitInfo</a> *info)</td></tr> |
| 68 |
<tr class="memdesc:a7ec9cde56a58eee4e6182c32dd8cbee7"><td class="mdescLeft"> </td><td class="mdescRight">Internal blitter using adjusted destination alpha during RGBA->RGBA blits. <a href="#a7ec9cde56a58eee4e6182c32dd8cbee7"></a><br/></td></tr> |
| 69 |
<tr class="memitem:a9375eac21cc799258f971034a3be57b5"><td class="memItemLeft" align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="_s_d_l__gfx_blit_func_8c.html#a9375eac21cc799258f971034a3be57b5">_SDL_gfxBlitRGBACall</a> (SDL_Surface *src, SDL_Rect *srcrect, SDL_Surface *dst, SDL_Rect *dstrect)</td></tr> |
| 70 |
<tr class="memdesc:a9375eac21cc799258f971034a3be57b5"><td class="mdescLeft"> </td><td class="mdescRight">Internal blitter setup wrapper for RGBA->RGBA blits. <a href="#a9375eac21cc799258f971034a3be57b5"></a><br/></td></tr> |
| 71 |
<tr class="memitem:ac51ff40d39f3dd0bd08116e8953960f8"><td class="memItemLeft" align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="_s_d_l__gfx_blit_func_8c.html#ac51ff40d39f3dd0bd08116e8953960f8">SDL_gfxBlitRGBA</a> (SDL_Surface *src, SDL_Rect *srcrect, SDL_Surface *dst, SDL_Rect *dstrect)</td></tr> |
| 72 |
<tr class="memdesc:ac51ff40d39f3dd0bd08116e8953960f8"><td class="mdescLeft"> </td><td class="mdescRight">Blitter for RGBA->RGBA blits with alpha adjustment. <a href="#ac51ff40d39f3dd0bd08116e8953960f8"></a><br/></td></tr> |
| 73 |
<tr class="memitem:a09a376775f9d8c933c7121e34fe5ecfc"><td class="memItemLeft" align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="_s_d_l__gfx_blit_func_8c.html#a09a376775f9d8c933c7121e34fe5ecfc">SDL_gfxSetAlpha</a> (SDL_Surface *src, Uint8 a)</td></tr> |
| 74 |
<tr class="memdesc:a09a376775f9d8c933c7121e34fe5ecfc"><td class="mdescLeft"> </td><td class="mdescRight">Sets the alpha channel in a 32 bit surface. <a href="#a09a376775f9d8c933c7121e34fe5ecfc"></a><br/></td></tr> |
| 75 |
<tr class="memitem:a4ece530dca0ae46b1f5a780f85371687"><td class="memItemLeft" align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="_s_d_l__gfx_blit_func_8c.html#a4ece530dca0ae46b1f5a780f85371687">SDL_gfxMultiplyAlpha</a> (SDL_Surface *src, Uint8 a)</td></tr> |
| 76 |
<tr class="memdesc:a4ece530dca0ae46b1f5a780f85371687"><td class="mdescLeft"> </td><td class="mdescRight">Multiply the alpha channel in a 32bit surface. <a href="#a4ece530dca0ae46b1f5a780f85371687"></a><br/></td></tr> |
| 77 |
<tr><td colspan="2"><h2><a name="var-members"></a> |
| 78 |
Variables</h2></td></tr> |
| 79 |
<tr class="memitem:a6d0c17342154e14322a281603960691a"><td class="memItemLeft" align="right" valign="top">const unsigned int </td><td class="memItemRight" valign="bottom"><a class="el" href="_s_d_l__gfx_blit_func_8c.html#a6d0c17342154e14322a281603960691a">GFX_ALPHA_ADJUST_ARRAY</a> [256]</td></tr> |
| 80 |
<tr class="memdesc:a6d0c17342154e14322a281603960691a"><td class="mdescLeft"> </td><td class="mdescRight">Alpha adjustment table for custom blitter. <a href="#a6d0c17342154e14322a281603960691a"></a><br/></td></tr> |
| 81 |
</table> |
| 82 |
<hr/><h2>Function Documentation</h2> |
| 83 |
<a class="anchor" id="a7ec9cde56a58eee4e6182c32dd8cbee7"></a> |
| 84 |
<div class="memitem"> |
| 85 |
<div class="memproto"> |
| 86 |
<table class="memname"> |
| 87 |
<tr> |
| 88 |
<td class="memname">void <a class="el" href="_s_d_l__gfx_blit_func_8c.html#a7ec9cde56a58eee4e6182c32dd8cbee7">_SDL_gfxBlitBlitterRGBA</a> </td> |
| 89 |
<td>(</td> |
| 90 |
<td class="paramtype"><a class="el" href="struct_s_d_l__gfx_blit_info.html">SDL_gfxBlitInfo</a> * </td> |
| 91 |
<td class="paramname"><em>info</em></td><td>)</td> |
| 92 |
<td></td> |
| 93 |
</tr> |
| 94 |
</table> |
| 95 |
</div> |
| 96 |
<div class="memdoc"> |
| 97 |
|
| 98 |
<p>Internal blitter using adjusted destination alpha during RGBA->RGBA blits. </p> |
| 99 |
<p>Performs the blit based on the 'info' structure and applies the transfer function to the destination 'a' values.</p> |
| 100 |
<dl class="params"><dt><b>Parameters:</b></dt><dd> |
| 101 |
<table class="params"> |
| 102 |
<tr><td class="paramname">info</td><td>The blit info to use. </td></tr> |
| 103 |
</table> |
| 104 |
</dd> |
| 105 |
</dl> |
| 106 |
|
| 107 |
<p>Definition at line <a class="el" href="_s_d_l__gfx_blit_func_8c_source.html#l00306">306</a> of file <a class="el" href="_s_d_l__gfx_blit_func_8c_source.html">SDL_gfxBlitFunc.c</a>.</p> |
| 108 |
|
| 109 |
</div> |
| 110 |
</div> |
| 111 |
<a class="anchor" id="a9375eac21cc799258f971034a3be57b5"></a> |
| 112 |
<div class="memitem"> |
| 113 |
<div class="memproto"> |
| 114 |
<table class="memname"> |
| 115 |
<tr> |
| 116 |
<td class="memname">int <a class="el" href="_s_d_l__gfx_blit_func_8c.html#a9375eac21cc799258f971034a3be57b5">_SDL_gfxBlitRGBACall</a> </td> |
| 117 |
<td>(</td> |
| 118 |
<td class="paramtype">SDL_Surface * </td> |
| 119 |
<td class="paramname"><em>src</em>, </td> |
| 120 |
</tr> |
| 121 |
<tr> |
| 122 |
<td class="paramkey"></td> |
| 123 |
<td></td> |
| 124 |
<td class="paramtype">SDL_Rect * </td> |
| 125 |
<td class="paramname"><em>srcrect</em>, </td> |
| 126 |
</tr> |
| 127 |
<tr> |
| 128 |
<td class="paramkey"></td> |
| 129 |
<td></td> |
| 130 |
<td class="paramtype">SDL_Surface * </td> |
| 131 |
<td class="paramname"><em>dst</em>, </td> |
| 132 |
</tr> |
| 133 |
<tr> |
| 134 |
<td class="paramkey"></td> |
| 135 |
<td></td> |
| 136 |
<td class="paramtype">SDL_Rect * </td> |
| 137 |
<td class="paramname"><em>dstrect</em> </td> |
| 138 |
</tr> |
| 139 |
<tr> |
| 140 |
<td></td> |
| 141 |
<td>)</td> |
| 142 |
<td></td><td></td> |
| 143 |
</tr> |
| 144 |
</table> |
| 145 |
</div> |
| 146 |
<div class="memdoc"> |
| 147 |
|
| 148 |
<p>Internal blitter setup wrapper for RGBA->RGBA blits. </p> |
| 149 |
<p>Sets up the blitter info based on the 'src' and 'dst' surfaces and rectangles.</p> |
| 150 |
<dl class="params"><dt><b>Parameters:</b></dt><dd> |
| 151 |
<table class="params"> |
| 152 |
<tr><td class="paramname">src</td><td>The source surface. </td></tr> |
| 153 |
<tr><td class="paramname">srcrect</td><td>The source rectangle. </td></tr> |
| 154 |
<tr><td class="paramname">dst</td><td>The destination surface. </td></tr> |
| 155 |
<tr><td class="paramname">dstrect</td><td>The destination rectangle.</td></tr> |
| 156 |
</table> |
| 157 |
</dd> |
| 158 |
</dl> |
| 159 |
<dl class="section return"><dt>Returns:</dt><dd>Returns 1 if blit was performed, 0 otherwise. </dd></dl> |
| 160 |
|
| 161 |
<p>Definition at line <a class="el" href="_s_d_l__gfx_blit_func_8c_source.html#l00356">356</a> of file <a class="el" href="_s_d_l__gfx_blit_func_8c_source.html">SDL_gfxBlitFunc.c</a>.</p> |
| 162 |
|
| 163 |
</div> |
| 164 |
</div> |
| 165 |
<a class="anchor" id="ac51ff40d39f3dd0bd08116e8953960f8"></a> |
| 166 |
<div class="memitem"> |
| 167 |
<div class="memproto"> |
| 168 |
<table class="memname"> |
| 169 |
<tr> |
| 170 |
<td class="memname">int <a class="el" href="_s_d_l__gfx_blit_func_8h.html#ab49c560e89b8305051b2e6b347215f03">SDL_gfxBlitRGBA</a> </td> |
| 171 |
<td>(</td> |
| 172 |
<td class="paramtype">SDL_Surface * </td> |
| 173 |
<td class="paramname"><em>src</em>, </td> |
| 174 |
</tr> |
| 175 |
<tr> |
| 176 |
<td class="paramkey"></td> |
| 177 |
<td></td> |
| 178 |
<td class="paramtype">SDL_Rect * </td> |
| 179 |
<td class="paramname"><em>srcrect</em>, </td> |
| 180 |
</tr> |
| 181 |
<tr> |
| 182 |
<td class="paramkey"></td> |
| 183 |
<td></td> |
| 184 |
<td class="paramtype">SDL_Surface * </td> |
| 185 |
<td class="paramname"><em>dst</em>, </td> |
| 186 |
</tr> |
| 187 |
<tr> |
| 188 |
<td class="paramkey"></td> |
| 189 |
<td></td> |
| 190 |
<td class="paramtype">SDL_Rect * </td> |
| 191 |
<td class="paramname"><em>dstrect</em> </td> |
| 192 |
</tr> |
| 193 |
<tr> |
| 194 |
<td></td> |
| 195 |
<td>)</td> |
| 196 |
<td></td><td></td> |
| 197 |
</tr> |
| 198 |
</table> |
| 199 |
</div> |
| 200 |
<div class="memdoc"> |
| 201 |
|
| 202 |
<p>Blitter for RGBA->RGBA blits with alpha adjustment. </p> |
| 203 |
<p>Verifies the input 'src' and 'dst' surfaces and rectangles and performs blit. The destination clip rectangle is honored.</p> |
| 204 |
<dl class="params"><dt><b>Parameters:</b></dt><dd> |
| 205 |
<table class="params"> |
| 206 |
<tr><td class="paramname">src</td><td>The source surface. </td></tr> |
| 207 |
<tr><td class="paramname">srcrect</td><td>The source rectangle. </td></tr> |
| 208 |
<tr><td class="paramname">dst</td><td>The destination surface. </td></tr> |
| 209 |
<tr><td class="paramname">dstrect</td><td>The destination rectangle.</td></tr> |
| 210 |
</table> |
| 211 |
</dd> |
| 212 |
</dl> |
| 213 |
<dl class="section return"><dt>Returns:</dt><dd>Returns 1 if blit was performed, 0 otherwise, or -1 if an error occured. </dd></dl> |
| 214 |
|
| 215 |
<p>Definition at line <a class="el" href="_s_d_l__gfx_blit_func_8c_source.html#l00411">411</a> of file <a class="el" href="_s_d_l__gfx_blit_func_8c_source.html">SDL_gfxBlitFunc.c</a>.</p> |
| 216 |
|
| 217 |
</div> |
| 218 |
</div> |
| 219 |
<a class="anchor" id="a4ece530dca0ae46b1f5a780f85371687"></a> |
| 220 |
<div class="memitem"> |
| 221 |
<div class="memproto"> |
| 222 |
<table class="memname"> |
| 223 |
<tr> |
| 224 |
<td class="memname">int <a class="el" href="_s_d_l__gfx_blit_func_8h.html#a7c93594525ae349b5cef0156b8f758fc">SDL_gfxMultiplyAlpha</a> </td> |
| 225 |
<td>(</td> |
| 226 |
<td class="paramtype">SDL_Surface * </td> |
| 227 |
<td class="paramname"><em>src</em>, </td> |
| 228 |
</tr> |
| 229 |
<tr> |
| 230 |
<td class="paramkey"></td> |
| 231 |
<td></td> |
| 232 |
<td class="paramtype">Uint8 </td> |
| 233 |
<td class="paramname"><em>a</em> </td> |
| 234 |
</tr> |
| 235 |
<tr> |
| 236 |
<td></td> |
| 237 |
<td>)</td> |
| 238 |
<td></td><td></td> |
| 239 |
</tr> |
| 240 |
</table> |
| 241 |
</div> |
| 242 |
<div class="memdoc"> |
| 243 |
|
| 244 |
<p>Multiply the alpha channel in a 32bit surface. </p> |
| 245 |
<p>Helper function that multiplies the alpha channel in a 32 bit surface with a constant value. The final alpha is always scaled to the range 0-255 (i.e. the factor is a/256).</p> |
| 246 |
<p>Only 32 bit surfaces can be used with this function.</p> |
| 247 |
<dl class="params"><dt><b>Parameters:</b></dt><dd> |
| 248 |
<table class="params"> |
| 249 |
<tr><td class="paramname">src</td><td>Pointer to the target surface to change. </td></tr> |
| 250 |
<tr><td class="paramname">a</td><td>The alpha value to multiply with. When a is 255, this function is a NoOp.</td></tr> |
| 251 |
</table> |
| 252 |
</dd> |
| 253 |
</dl> |
| 254 |
<dl class="section return"><dt>Returns:</dt><dd>Returns 1 if alpha was changed, 0 otherwise. Returns -1 if input surface is invalid. </dd></dl> |
| 255 |
|
| 256 |
<p>Definition at line <a class="el" href="_s_d_l__gfx_blit_func_8c_source.html#l00587">587</a> of file <a class="el" href="_s_d_l__gfx_blit_func_8c_source.html">SDL_gfxBlitFunc.c</a>.</p> |
| 257 |
|
| 258 |
</div> |
| 259 |
</div> |
| 260 |
<a class="anchor" id="a09a376775f9d8c933c7121e34fe5ecfc"></a> |
| 261 |
<div class="memitem"> |
| 262 |
<div class="memproto"> |
| 263 |
<table class="memname"> |
| 264 |
<tr> |
| 265 |
<td class="memname">int <a class="el" href="_s_d_l__gfx_blit_func_8h.html#a4627ae4a0037d0b248bed87f3c294735">SDL_gfxSetAlpha</a> </td> |
| 266 |
<td>(</td> |
| 267 |
<td class="paramtype">SDL_Surface * </td> |
| 268 |
<td class="paramname"><em>src</em>, </td> |
| 269 |
</tr> |
| 270 |
<tr> |
| 271 |
<td class="paramkey"></td> |
| 272 |
<td></td> |
| 273 |
<td class="paramtype">Uint8 </td> |
| 274 |
<td class="paramname"><em>a</em> </td> |
| 275 |
</tr> |
| 276 |
<tr> |
| 277 |
<td></td> |
| 278 |
<td>)</td> |
| 279 |
<td></td><td></td> |
| 280 |
</tr> |
| 281 |
</table> |
| 282 |
</div> |
| 283 |
<div class="memdoc"> |
| 284 |
|
| 285 |
<p>Sets the alpha channel in a 32 bit surface. </p> |
| 286 |
<p>Helper function that sets the alpha channel in a 32 bit surface to a constant value. Only 32 bit surfaces can be used with this function.</p> |
| 287 |
<dl class="params"><dt><b>Parameters:</b></dt><dd> |
| 288 |
<table class="params"> |
| 289 |
<tr><td class="paramname">src</td><td>Pointer to the target surface to change. </td></tr> |
| 290 |
<tr><td class="paramname">a</td><td>The alpha value to set.</td></tr> |
| 291 |
</table> |
| 292 |
</dd> |
| 293 |
</dl> |
| 294 |
<dl class="section return"><dt>Returns:</dt><dd>Returns 1 if alpha was changed, -1 otherwise. </dd></dl> |
| 295 |
|
| 296 |
<p>Definition at line <a class="el" href="_s_d_l__gfx_blit_func_8c_source.html#l00524">524</a> of file <a class="el" href="_s_d_l__gfx_blit_func_8c_source.html">SDL_gfxBlitFunc.c</a>.</p> |
| 297 |
|
| 298 |
</div> |
| 299 |
</div> |
| 300 |
<hr/><h2>Variable Documentation</h2> |
| 301 |
<a class="anchor" id="a6d0c17342154e14322a281603960691a"></a> |
| 302 |
<div class="memitem"> |
| 303 |
<div class="memproto"> |
| 304 |
<table class="memname"> |
| 305 |
<tr> |
| 306 |
<td class="memname">const unsigned int <a class="el" href="_s_d_l__gfx_blit_func_8h.html#a6d0c17342154e14322a281603960691a">GFX_ALPHA_ADJUST_ARRAY</a>[256]</td> |
| 307 |
</tr> |
| 308 |
</table> |
| 309 |
</div> |
| 310 |
<div class="memdoc"> |
| 311 |
|
| 312 |
<p>Alpha adjustment table for custom blitter. </p> |
| 313 |
<p>The table provides values for a modified, non-linear transfer function which maintain brightness. </p> |
| 314 |
|
| 315 |
<p>Definition at line <a class="el" href="_s_d_l__gfx_blit_func_8c_source.html#l00039">39</a> of file <a class="el" href="_s_d_l__gfx_blit_func_8c_source.html">SDL_gfxBlitFunc.c</a>.</p> |
| 316 |
|
| 317 |
</div> |
| 318 |
</div> |
| 319 |
</div><!-- contents --> |
| 320 |
|
| 321 |
|
| 322 |
<hr class="footer"/><address class="footer"><small> |
| 323 |
Generated by  <a href="http://www.doxygen.org/index.html"> |
| 324 |
<img class="footer" src="doxygen.png" alt="doxygen"/> |
| 325 |
</a> 1.8.0 |
| 326 |
</small></address> |
| 327 |
|
| 328 |
</body> |
| 329 |
</html> |