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">
9 <holder>Khronos Group
</holder>
12 <refentrytitle>unpackUnorm
</refentrytitle>
13 <manvolnum>3G
</manvolnum>
16 <refname>unpackUnorm2x16, unpackUnorm4x8, unpackSnorm4x8
</refname>
17 <refpurpose>unpack floating-point values from an unsigned integer
</refpurpose>
19 <refsynopsisdiv><title>Declaration
</title>
22 <funcdef>vec2
<function>unpackUnorm2x16
</function></funcdef>
23 <paramdef>uint
<parameter>p
</parameter></paramdef>
26 <funcdef>vec2
<function>unpackSnorm2x16
</function></funcdef>
27 <paramdef>uint
<parameter>p
</parameter></paramdef>
30 <funcdef>vec4
<function>unpackUnorm4x8
</function></funcdef>
31 <paramdef>uint
<parameter>p
</parameter></paramdef>
34 <funcdef>vec4
<function>unpackSnorm4x8
</function></funcdef>
35 <paramdef>uint
<parameter>p
</parameter></paramdef>
39 <refsect1 id=
"parameters"><title>Parameters
</title>
42 <term><parameter>p
</parameter></term>
45 Specifies an unsigned integer containing packed floating-point values.
51 <refsect1 id=
"description"><title>Description
</title>
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.
59 The conversion for unpacked fixed point value
<emphasis>f
</emphasis> to floating-point is performed as follows:
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>
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.
72 <refsect1 id=
"versions"><title>Version Support
</title>
73 <informaltable frame=
"topbot">
78 <entry>unpackUnorm2x16
</entry>#newin41#
81 <entry>unpackSnorm2x16
</entry>#newin42#
84 <entry>unpackUnorm4x8
</entry>#newin41#
87 <entry>unpackSnorm4x8
</entry>#newin41#
93 <refsect1 id=
"seealso"><title>See Also
</title>
95 <citerefentry><refentrytitle>packUnorm2x16
</refentrytitle></citerefentry>,
96 <citerefentry><refentrytitle>packUnorm4x8
</refentrytitle></citerefentry>,
97 <citerefentry><refentrytitle>packSnorm4x8
</refentrytitle></citerefentry>
100 <refsect1 id=
"Copyright"><title>Copyright
</title>
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>.