1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
|
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>CSFML - C binding of the Simple and Fast Multimedia Library</title>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"/>
<!--<link rel='stylesheet' type='text/css' href="http://fonts.googleapis.com/css?family=Ubuntu:400,700,400italic"/>-->
<link rel="stylesheet" type="text/css" href="doxygen.css" title="default" media="screen,print" />
</head>
<body>
<div id="banner-container">
<div id="banner">
<span id="sfml">CSFML</span>
</div>
</div>
<div id="content">
<!-- Generated by Doxygen 1.8.2 -->
<div id="navrow1" class="tabs">
<ul class="tablist">
<li><a href="index.htm"><span>Main Page</span></a></li>
<li><a href="annotated.htm"><span>Data Structures</span></a></li>
<li class="current"><a href="files.htm"><span>Files</span></a></li>
</ul>
</div>
<div id="navrow2" class="tabs2">
<ul class="tablist">
<li><a href="files.htm"><span>File List</span></a></li>
<li><a href="globals.htm"><span>Globals</span></a></li>
</ul>
</div>
<div id="nav-path" class="navpath">
<ul>
<li class="navelem"><a class="el" href="dir_6a66b7969672f1da69f458a57d2c97f9.htm">include</a></li><li class="navelem"><a class="el" href="dir_8cc999c03ab8fdf40558b1f21f869c3e.htm">SFML</a></li><li class="navelem"><a class="el" href="dir_513183d162d70e825c1ac102f07bf6df.htm">Graphics</a></li> </ul>
</div>
</div><!-- top -->
<div class="header">
<div class="headertitle">
<div class="title">Image.h</div> </div>
</div><!--header-->
<div class="contents">
<a href="Image_8h.htm">Go to the documentation of this file.</a><div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno"> 1</span> </div>
<div class="line"><a name="l00002"></a><span class="lineno"> 2</span> <span class="comment">//</span></div>
<div class="line"><a name="l00003"></a><span class="lineno"> 3</span> <span class="comment">// SFML - Simple and Fast Multimedia Library</span></div>
<div class="line"><a name="l00004"></a><span class="lineno"> 4</span> <span class="comment">// Copyright (C) 2007-2013 Laurent Gomila (laurent.gom@gmail.com)</span></div>
<div class="line"><a name="l00005"></a><span class="lineno"> 5</span> <span class="comment">//</span></div>
<div class="line"><a name="l00006"></a><span class="lineno"> 6</span> <span class="comment">// This software is provided 'as-is', without any express or implied warranty.</span></div>
<div class="line"><a name="l00007"></a><span class="lineno"> 7</span> <span class="comment">// In no event will the authors be held liable for any damages arising from the use of this software.</span></div>
<div class="line"><a name="l00008"></a><span class="lineno"> 8</span> <span class="comment">//</span></div>
<div class="line"><a name="l00009"></a><span class="lineno"> 9</span> <span class="comment">// Permission is granted to anyone to use this software for any purpose,</span></div>
<div class="line"><a name="l00010"></a><span class="lineno"> 10</span> <span class="comment">// including commercial applications, and to alter it and redistribute it freely,</span></div>
<div class="line"><a name="l00011"></a><span class="lineno"> 11</span> <span class="comment">// subject to the following restrictions:</span></div>
<div class="line"><a name="l00012"></a><span class="lineno"> 12</span> <span class="comment">//</span></div>
<div class="line"><a name="l00013"></a><span class="lineno"> 13</span> <span class="comment">// 1. The origin of this software must not be misrepresented;</span></div>
<div class="line"><a name="l00014"></a><span class="lineno"> 14</span> <span class="comment">// you must not claim that you wrote the original software.</span></div>
<div class="line"><a name="l00015"></a><span class="lineno"> 15</span> <span class="comment">// If you use this software in a product, an acknowledgment</span></div>
<div class="line"><a name="l00016"></a><span class="lineno"> 16</span> <span class="comment">// in the product documentation would be appreciated but is not required.</span></div>
<div class="line"><a name="l00017"></a><span class="lineno"> 17</span> <span class="comment">//</span></div>
<div class="line"><a name="l00018"></a><span class="lineno"> 18</span> <span class="comment">// 2. Altered source versions must be plainly marked as such,</span></div>
<div class="line"><a name="l00019"></a><span class="lineno"> 19</span> <span class="comment">// and must not be misrepresented as being the original software.</span></div>
<div class="line"><a name="l00020"></a><span class="lineno"> 20</span> <span class="comment">//</span></div>
<div class="line"><a name="l00021"></a><span class="lineno"> 21</span> <span class="comment">// 3. This notice may not be removed or altered from any source distribution.</span></div>
<div class="line"><a name="l00022"></a><span class="lineno"> 22</span> <span class="comment">//</span></div>
<div class="line"><a name="l00024"></a><span class="lineno"> 24</span> <span class="comment"></span></div>
<div class="line"><a name="l00025"></a><span class="lineno"> 25</span> <span class="preprocessor">#ifndef SFML_IMAGE_H</span></div>
<div class="line"><a name="l00026"></a><span class="lineno"> 26</span> <span class="preprocessor"></span><span class="preprocessor">#define SFML_IMAGE_H</span></div>
<div class="line"><a name="l00027"></a><span class="lineno"> 27</span> <span class="preprocessor"></span></div>
<div class="line"><a name="l00029"></a><span class="lineno"> 29</span> <span class="comment">// Headers</span></div>
<div class="line"><a name="l00031"></a><span class="lineno"> 31</span> <span class="comment"></span><span class="preprocessor">#include <<a class="code" href="Graphics_2Export_8h.htm">SFML/Graphics/Export.h</a>></span></div>
<div class="line"><a name="l00032"></a><span class="lineno"> 32</span> <span class="preprocessor">#include <<a class="code" href="Color_8h.htm">SFML/Graphics/Color.h</a>></span></div>
<div class="line"><a name="l00033"></a><span class="lineno"> 33</span> <span class="preprocessor">#include <<a class="code" href="Rect_8h.htm">SFML/Graphics/Rect.h</a>></span></div>
<div class="line"><a name="l00034"></a><span class="lineno"> 34</span> <span class="preprocessor">#include <<a class="code" href="Graphics_2Types_8h.htm">SFML/Graphics/Types.h</a>></span></div>
<div class="line"><a name="l00035"></a><span class="lineno"> 35</span> <span class="preprocessor">#include <<a class="code" href="InputStream_8h.htm">SFML/System/InputStream.h</a>></span></div>
<div class="line"><a name="l00036"></a><span class="lineno"> 36</span> <span class="preprocessor">#include <<a class="code" href="Vector2_8h.htm">SFML/System/Vector2.h</a>></span></div>
<div class="line"><a name="l00037"></a><span class="lineno"> 37</span> <span class="preprocessor">#include <stddef.h></span></div>
<div class="line"><a name="l00038"></a><span class="lineno"> 38</span> </div>
<div class="line"><a name="l00039"></a><span class="lineno"> 39</span> </div>
<div class="line"><a name="l00051"></a><span class="lineno"> 51</span> <a class="code" href="Graphics_2Export_8h.htm#afe51e93179eaff14e83568c716e633c0">CSFML_GRAPHICS_API</a> <a class="code" href="Graphics_2Types_8h.htm#a26d2f025681acd41ab00ead3b5aa23eb">sfImage</a>* <a class="code" href="Image_8h.htm#a9ca057a8098985002811d4a82b1e2131" title="Create an image.">sfImage_create</a>(<span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> width, <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> height);</div>
<div class="line"><a name="l00052"></a><span class="lineno"> 52</span> </div>
<div class="line"><a name="l00063"></a><span class="lineno"> 63</span> <a class="code" href="Graphics_2Export_8h.htm#afe51e93179eaff14e83568c716e633c0">CSFML_GRAPHICS_API</a> <a class="code" href="Graphics_2Types_8h.htm#a26d2f025681acd41ab00ead3b5aa23eb">sfImage</a>* <a class="code" href="Image_8h.htm#aa5ad8d642a2e82b333876ea52cc9d34a" title="Create an image and fill it with a unique color.">sfImage_createFromColor</a>(<span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> width, <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> height, <a class="code" href="structsfColor.htm" title="Utility class for manpulating RGBA colors.">sfColor</a> color);</div>
<div class="line"><a name="l00064"></a><span class="lineno"> 64</span> </div>
<div class="line"><a name="l00080"></a><span class="lineno"> 80</span> <a class="code" href="Graphics_2Export_8h.htm#afe51e93179eaff14e83568c716e633c0">CSFML_GRAPHICS_API</a> <a class="code" href="Graphics_2Types_8h.htm#a26d2f025681acd41ab00ead3b5aa23eb">sfImage</a>* <a class="code" href="Image_8h.htm#aa909565a56117ca3cbe65d83bcb4daac" title="Create an image from an array of pixels.">sfImage_createFromPixels</a>(<span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> width, <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> height, <span class="keyword">const</span> <a class="code" href="Config_8h.htm#a845ea33920d5aaf0580c8d63486e07dc">sfUint8</a>* pixels);</div>
<div class="line"><a name="l00081"></a><span class="lineno"> 81</span> </div>
<div class="line"><a name="l00095"></a><span class="lineno"> 95</span> <a class="code" href="Graphics_2Export_8h.htm#afe51e93179eaff14e83568c716e633c0">CSFML_GRAPHICS_API</a> <a class="code" href="Graphics_2Types_8h.htm#a26d2f025681acd41ab00ead3b5aa23eb">sfImage</a>* <a class="code" href="Image_8h.htm#ae864b7b88422539764d9b58851c1f7a3" title="Create an image from a file on disk.">sfImage_createFromFile</a>(<span class="keyword">const</span> <span class="keywordtype">char</span>* filename);</div>
<div class="line"><a name="l00096"></a><span class="lineno"> 96</span> </div>
<div class="line"><a name="l00111"></a><span class="lineno"> 111</span> <a class="code" href="Graphics_2Export_8h.htm#afe51e93179eaff14e83568c716e633c0">CSFML_GRAPHICS_API</a> <a class="code" href="Graphics_2Types_8h.htm#a26d2f025681acd41ab00ead3b5aa23eb">sfImage</a>* <a class="code" href="Image_8h.htm#a299c153832d6a2679adfb13bee458595" title="Create an image from a file in memory.">sfImage_createFromMemory</a>(<span class="keyword">const</span> <span class="keywordtype">void</span>* data, <span class="keywordtype">size_t</span> size);</div>
<div class="line"><a name="l00112"></a><span class="lineno"> 112</span> </div>
<div class="line"><a name="l00126"></a><span class="lineno"> 126</span> <a class="code" href="Graphics_2Export_8h.htm#afe51e93179eaff14e83568c716e633c0">CSFML_GRAPHICS_API</a> <a class="code" href="Graphics_2Types_8h.htm#a26d2f025681acd41ab00ead3b5aa23eb">sfImage</a>* <a class="code" href="Image_8h.htm#a8c4a88adc21825453518b06840a1c64b" title="Create an image from a custom stream.">sfImage_createFromStream</a>(<a class="code" href="structsfInputStream.htm" title="Set of callbacks that allow users to define custom file streams.">sfInputStream</a>* stream);</div>
<div class="line"><a name="l00127"></a><span class="lineno"> 127</span> </div>
<div class="line"><a name="l00136"></a><span class="lineno"> 136</span> <a class="code" href="Graphics_2Export_8h.htm#afe51e93179eaff14e83568c716e633c0">CSFML_GRAPHICS_API</a> <a class="code" href="Graphics_2Types_8h.htm#a26d2f025681acd41ab00ead3b5aa23eb">sfImage</a>* <a class="code" href="Image_8h.htm#a4bbd96006bd3b296c249a56fd93f2a14" title="Copy an existing image.">sfImage_copy</a>(<span class="keyword">const</span> <a class="code" href="Graphics_2Types_8h.htm#a26d2f025681acd41ab00ead3b5aa23eb">sfImage</a>* image);</div>
<div class="line"><a name="l00137"></a><span class="lineno"> 137</span> </div>
<div class="line"><a name="l00144"></a><span class="lineno"> 144</span> <a class="code" href="Graphics_2Export_8h.htm#afe51e93179eaff14e83568c716e633c0">CSFML_GRAPHICS_API</a> <span class="keywordtype">void</span> <a class="code" href="Image_8h.htm#ab936bab00ec39212050ae4a0d4dd51db" title="Destroy an existing image.">sfImage_destroy</a>(<a class="code" href="Graphics_2Types_8h.htm#a26d2f025681acd41ab00ead3b5aa23eb">sfImage</a>* image);</div>
<div class="line"><a name="l00145"></a><span class="lineno"> 145</span> </div>
<div class="line"><a name="l00160"></a><span class="lineno"> 160</span> <a class="code" href="Graphics_2Export_8h.htm#afe51e93179eaff14e83568c716e633c0">CSFML_GRAPHICS_API</a> <a class="code" href="Config_8h.htm#a7559f07a31bb3a4a3d865178ce4dc70b">sfBool</a> <a class="code" href="Image_8h.htm#a351fa50475d8bc5150f3ac15c0daae66" title="Save an image to a file on disk.">sfImage_saveToFile</a>(<span class="keyword">const</span> <a class="code" href="Graphics_2Types_8h.htm#a26d2f025681acd41ab00ead3b5aa23eb">sfImage</a>* image, <span class="keyword">const</span> <span class="keywordtype">char</span>* filename);</div>
<div class="line"><a name="l00161"></a><span class="lineno"> 161</span> </div>
<div class="line"><a name="l00170"></a><span class="lineno"> 170</span> <a class="code" href="Graphics_2Export_8h.htm#afe51e93179eaff14e83568c716e633c0">CSFML_GRAPHICS_API</a> <a class="code" href="structsfVector2u.htm" title="2-component vector of unsigned integers">sfVector2u</a> <a class="code" href="Image_8h.htm#a3524dabdf7ff672d5fbc2f89e49e86ca" title="Return the size of an image.">sfImage_getSize</a>(<span class="keyword">const</span> <a class="code" href="Graphics_2Types_8h.htm#a26d2f025681acd41ab00ead3b5aa23eb">sfImage</a>* image);</div>
<div class="line"><a name="l00171"></a><span class="lineno"> 171</span> </div>
<div class="line"><a name="l00184"></a><span class="lineno"> 184</span> <a class="code" href="Graphics_2Export_8h.htm#afe51e93179eaff14e83568c716e633c0">CSFML_GRAPHICS_API</a> <span class="keywordtype">void</span> <a class="code" href="Image_8h.htm#a3bb4c1f22a7e10a996b6536921d2d24f" title="Create a transparency mask from a specified color-key.">sfImage_createMaskFromColor</a>(<a class="code" href="Graphics_2Types_8h.htm#a26d2f025681acd41ab00ead3b5aa23eb">sfImage</a>* image, <a class="code" href="structsfColor.htm" title="Utility class for manpulating RGBA colors.">sfColor</a> color, <a class="code" href="Config_8h.htm#a845ea33920d5aaf0580c8d63486e07dc">sfUint8</a> alpha);</div>
<div class="line"><a name="l00185"></a><span class="lineno"> 185</span> </div>
<div class="line"><a name="l00207"></a><span class="lineno"> 207</span> <a class="code" href="Graphics_2Export_8h.htm#afe51e93179eaff14e83568c716e633c0">CSFML_GRAPHICS_API</a> <span class="keywordtype">void</span> <a class="code" href="Image_8h.htm#a29518c87313d7f9f93359425d10b4ca5" title="Copy pixels from an image onto another.">sfImage_copyImage</a>(<a class="code" href="Graphics_2Types_8h.htm#a26d2f025681acd41ab00ead3b5aa23eb">sfImage</a>* image, <span class="keyword">const</span> <a class="code" href="Graphics_2Types_8h.htm#a26d2f025681acd41ab00ead3b5aa23eb">sfImage</a>* source, <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> destX, <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> destY, <a class="code" href="structsfIntRect.htm">sfIntRect</a> sourceRect, <a class="code" href="Config_8h.htm#a7559f07a31bb3a4a3d865178ce4dc70b">sfBool</a> applyAlpha);</div>
<div class="line"><a name="l00208"></a><span class="lineno"> 208</span> </div>
<div class="line"><a name="l00222"></a><span class="lineno"> 222</span> <a class="code" href="Graphics_2Export_8h.htm#afe51e93179eaff14e83568c716e633c0">CSFML_GRAPHICS_API</a> <span class="keywordtype">void</span> <a class="code" href="Image_8h.htm#a516766bc953829e81f353eaa5f380d2e" title="Change the color of a pixel in an image.">sfImage_setPixel</a>(<a class="code" href="Graphics_2Types_8h.htm#a26d2f025681acd41ab00ead3b5aa23eb">sfImage</a>* image, <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> x, <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> y, <a class="code" href="structsfColor.htm" title="Utility class for manpulating RGBA colors.">sfColor</a> color);</div>
<div class="line"><a name="l00223"></a><span class="lineno"> 223</span> </div>
<div class="line"><a name="l00238"></a><span class="lineno"> 238</span> <a class="code" href="Graphics_2Export_8h.htm#afe51e93179eaff14e83568c716e633c0">CSFML_GRAPHICS_API</a> <a class="code" href="structsfColor.htm" title="Utility class for manpulating RGBA colors.">sfColor</a> <a class="code" href="Image_8h.htm#a0c635a97c7a0cb92b3a16faef36c8b9f" title="Get the color of a pixel in an image.">sfImage_getPixel</a>(<span class="keyword">const</span> <a class="code" href="Graphics_2Types_8h.htm#a26d2f025681acd41ab00ead3b5aa23eb">sfImage</a>* image, <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> x, <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> y);</div>
<div class="line"><a name="l00239"></a><span class="lineno"> 239</span> </div>
<div class="line"><a name="l00255"></a><span class="lineno"> 255</span> <a class="code" href="Graphics_2Export_8h.htm#afe51e93179eaff14e83568c716e633c0">CSFML_GRAPHICS_API</a> <span class="keyword">const</span> <a class="code" href="Config_8h.htm#a845ea33920d5aaf0580c8d63486e07dc">sfUint8</a>* <a class="code" href="Image_8h.htm#aa74a30402377d3ab633f038913ed48e6" title="Get a read-only pointer to the array of pixels of an image.">sfImage_getPixelsPtr</a>(<span class="keyword">const</span> <a class="code" href="Graphics_2Types_8h.htm#a26d2f025681acd41ab00ead3b5aa23eb">sfImage</a>* image);</div>
<div class="line"><a name="l00256"></a><span class="lineno"> 256</span> </div>
<div class="line"><a name="l00263"></a><span class="lineno"> 263</span> <a class="code" href="Graphics_2Export_8h.htm#afe51e93179eaff14e83568c716e633c0">CSFML_GRAPHICS_API</a> <span class="keywordtype">void</span> <a class="code" href="Image_8h.htm#ae80bd305661ac64e5b4312ae98724e98" title="Flip an image horizontally (left <-> right)">sfImage_flipHorizontally</a>(<a class="code" href="Graphics_2Types_8h.htm#a26d2f025681acd41ab00ead3b5aa23eb">sfImage</a>* image);</div>
<div class="line"><a name="l00264"></a><span class="lineno"> 264</span> </div>
<div class="line"><a name="l00271"></a><span class="lineno"> 271</span> <a class="code" href="Graphics_2Export_8h.htm#afe51e93179eaff14e83568c716e633c0">CSFML_GRAPHICS_API</a> <span class="keywordtype">void</span> <a class="code" href="Image_8h.htm#aaa8ba528449f26ba9b0a86c700f9d950" title="Flip an image vertically (top <-> bottom)">sfImage_flipVertically</a>(<a class="code" href="Graphics_2Types_8h.htm#a26d2f025681acd41ab00ead3b5aa23eb">sfImage</a>* image);</div>
<div class="line"><a name="l00272"></a><span class="lineno"> 272</span> </div>
<div class="line"><a name="l00273"></a><span class="lineno"> 273</span> </div>
<div class="line"><a name="l00274"></a><span class="lineno"> 274</span> <span class="preprocessor">#endif // SFML_IMAGE_H</span></div>
</div><!-- fragment --></div><!-- contents -->
</div>
<div id="footer-container">
<div id="footer">
Copyright � Laurent Gomila ::
Documentation generated by <a href="http://www.doxygen.org/" title="doxygen website">doxygen</a> ::
</div>
</div>
</body>
</html>
|