diff options
author | David Walter Seikel | 2016-03-29 02:16:55 +1000 |
---|---|---|
committer | David Walter Seikel | 2016-03-29 02:16:55 +1000 |
commit | cb3716ffb584fe0f593b6f1669a8efdba1305104 (patch) | |
tree | 5d1ebc4b6fc17b30f4b34e7e64a2d9514893459b /src/others/mimesh/libg3d-0.0.8/doc/api/xml/texture.xml | |
parent | Add Prosody build script. (diff) | |
download | SledjHamr-cb3716ffb584fe0f593b6f1669a8efdba1305104.zip SledjHamr-cb3716ffb584fe0f593b6f1669a8efdba1305104.tar.gz SledjHamr-cb3716ffb584fe0f593b6f1669a8efdba1305104.tar.bz2 SledjHamr-cb3716ffb584fe0f593b6f1669a8efdba1305104.tar.xz |
Added my version of libg3d and friends.
Diffstat (limited to 'src/others/mimesh/libg3d-0.0.8/doc/api/xml/texture.xml')
-rw-r--r-- | src/others/mimesh/libg3d-0.0.8/doc/api/xml/texture.xml | 318 |
1 files changed, 318 insertions, 0 deletions
diff --git a/src/others/mimesh/libg3d-0.0.8/doc/api/xml/texture.xml b/src/others/mimesh/libg3d-0.0.8/doc/api/xml/texture.xml new file mode 100644 index 0000000..7720977 --- /dev/null +++ b/src/others/mimesh/libg3d-0.0.8/doc/api/xml/texture.xml | |||
@@ -0,0 +1,318 @@ | |||
1 | <?xml version="1.0"?> | ||
2 | <!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.1.2//EN" | ||
3 | "http://www.oasis-open.org/docbook/xml/4.1.2/docbookx.dtd"> | ||
4 | <refentry id="libg3d-texture"> | ||
5 | <refmeta> | ||
6 | <refentrytitle role="top_of_page" id="libg3d-texture.top_of_page">texture</refentrytitle> | ||
7 | <manvolnum>3</manvolnum> | ||
8 | <refmiscinfo>LIBG3D Library</refmiscinfo> | ||
9 | </refmeta> | ||
10 | |||
11 | <refnamediv> | ||
12 | <refname>texture</refname> | ||
13 | <refpurpose>Texture loading and manipulation</refpurpose> | ||
14 | <!--[<xref linkend="desc" endterm="desc.title"/>]--> | ||
15 | </refnamediv> | ||
16 | |||
17 | <refsynopsisdiv id="libg3d-texture.synopsis" role="synopsis"> | ||
18 | <title role="synopsis.title">Synopsis</title> | ||
19 | |||
20 | <synopsis> | ||
21 | |||
22 | #include <g3d/texture.h> | ||
23 | |||
24 | #define <link linkend="G3D-FLAG-IMG-GREYSCALE:CAPS">G3D_FLAG_IMG_GREYSCALE</link> | ||
25 | enum <link linkend="G3DTexEnv">G3DTexEnv</link>; | ||
26 | <link linkend="G3DImage">G3DImage</link>; | ||
27 | <link linkend="G3DImage">G3DImage</link>* <link linkend="g3d-texture-load-cached">g3d_texture_load_cached</link> (<link linkend="G3DContext">G3DContext</link> *context, | ||
28 | <link linkend="G3DModel">G3DModel</link> *model, | ||
29 | const <link linkend="gchar">gchar</link> *filename); | ||
30 | <link linkend="G3DImage">G3DImage</link>* <link linkend="g3d-texture-load-from-stream">g3d_texture_load_from_stream</link> (<link linkend="G3DContext">G3DContext</link> *context, | ||
31 | <link linkend="G3DModel">G3DModel</link> *model, | ||
32 | <link linkend="G3DStream">G3DStream</link> *stream); | ||
33 | <link linkend="G3DImage">G3DImage</link>* <link linkend="g3d-texture-load">g3d_texture_load</link> (<link linkend="G3DContext">G3DContext</link> *context, | ||
34 | const <link linkend="gchar">gchar</link> *filename); | ||
35 | <link linkend="void">void</link> <link linkend="g3d-texture-free">g3d_texture_free</link> (<link linkend="G3DImage">G3DImage</link> *texture); | ||
36 | <link linkend="gboolean">gboolean</link> <link linkend="g3d-texture-prepare">g3d_texture_prepare</link> (<link linkend="G3DImage">G3DImage</link> *texture); | ||
37 | <link linkend="gboolean">gboolean</link> <link linkend="g3d-texture-flip-y">g3d_texture_flip_y</link> (<link linkend="G3DImage">G3DImage</link> *texture); | ||
38 | <link linkend="G3DImage">G3DImage</link>* <link linkend="g3d-texture-merge-alpha">g3d_texture_merge_alpha</link> (<link linkend="G3DImage">G3DImage</link> *image, | ||
39 | <link linkend="G3DImage">G3DImage</link> *aimage); | ||
40 | </synopsis> | ||
41 | </refsynopsisdiv> | ||
42 | |||
43 | |||
44 | |||
45 | |||
46 | |||
47 | |||
48 | |||
49 | |||
50 | |||
51 | <refsect1 id="libg3d-texture.description" role="desc"> | ||
52 | <title role="desc.title">Description</title> | ||
53 | <para> | ||
54 | A texture is an image used in materials. Here are some helper functions, | ||
55 | mostly for cached loading of a <link linkend="G3DImage"><type>G3DImage</type></link>.</para> | ||
56 | <para> | ||
57 | |||
58 | </para> | ||
59 | </refsect1> | ||
60 | |||
61 | <refsect1 id="libg3d-texture.details" role="details"> | ||
62 | <title role="details.title">Details</title> | ||
63 | <refsect2 id="G3D-FLAG-IMG-GREYSCALE:CAPS" role="macro"> | ||
64 | <title>G3D_FLAG_IMG_GREYSCALE</title> | ||
65 | <indexterm zone="G3D-FLAG-IMG-GREYSCALE:CAPS"><primary>G3D_FLAG_IMG_GREYSCALE</primary></indexterm><programlisting>#define G3D_FLAG_IMG_GREYSCALE (1L << 1) | ||
66 | </programlisting> | ||
67 | <para> | ||
68 | The image just uses the red channel for grey value</para> | ||
69 | <para> | ||
70 | |||
71 | </para></refsect2> | ||
72 | <refsect2 id="G3DTexEnv" role="enum"> | ||
73 | <title>enum G3DTexEnv</title> | ||
74 | <indexterm zone="G3DTexEnv"><primary>G3DTexEnv</primary></indexterm><programlisting>typedef enum { | ||
75 | G3D_TEXENV_UNSPECIFIED = 0, | ||
76 | G3D_TEXENV_BLEND, | ||
77 | G3D_TEXENV_DECAL, | ||
78 | G3D_TEXENV_MODULATE, | ||
79 | G3D_TEXENV_REPLACE | ||
80 | } G3DTexEnv; | ||
81 | </programlisting> | ||
82 | <para> | ||
83 | Specify how the texture should interact with other material properties.</para> | ||
84 | <para> | ||
85 | |||
86 | </para><variablelist role="enum"> | ||
87 | <varlistentry id="G3D-TEXENV-UNSPECIFIED:CAPS" role="constant"> | ||
88 | <term><literal>G3D_TEXENV_UNSPECIFIED</literal></term> | ||
89 | <listitem><simpara> unspecified, application decides | ||
90 | </simpara></listitem> | ||
91 | </varlistentry> | ||
92 | <varlistentry id="G3D-TEXENV-BLEND:CAPS" role="constant"> | ||
93 | <term><literal>G3D_TEXENV_BLEND</literal></term> | ||
94 | <listitem><simpara> use blending | ||
95 | </simpara></listitem> | ||
96 | </varlistentry> | ||
97 | <varlistentry id="G3D-TEXENV-DECAL:CAPS" role="constant"> | ||
98 | <term><literal>G3D_TEXENV_DECAL</literal></term> | ||
99 | <listitem><simpara> use as decal | ||
100 | </simpara></listitem> | ||
101 | </varlistentry> | ||
102 | <varlistentry id="G3D-TEXENV-MODULATE:CAPS" role="constant"> | ||
103 | <term><literal>G3D_TEXENV_MODULATE</literal></term> | ||
104 | <listitem><simpara> use modulate | ||
105 | </simpara></listitem> | ||
106 | </varlistentry> | ||
107 | <varlistentry id="G3D-TEXENV-REPLACE:CAPS" role="constant"> | ||
108 | <term><literal>G3D_TEXENV_REPLACE</literal></term> | ||
109 | <listitem><simpara> replace color | ||
110 | </simpara></listitem> | ||
111 | </varlistentry> | ||
112 | </variablelist></refsect2> | ||
113 | <refsect2 id="G3DImage" role="struct"> | ||
114 | <title>G3DImage</title> | ||
115 | <indexterm zone="G3DImage"><primary>G3DImage</primary></indexterm><programlisting>typedef struct { | ||
116 | gchar *name; | ||
117 | guint32 width; | ||
118 | guint32 height; | ||
119 | guint8 depth; | ||
120 | guint32 flags; | ||
121 | guint8 *pixeldata; | ||
122 | |||
123 | guint32 tex_id; | ||
124 | G3DTexEnv tex_env; | ||
125 | G3DFloat tex_scale_u; | ||
126 | G3DFloat tex_scale_v; | ||
127 | } G3DImage; | ||
128 | </programlisting> | ||
129 | <para> | ||
130 | Object containing a two-dimensional pixel image.</para> | ||
131 | <para> | ||
132 | |||
133 | </para><variablelist role="struct"> | ||
134 | <varlistentry> | ||
135 | <term><link linkend="gchar">gchar</link> *<structfield>name</structfield>;</term> | ||
136 | <listitem><simpara> name of image | ||
137 | </simpara></listitem> | ||
138 | </varlistentry> | ||
139 | <varlistentry> | ||
140 | <term><link linkend="guint32">guint32</link> <structfield>width</structfield>;</term> | ||
141 | <listitem><simpara> width of image in pixels | ||
142 | </simpara></listitem> | ||
143 | </varlistentry> | ||
144 | <varlistentry> | ||
145 | <term><link linkend="guint32">guint32</link> <structfield>height</structfield>;</term> | ||
146 | <listitem><simpara> height of image in pixels | ||
147 | </simpara></listitem> | ||
148 | </varlistentry> | ||
149 | <varlistentry> | ||
150 | <term><link linkend="guint8">guint8</link> <structfield>depth</structfield>;</term> | ||
151 | <listitem><simpara> depth of image in bits | ||
152 | </simpara></listitem> | ||
153 | </varlistentry> | ||
154 | <varlistentry> | ||
155 | <term><link linkend="guint32">guint32</link> <structfield>flags</structfield>;</term> | ||
156 | <listitem><simpara> flags | ||
157 | </simpara></listitem> | ||
158 | </varlistentry> | ||
159 | <varlistentry> | ||
160 | <term><link linkend="guint8">guint8</link> *<structfield>pixeldata</structfield>;</term> | ||
161 | <listitem><simpara> the binary image data | ||
162 | </simpara></listitem> | ||
163 | </varlistentry> | ||
164 | <varlistentry> | ||
165 | <term><link linkend="guint32">guint32</link> <structfield>tex_id</structfield>;</term> | ||
166 | <listitem><simpara> the OpenGL texture id, should be unique model-wide | ||
167 | </simpara></listitem> | ||
168 | </varlistentry> | ||
169 | <varlistentry> | ||
170 | <term><link linkend="G3DTexEnv">G3DTexEnv</link> <structfield>tex_env</structfield>;</term> | ||
171 | <listitem><simpara> texture environment flags | ||
172 | </simpara></listitem> | ||
173 | </varlistentry> | ||
174 | <varlistentry> | ||
175 | <term><link linkend="G3DFloat">G3DFloat</link> <structfield>tex_scale_u</structfield>;</term> | ||
176 | <listitem><simpara> factor scaling texture width, should be 1.0 for most cases | ||
177 | </simpara></listitem> | ||
178 | </varlistentry> | ||
179 | <varlistentry> | ||
180 | <term><link linkend="G3DFloat">G3DFloat</link> <structfield>tex_scale_v</structfield>;</term> | ||
181 | <listitem><simpara> factor scaling texture height, should be 1.0 for most cases | ||
182 | </simpara></listitem> | ||
183 | </varlistentry> | ||
184 | </variablelist></refsect2> | ||
185 | <refsect2 id="g3d-texture-load-cached" role="function"> | ||
186 | <title>g3d_texture_load_cached ()</title> | ||
187 | <indexterm zone="g3d-texture-load-cached"><primary>g3d_texture_load_cached</primary></indexterm><programlisting><link linkend="G3DImage">G3DImage</link>* g3d_texture_load_cached (<link linkend="G3DContext">G3DContext</link> *context, | ||
188 | <link linkend="G3DModel">G3DModel</link> *model, | ||
189 | const <link linkend="gchar">gchar</link> *filename);</programlisting> | ||
190 | <para> | ||
191 | Loads a texture image from file and attaches it to a hash table in the | ||
192 | model. On a second try to load this texture it is returned from cache.</para> | ||
193 | <para> | ||
194 | |||
195 | </para><variablelist role="params"> | ||
196 | <varlistentry><term><parameter>context</parameter> :</term> | ||
197 | <listitem><simpara> a valid context | ||
198 | </simpara></listitem></varlistentry> | ||
199 | <varlistentry><term><parameter>model</parameter> :</term> | ||
200 | <listitem><simpara> a valid model | ||
201 | </simpara></listitem></varlistentry> | ||
202 | <varlistentry><term><parameter>filename</parameter> :</term> | ||
203 | <listitem><simpara> the file name of the texture to load | ||
204 | </simpara></listitem></varlistentry> | ||
205 | <varlistentry><term><emphasis>Returns</emphasis> :</term><listitem><simpara> the texture image | ||
206 | </simpara></listitem></varlistentry> | ||
207 | </variablelist></refsect2> | ||
208 | <refsect2 id="g3d-texture-load-from-stream" role="function"> | ||
209 | <title>g3d_texture_load_from_stream ()</title> | ||
210 | <indexterm zone="g3d-texture-load-from-stream"><primary>g3d_texture_load_from_stream</primary></indexterm><programlisting><link linkend="G3DImage">G3DImage</link>* g3d_texture_load_from_stream (<link linkend="G3DContext">G3DContext</link> *context, | ||
211 | <link linkend="G3DModel">G3DModel</link> *model, | ||
212 | <link linkend="G3DStream">G3DStream</link> *stream);</programlisting> | ||
213 | <para> | ||
214 | Load a texture image from a stream. The file type is determined by the | ||
215 | extension of the stream URI, so it should be valid. If <parameter>model</parameter> is not NULL | ||
216 | the texture image is cached (or retrieved from cache if available).</para> | ||
217 | <para> | ||
218 | |||
219 | </para><variablelist role="params"> | ||
220 | <varlistentry><term><parameter>context</parameter> :</term> | ||
221 | <listitem><simpara> a valid context | ||
222 | </simpara></listitem></varlistentry> | ||
223 | <varlistentry><term><parameter>model</parameter> :</term> | ||
224 | <listitem><simpara> a valid model or NULL | ||
225 | </simpara></listitem></varlistentry> | ||
226 | <varlistentry><term><parameter>stream</parameter> :</term> | ||
227 | <listitem><simpara> an open stream | ||
228 | </simpara></listitem></varlistentry> | ||
229 | <varlistentry><term><emphasis>Returns</emphasis> :</term><listitem><simpara> the texture image or NULL in case of an error. | ||
230 | </simpara></listitem></varlistentry> | ||
231 | </variablelist></refsect2> | ||
232 | <refsect2 id="g3d-texture-load" role="function"> | ||
233 | <title>g3d_texture_load ()</title> | ||
234 | <indexterm zone="g3d-texture-load"><primary>g3d_texture_load</primary></indexterm><programlisting><link linkend="G3DImage">G3DImage</link>* g3d_texture_load (<link linkend="G3DContext">G3DContext</link> *context, | ||
235 | const <link linkend="gchar">gchar</link> *filename);</programlisting> | ||
236 | <para> | ||
237 | Load a texture from a file. The type of file is determined by the file | ||
238 | extension.</para> | ||
239 | <para> | ||
240 | |||
241 | </para><variablelist role="params"> | ||
242 | <varlistentry><term><parameter>context</parameter> :</term> | ||
243 | <listitem><simpara> a valid context | ||
244 | </simpara></listitem></varlistentry> | ||
245 | <varlistentry><term><parameter>filename</parameter> :</term> | ||
246 | <listitem><simpara> the file name of the texture | ||
247 | </simpara></listitem></varlistentry> | ||
248 | <varlistentry><term><emphasis>Returns</emphasis> :</term><listitem><simpara> the texture image or NULL in case of an error. | ||
249 | </simpara></listitem></varlistentry> | ||
250 | </variablelist></refsect2> | ||
251 | <refsect2 id="g3d-texture-free" role="function"> | ||
252 | <title>g3d_texture_free ()</title> | ||
253 | <indexterm zone="g3d-texture-free"><primary>g3d_texture_free</primary></indexterm><programlisting><link linkend="void">void</link> g3d_texture_free (<link linkend="G3DImage">G3DImage</link> *texture);</programlisting> | ||
254 | <para> | ||
255 | Frees all memory used by this texture image.</para> | ||
256 | <para> | ||
257 | |||
258 | </para><variablelist role="params"> | ||
259 | <varlistentry><term><parameter>texture</parameter> :</term> | ||
260 | <listitem><simpara> a texture image | ||
261 | </simpara></listitem></varlistentry> | ||
262 | </variablelist></refsect2> | ||
263 | <refsect2 id="g3d-texture-prepare" role="function"> | ||
264 | <title>g3d_texture_prepare ()</title> | ||
265 | <indexterm zone="g3d-texture-prepare"><primary>g3d_texture_prepare</primary></indexterm><programlisting><link linkend="gboolean">gboolean</link> g3d_texture_prepare (<link linkend="G3DImage">G3DImage</link> *texture);</programlisting> | ||
266 | <para> | ||
267 | Resizes the image to dimensions which are a power of 2 to be | ||
268 | usable as an OpenGL texture. | ||
269 | (FIXME: unimplemented)</para> | ||
270 | <para> | ||
271 | |||
272 | </para><variablelist role="params"> | ||
273 | <varlistentry><term><parameter>texture</parameter> :</term> | ||
274 | <listitem><simpara> a texture image | ||
275 | </simpara></listitem></varlistentry> | ||
276 | <varlistentry><term><emphasis>Returns</emphasis> :</term><listitem><simpara> TRUE on success, FALSE else | ||
277 | </simpara></listitem></varlistentry> | ||
278 | </variablelist></refsect2> | ||
279 | <refsect2 id="g3d-texture-flip-y" role="function"> | ||
280 | <title>g3d_texture_flip_y ()</title> | ||
281 | <indexterm zone="g3d-texture-flip-y"><primary>g3d_texture_flip_y</primary></indexterm><programlisting><link linkend="gboolean">gboolean</link> g3d_texture_flip_y (<link linkend="G3DImage">G3DImage</link> *texture);</programlisting> | ||
282 | <para> | ||
283 | Mirror the image along the x axis - all y coordinates are inverted.</para> | ||
284 | <para> | ||
285 | |||
286 | </para><variablelist role="params"> | ||
287 | <varlistentry><term><parameter>texture</parameter> :</term> | ||
288 | <listitem><simpara> a texture image | ||
289 | </simpara></listitem></varlistentry> | ||
290 | <varlistentry><term><emphasis>Returns</emphasis> :</term><listitem><simpara> TRUE on success, FALSE on error. | ||
291 | </simpara></listitem></varlistentry> | ||
292 | </variablelist></refsect2> | ||
293 | <refsect2 id="g3d-texture-merge-alpha" role="function"> | ||
294 | <title>g3d_texture_merge_alpha ()</title> | ||
295 | <indexterm zone="g3d-texture-merge-alpha"><primary>g3d_texture_merge_alpha</primary></indexterm><programlisting><link linkend="G3DImage">G3DImage</link>* g3d_texture_merge_alpha (<link linkend="G3DImage">G3DImage</link> *image, | ||
296 | <link linkend="G3DImage">G3DImage</link> *aimage);</programlisting> | ||
297 | <para> | ||
298 | Merges alpha information from <parameter>aimage</parameter> into output image. If <parameter>image</parameter> is NULL a | ||
299 | new image is created, else <parameter>image</parameter> is returned with alpha from <parameter>aimage</parameter>.</para> | ||
300 | <para> | ||
301 | |||
302 | </para><variablelist role="params"> | ||
303 | <varlistentry><term><parameter>image</parameter> :</term> | ||
304 | <listitem><simpara> a texture image or NULL | ||
305 | </simpara></listitem></varlistentry> | ||
306 | <varlistentry><term><parameter>aimage</parameter> :</term> | ||
307 | <listitem><simpara> an image with alpha information | ||
308 | </simpara></listitem></varlistentry> | ||
309 | <varlistentry><term><emphasis>Returns</emphasis> :</term><listitem><simpara> a texture image or NULL in case of an error. | ||
310 | </simpara></listitem></varlistentry> | ||
311 | </variablelist></refsect2> | ||
312 | |||
313 | </refsect1> | ||
314 | |||
315 | |||
316 | |||
317 | |||
318 | </refentry> | ||