1 <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
4 <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
5 <title>gstfloatcast</title>
6 <meta name="generator" content="DocBook XSL Stylesheets V1.76.1">
7 <link rel="home" href="index.html" title="GStreamer Base Plugins 0.10 Library Reference Manual">
8 <link rel="up" href="gstreamer-floatcast.html" title="FloatCast Library">
9 <link rel="prev" href="gstreamer-floatcast.html" title="FloatCast Library">
10 <link rel="next" href="gstreamer-interfaces.html" title="Interfaces Library">
11 <meta name="generator" content="GTK-Doc V1.18 (XML mode)">
12 <link rel="stylesheet" href="style.css" type="text/css">
14 <body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
15 <table class="navigation" id="top" width="100%" summary="Navigation header" cellpadding="2" cellspacing="2">
17 <td><a accesskey="p" href="gstreamer-floatcast.html"><img src="left.png" width="24" height="24" border="0" alt="Prev"></a></td>
18 <td><a accesskey="u" href="gstreamer-floatcast.html"><img src="up.png" width="24" height="24" border="0" alt="Up"></a></td>
19 <td><a accesskey="h" href="index.html"><img src="home.png" width="24" height="24" border="0" alt="Home"></a></td>
20 <th width="100%" align="center">GStreamer Base Plugins 0.10 Library Reference Manual</th>
21 <td><a accesskey="n" href="gstreamer-interfaces.html"><img src="right.png" width="24" height="24" border="0" alt="Next"></a></td>
23 <tr><td colspan="5" class="shortcuts">
24 <a href="#gst-plugins-base-libs-gstfloatcast.synopsis" class="shortcut">Top</a>
26 <a href="#gst-plugins-base-libs-gstfloatcast.description" class="shortcut">Description</a>
29 <div class="refentry">
30 <a name="gst-plugins-base-libs-gstfloatcast"></a><div class="titlepage"></div>
31 <div class="refnamediv"><table width="100%"><tr>
33 <h2><span class="refentrytitle"><a name="gst-plugins-base-libs-gstfloatcast.top_of_page"></a>gstfloatcast</span></h2>
34 <p>gstfloatcast — Floating point platform independence macros</p>
36 <td valign="top" align="right"></td>
38 <div class="refsynopsisdiv">
39 <a name="gst-plugins-base-libs-gstfloatcast.synopsis"></a><h2>Synopsis</h2>
40 <pre class="synopsis">
41 #include <gst/floatcast/floatcast.h>
43 #define <a class="link" href="gst-plugins-base-libs-gstfloatcast.html#gst-cast-double" title="gst_cast_double()">gst_cast_double</a> (x)
44 #define <a class="link" href="gst-plugins-base-libs-gstfloatcast.html#gst-cast-float" title="gst_cast_float()">gst_cast_float</a> (x)
47 <div class="refsect1">
48 <a name="gst-plugins-base-libs-gstfloatcast.description"></a><h2>Description</h2>
50 The floatcast.h header file contains a couple of convenience macros for
51 floating point numbers.
54 If you include this header, your application or library must link against
55 libm (for maths.h support).
58 For optimal results, your application's or library's build
59 system should check whether the C99 functions lrint and lrintf are supported
60 and define the preprocessor symbols HAVE_LRINT and HAVE_LRINTF if so. If
61 you are using autoconf, you can do this by using the AC_C99_FUNC_LRINT and
62 AC_C99_FUNC_LRINTF checks in your configure.ac or configure.in file and
63 including your application's config.h header before you include floatcast.h.
66 <div class="refsect1">
67 <a name="gst-plugins-base-libs-gstfloatcast.details"></a><h2>Details</h2>
68 <div class="refsect2">
69 <a name="gst-cast-double"></a><h3>gst_cast_double()</h3>
70 <pre class="programlisting"> #define gst_cast_double(x) ((gint)lrint(x))
73 Casts a 64-bit floating point value (double) to an integer without bias.
75 <div class="variablelist"><table border="0">
76 <col align="left" valign="top">
78 <td><p><span class="term"><em class="parameter"><code>x</code></em> :</span></p></td>
84 <div class="refsect2">
85 <a name="gst-cast-float"></a><h3>gst_cast_float()</h3>
86 <pre class="programlisting"> #define gst_cast_float(x) ((gint)lrintf(x))
89 Casts a 32-bit floating point value (float) to an integer without bias.
91 <div class="variablelist"><table border="0">
92 <col align="left" valign="top">
94 <td><p><span class="term"><em class="parameter"><code>x</code></em> :</span></p></td>
103 Generated by GTK-Doc V1.18</div>