42b17fca4afc3d881b1aa259f6c04775819fe649
[clinton/guile-figl.git] / upstream-man-pages / manglsl / unpackUnorm2x16.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="unpackUnorm">
5 <refmeta>
6 <refmetainfo>
7 <copyright>
8 <year>2011</year>
9 <holder>Khronos Group</holder>
10 </copyright>
11 </refmetainfo>
12 <refentrytitle>unpackUnorm</refentrytitle>
13 <manvolnum>3G</manvolnum>
14 </refmeta>
15 <refnamediv>
16 <refname>unpackUnorm2x16, unpackUnorm4x8, unpackSnorm4x8</refname>
17 <refpurpose>unpack floating-point values from an unsigned integer</refpurpose>
18 </refnamediv>
19 <refsynopsisdiv><title>Declaration</title>
20 <funcsynopsis>
21 <funcprototype>
22 <funcdef>vec2 <function>unpackUnorm2x16</function></funcdef>
23 <paramdef>uint <parameter>p</parameter></paramdef>
24 </funcprototype>
25 <funcprototype>
26 <funcdef>vec2 <function>unpackSnorm2x16</function></funcdef>
27 <paramdef>uint <parameter>p</parameter></paramdef>
28 </funcprototype>
29 <funcprototype>
30 <funcdef>vec4 <function>unpackUnorm4x8</function></funcdef>
31 <paramdef>uint <parameter>p</parameter></paramdef>
32 </funcprototype>
33 <funcprototype>
34 <funcdef>vec4 <function>unpackSnorm4x8</function></funcdef>
35 <paramdef>uint <parameter>p</parameter></paramdef>
36 </funcprototype>
37 </funcsynopsis>
38 </refsynopsisdiv>
39 <refsect1 id="parameters"><title>Parameters</title>
40 <variablelist>
41 <varlistentry>
42 <term><parameter>p</parameter></term>
43 <listitem>
44 <para>
45 Specifies an unsigned integer containing packed floating-point values.
46 </para>
47 </listitem>
48 </varlistentry>
49 </variablelist>
50 </refsect1>
51 <refsect1 id="description"><title>Description</title>
52 <para>
53 <function>unpackUnorm2x16</function>, <function>unpackSnorm2x16</function>, <function>unpackUnorm4x8</function> and <function>unpackSnorm4x8</function> unpack
54 single 32-bit unsigned integers, specified in the parameter <parameter>p</parameter> into a pair of 16-bit unsigned integers,
55 four 8-bit unsigned integers or four 8-bit signed integers. Then, each component is converted to a normalized floating-point
56 value to generate the returned two- or four-component vector.
57 </para>
58 <para>
59 The conversion for unpacked fixed point value <emphasis>f</emphasis> to floating-point is performed as follows:
60 <itemizedlist>
61 <listitem><function>packUnorm2x16</function>: <code>f / 65535.0</code></listitem>
62 <listitem><function>packSnorm2x16</function>: <code><citerefentry><refentrytitle>clamp</refentrytitle></citerefentry>(f / 32727.0, -1.0, 1.0)</code></listitem>
63 <listitem><function>packUnorm4x8</function>: <code>f / 255.0</code></listitem>
64 <listitem><function>packSnorm4x8</function>: <code><citerefentry><refentrytitle>clamp</refentrytitle></citerefentry>(f / 127.0, -1.0, 1.0)</code></listitem>
65 </itemizedlist>
66 </para>
67 <para>
68 The first component of the returned vector will be extracted from the least significant bits of the input;
69 the last component will be extracted from 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>unpackUnorm2x16</entry>#newin41#
79 </row>
80 <row>
81 <entry>unpackSnorm2x16</entry>#newin42#
82 </row>
83 <row>
84 <entry>unpackUnorm4x8</entry>#newin41#
85 </row>
86 <row>
87 <entry>unpackSnorm4x8</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>packUnorm2x16</refentrytitle></citerefentry>,
96 <citerefentry><refentrytitle>packUnorm4x8</refentrytitle></citerefentry>,
97 <citerefentry><refentrytitle>packSnorm4x8</refentrytitle></citerefentry>
98 </para>
99 </refsect1>
100 <refsect1 id="Copyright"><title>Copyright</title>
101 <para>
102 Copyright <trademark class="copyright"></trademark> 2011 Khronos Group.
103 This material may be distributed subject to the terms and conditions set forth in
104 the Open Publication License, v 1.0, 8 June 1999.
105 <ulink url="http://opencontent.org/openpub/">http://opencontent.org/openpub/</ulink>.
106 </para>
107 </refsect1>
108 </refentry>