include more low-level bindings
[clinton/guile-figl.git] / upstream-man-pages / manglsl / packUnorm2x16.xml
1 <?xml version="1.0" encoding="UTF-8"?>
2 <!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook MathML Module V1.1b1//EN"
3 "http://www.oasis-open.org/docbook/xml/mathml/1.1CR1/dbmathml.dtd">
4 <refentry id="packUnorm">
5 <refmeta>
6 <refmetainfo>
7 <copyright>
8 <year>2011</year>
9 <holder>Khronos Group</holder>
10 </copyright>
11 </refmetainfo>
12 <refentrytitle>packUnorm</refentrytitle>
13 <manvolnum>3G</manvolnum>
14 </refmeta>
15 <refnamediv>
16 <refname>packUnorm</refname>
17 <refpurpose>pack floating-point values into an unsigned integer</refpurpose>
18 </refnamediv>
19 <refsynopsisdiv><title>Declaration</title>
20 <funcsynopsis>
21 <funcprototype>
22 <funcdef>uint <function>packUnorm2x16</function></funcdef>
23 <paramdef>vec2 <parameter>v</parameter></paramdef>
24 </funcprototype>
25 <funcprototype>
26 <funcdef>uint <function>packSnorm2x16</function></funcdef>
27 <paramdef>vec2 <parameter>v</parameter></paramdef>
28 </funcprototype>
29 <funcprototype>
30 <funcdef>uint <function>packUnorm4x8</function></funcdef>
31 <paramdef>vec4 <parameter>v</parameter></paramdef>
32 </funcprototype>
33 <funcprototype>
34 <funcdef>uint <function>packSnorm4x8</function></funcdef>
35 <paramdef>vec4 <parameter>v</parameter></paramdef>
36 </funcprototype>
37 </funcsynopsis>
38 </refsynopsisdiv>
39 <refsect1 id="parameters"><title>Parameters</title>
40 <variablelist>
41 <varlistentry>
42 <term><parameter>v</parameter></term>
43 <listitem>
44 <para>
45 Specifies a vector of values to be packed into an unsigned integer.
46 </para>
47 </listitem>
48 </varlistentry>
49 </variablelist>
50 </refsect1>
51 <refsect1 id="description"><title>Description</title>
52 <para>
53 <function>packUnorm2x16</function>, <function>packSnorm2x16</function>, <function>packUnorm4x8</function> and <function>packSnorm4x8</function> convert
54 each component of the normalized floating-ponit value <parameter>v</parameter> into 8- or 16-bit integer
55 values and then packs the results into a 32-bit unsigned intgeter.
56 </para>
57 <para>
58 The conversion for component <parameter>c</parameter> of <parameter>v</parameter> to fixed-point is
59 performed as follows:
60 <itemizedlist>
61 <listitem><function>packUnorm2x16</function>: <code><citerefentry><refentrytitle>round</refentrytitle></citerefentry>(<citerefentry><refentrytitle>clamp</refentrytitle></citerefentry>(<parameter>c</parameter>, 0.0, 1.0) * 65535.0)</code></listitem>
62 <listitem><function>packSnorm2x16</function>: <code><citerefentry><refentrytitle>round</refentrytitle></citerefentry>(<citerefentry><refentrytitle>clamp</refentrytitle></citerefentry>(<parameter>c</parameter>, -1.0, 1.0) * 32767.0)</code></listitem>
63 <listitem><function>packUnorm4x8</function>: <code><citerefentry><refentrytitle>round</refentrytitle></citerefentry>(<citerefentry><refentrytitle>clamp</refentrytitle></citerefentry>(<parameter>c</parameter>, 0.0, 1.0) * 255.0)</code></listitem>
64 <listitem><function>packSnorm4x8</function>: <code><citerefentry><refentrytitle>round</refentrytitle></citerefentry>(<citerefentry><refentrytitle>clamp</refentrytitle></citerefentry>(<parameter>c</parameter>, -1.0, 1.0) * 127.0)</code></listitem>
65 </itemizedlist>
66 </para>
67 <para>
68 The first component of the vector will be written to the least significant bits of the output;
69 the last component will be written to the most significant bits.
70 </para>
71 </refsect1>
72 <refsect1 id="versions"><title>Version Support</title>
73 <informaltable frame="topbot">
74 #VARTABLECOLS#
75 <thead>
76 #FUNCTABLEHEADER#
77 <row>
78 <entry>packUnorm2x16</entry>#newin41#
79 </row>
80 <row>
81 <entry>packSnorm2x16</entry>#newin42#
82 </row>
83 <row>
84 <entry>packUnorm4x8</entry>#newin41#
85 </row>
86 <row>
87 <entry>packSnorm4x8</entry>#newin41#
88 </row>
89 </thead>
90 </tgroup>
91 </informaltable>
92 </refsect1>
93 <refsect1 id="seealso"><title>See Also</title>
94 <para>
95 <citerefentry><refentrytitle>unpackUnorm2x16</refentrytitle></citerefentry>,
96 <citerefentry><refentrytitle>unpackSnorm2x16</refentrytitle></citerefentry>,
97 <citerefentry><refentrytitle>unpackUnorm4x8</refentrytitle></citerefentry>,
98 <citerefentry><refentrytitle>unpackSnorm4x8</refentrytitle></citerefentry>
99 </para>
100 </refsect1>
101 <refsect1 id="Copyright"><title>Copyright</title>
102 <para>
103 Copyright <trademark class="copyright"></trademark> 2011 Khronos Group.
104 This material may be distributed subject to the terms and conditions set forth in
105 the Open Publication License, v 1.0, 8 June 1999.
106 <ulink url="http://opencontent.org/openpub/">http://opencontent.org/openpub/</ulink>.
107 </para>
108 </refsect1>
109 </refentry>