Commit | Line | Data |
---|---|---|
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="packUnorm">\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>packUnorm</refentrytitle>\r | |
13 | <manvolnum>3G</manvolnum>\r | |
14 | </refmeta>\r | |
15 | <refnamediv>\r | |
16 | <refname>packUnorm</refname>\r | |
17 | <refpurpose>pack floating-point values into an unsigned integer</refpurpose>\r | |
18 | </refnamediv>\r | |
19 | <refsynopsisdiv><title>Declaration</title>\r | |
20 | <funcsynopsis>\r | |
21 | <funcprototype>\r | |
22 | <funcdef>uint <function>packUnorm2x16</function></funcdef>\r | |
23 | <paramdef>vec2 <parameter>v</parameter></paramdef>\r | |
24 | </funcprototype>\r | |
25 | <funcprototype>\r | |
26 | <funcdef>uint <function>packSnorm2x16</function></funcdef>\r | |
27 | <paramdef>vec2 <parameter>v</parameter></paramdef>\r | |
28 | </funcprototype>\r | |
29 | <funcprototype>\r | |
30 | <funcdef>uint <function>packUnorm4x8</function></funcdef>\r | |
31 | <paramdef>vec4 <parameter>v</parameter></paramdef>\r | |
32 | </funcprototype>\r | |
33 | <funcprototype>\r | |
34 | <funcdef>uint <function>packSnorm4x8</function></funcdef>\r | |
35 | <paramdef>vec4 <parameter>v</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>v</parameter></term>\r | |
43 | <listitem>\r | |
44 | <para>\r | |
45 | Specifies a vector of values to be packed into an unsigned integer.\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>packUnorm2x16</function>, <function>packSnorm2x16</function>, <function>packUnorm4x8</function> and <function>packSnorm4x8</function> convert\r | |
54 | each component of the normalized floating-ponit value <parameter>v</parameter> into 8- or 16-bit integer\r | |
55 | values and then packs the results into a 32-bit unsigned intgeter.\r | |
56 | </para>\r | |
57 | <para>\r | |
58 | The conversion for component <parameter>c</parameter> of <parameter>v</parameter> to fixed-point is\r | |
59 | performed as follows:\r | |
60 | <itemizedlist>\r | |
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>\r | |
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>\r | |
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>\r | |
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>\r | |
65 | </itemizedlist>\r | |
66 | </para>\r | |
67 | <para>\r | |
68 | The first component of the vector will be written to the least significant bits of the output;\r | |
69 | the last component will be written to 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>packUnorm2x16</entry>#newin41#\r | |
79 | </row>\r | |
80 | <row>\r | |
81 | <entry>packSnorm2x16</entry>#newin42#\r | |
82 | </row>\r | |
83 | <row>\r | |
84 | <entry>packUnorm4x8</entry>#newin41#\r | |
85 | </row>\r | |
86 | <row>\r | |
87 | <entry>packSnorm4x8</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>unpackUnorm2x16</refentrytitle></citerefentry>,\r | |
96 | <citerefentry><refentrytitle>unpackSnorm2x16</refentrytitle></citerefentry>,\r | |
97 | <citerefentry><refentrytitle>unpackUnorm4x8</refentrytitle></citerefentry>,\r | |
98 | <citerefentry><refentrytitle>unpackSnorm4x8</refentrytitle></citerefentry>\r | |
99 | </para>\r | |
100 | </refsect1>\r | |
101 | <refsect1 id="Copyright"><title>Copyright</title>\r | |
102 | <para>\r | |
103 | Copyright <trademark class="copyright"></trademark> 2011 Khronos Group. \r | |
104 | This material may be distributed subject to the terms and conditions set forth in \r | |
105 | the Open Publication License, v 1.0, 8 June 1999.\r | |
106 | <ulink url="http://opencontent.org/openpub/">http://opencontent.org/openpub/</ulink>.\r | |
107 | </para>\r | |
108 | </refsect1>\r | |
109 | </refentry>\r |