~ubuntu-branches/ubuntu/hoary/gimp/hoary

« back to all changes in this revision

Viewing changes to devel-docs/libgimpmath/html/libgimpmath-GimpMath.html

  • Committer: Bazaar Package Importer
  • Author(s): Sebastien Bacher
  • Date: 2005-04-04 14:51:23 UTC
  • Revision ID: james.westby@ubuntu.com-20050404145123-9py049eeelfymur8
Tags: upstream-2.2.2
Import upstream version 2.2.2

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
<html><head><meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"><title>GimpMath</title><meta name="generator" content="DocBook XSL Stylesheets V1.66.1"><link rel="start" href="index.html" title="GIMP Math Library Reference Manual"><link rel="up" href="libgimpmath.html" title="Part�I.�GIMP Math Library"><link rel="prev" href="libgimpmath.html" title="Part�I.�GIMP Math Library"><link rel="next" href="libgimpmath-GimpMatrix.html" title="GimpMatrix"><meta name="generator" content="GTK-Doc V1.2 (XML mode)"><style type="text/css">
 
2
        .synopsis, .classsynopsis {
 
3
            background: #eeeeee;
 
4
            border: solid 1px #aaaaaa;
 
5
            padding: 0.5em;
 
6
        }
 
7
        .programlisting {
 
8
            background: #eeeeff;
 
9
            border: solid 1px #aaaaff;
 
10
            padding: 0.5em;
 
11
        }
 
12
        .variablelist {
 
13
            padding: 4px;
 
14
            margin-left: 3em;
 
15
        }
 
16
        .navigation {
 
17
            background: #ffeeee;
 
18
            border: solid 1px #ffaaaa;
 
19
            margin-top: 0.5em;
 
20
            margin-bottom: 0.5em;
 
21
        }
 
22
        .navigation a {
 
23
            color: #770000;
 
24
        }
 
25
        .navigation a:visited {
 
26
            color: #550000;
 
27
        }
 
28
        .navigation .title {
 
29
            font-size: 200%;
 
30
        }
 
31
      </style></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><table class="navigation" width="100%" summary="Navigation header" cellpadding="2" cellspacing="2"><tr valign="middle"><td><a accesskey="p" href="libgimpmath.html"><img src="left.png" width="24" height="24" border="0" alt="Prev"></a></td><td><a accesskey="u" href="libgimpmath.html"><img src="up.png" width="24" height="24" border="0" alt="Up"></a></td><td><a accesskey="h" href="index.html"><img src="home.png" width="24" height="24" border="0" alt="Home"></a></td><th width="100%" align="center">GIMP Math Library Reference Manual</th><td><a accesskey="n" href="libgimpmath-GimpMatrix.html"><img src="right.png" width="24" height="24" border="0" alt="Next"></a></td></tr></table><div class="refentry" lang="en"><a name="libgimpmath-GimpMath"></a><div class="titlepage"></div><div class="refnamediv"><h2><span class="refentrytitle">GimpMath</span></h2><p>GimpMath &#8212; Mathematical definitions and macros.</p></div><div class="refsynopsisdiv"><h2>Synopsis</h2><pre class="synopsis">
 
32
 
 
33
 
 
34
 
 
35
#define     <a href="libgimpmath-GimpMath.html#RINT-CAPS">RINT</a>                            (x)
 
36
#define     <a href="libgimpmath-GimpMath.html#ROUND-CAPS">ROUND</a>                           (x)
 
37
#define     <a href="libgimpmath-GimpMath.html#SQR-CAPS">SQR</a>                             (x)
 
38
#define     <a href="libgimpmath-GimpMath.html#MAX255-CAPS">MAX255</a>                          (a)
 
39
#define     <a href="libgimpmath-GimpMath.html#CLAMP0255-CAPS">CLAMP0255</a>                       (a)
 
40
#define     <a href="libgimpmath-GimpMath.html#gimp-deg-to-rad">gimp_deg_to_rad</a>                 (angle)
 
41
#define     <a href="libgimpmath-GimpMath.html#gimp-rad-to-deg">gimp_rad_to_deg</a>                 (angle)
 
42
</pre></div><div class="refsect1" lang="en"><a name="id2468682"></a><h2>Description</h2><p>
 
43
Mathematical definitions and macros. These macros should be used
 
44
rather than the ones from math.h for enhanced portability.
 
45
</p></div><div class="refsect1" lang="en"><a name="id2468694"></a><h2>Details</h2><div class="refsect2" lang="en"><a name="id2468700"></a><h3><a name="RINT-CAPS"></a>RINT()</h3><a class="indexterm" name="id2468708"></a><pre class="programlisting">#define     RINT(x)</pre><p>
 
46
This macro rounds its argument <i class="parameter"><tt>x</tt></i> to an integer value in floating point
 
47
format.
 
48
</p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><span class="term"><i class="parameter"><tt>x</tt></i>�:</span></td><td>the value to be rounded.
 
49
 
 
50
 
 
51
</td></tr></tbody></table></div></div><hr><div class="refsect2" lang="en"><a name="id2468737"></a><h3><a name="ROUND-CAPS"></a>ROUND()</h3><a class="indexterm" name="id2468745"></a><pre class="programlisting">#define ROUND(x) ((int) ((x) + 0.5))
 
52
</pre><p>
 
53
This macro rounds its argument <i class="parameter"><tt>x</tt></i> to the nearest integer.
 
54
</p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><span class="term"><i class="parameter"><tt>x</tt></i>�:</span></td><td>the value to be rounded.
 
55
 
 
56
 
 
57
</td></tr></tbody></table></div></div><hr><div class="refsect2" lang="en"><a name="id2513484"></a><h3><a name="SQR-CAPS"></a>SQR()</h3><a class="indexterm" name="id2513492"></a><pre class="programlisting">#define SQR(x) ((x) * (x))
 
58
</pre><p>
 
59
This macro squares its argument <i class="parameter"><tt>x</tt></i>.
 
60
</p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><span class="term"><i class="parameter"><tt>x</tt></i>�:</span></td><td>the value to be squared.
 
61
 
 
62
 
 
63
</td></tr></tbody></table></div></div><hr><div class="refsect2" lang="en"><a name="id2513520"></a><h3><a name="MAX255-CAPS"></a>MAX255()</h3><a class="indexterm" name="id2513528"></a><pre class="programlisting">#define MAX255(a)  ((a) | (((a) &amp; 256) - (((a) &amp; 256) &gt;&gt; 8)))
 
64
</pre><p>
 
65
This macro limits it argument <i class="parameter"><tt>a</tt></i>, an (0-511) int, to 255.
 
66
</p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><span class="term"><i class="parameter"><tt>a</tt></i>�:</span></td><td>the value to be limited.
 
67
 
 
68
 
 
69
</td></tr></tbody></table></div></div><hr><div class="refsect2" lang="en"><a name="id2513557"></a><h3><a name="CLAMP0255-CAPS"></a>CLAMP0255()</h3><a class="indexterm" name="id2513565"></a><pre class="programlisting">#define CLAMP0255(a)  CLAMP(a,0,255)
 
70
</pre><p>
 
71
This macro clamps its argument <i class="parameter"><tt>a</tt></i>, an int32-range int, between 0 and
 
72
255 inclusive.
 
73
</p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><span class="term"><i class="parameter"><tt>a</tt></i>�:</span></td><td>the value to be clamped.
 
74
 
 
75
 
 
76
</td></tr></tbody></table></div></div><hr><div class="refsect2" lang="en"><a name="id2467250"></a><h3><a name="gimp-deg-to-rad"></a>gimp_deg_to_rad()</h3><a class="indexterm" name="id2467259"></a><pre class="programlisting">#define gimp_deg_to_rad(angle) ((angle) * (2.0 * G_PI) / 360.0)
 
77
</pre><p>
 
78
This macro converts its argument <i class="parameter"><tt>angle</tt></i> from degree to radian.
 
79
</p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><span class="term"><i class="parameter"><tt>angle</tt></i>�:</span></td><td>the angle to be converted.
 
80
 
 
81
 
 
82
</td></tr></tbody></table></div></div><hr><div class="refsect2" lang="en"><a name="id2467287"></a><h3><a name="gimp-rad-to-deg"></a>gimp_rad_to_deg()</h3><a class="indexterm" name="id2467296"></a><pre class="programlisting">#define gimp_rad_to_deg(angle) ((angle) * 360.0 / (2.0 * G_PI))
 
83
</pre><p>
 
84
This macro converts its argument <i class="parameter"><tt>angle</tt></i> from radian to degree.
 
85
</p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><span class="term"><i class="parameter"><tt>angle</tt></i>�:</span></td><td>the angle to be converted.
 
86
 
 
87
 
 
88
</td></tr></tbody></table></div></div></div></div><table class="navigation" width="100%" summary="Navigation footer" cellpadding="2" cellspacing="0"><tr valign="middle"><td align="left"><a accesskey="p" href="libgimpmath.html"><b>&lt;&lt;�Part�I.�GIMP Math Library</b></a></td><td align="right"><a accesskey="n" href="libgimpmath-GimpMatrix.html"><b>GimpMatrix�&gt;&gt;</b></a></td></tr></table></body></html>