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