36
31
<p>VipsInterpolate — various interpolators: nearest, bilinear, and
37
32
some non-linear</p>
39
<td valign="top" align="right"></td>
34
<td class="gallery_image" valign="top" align="right"></td>
40
35
</tr></table></div>
41
36
<div class="refsect1">
42
37
<a name="VipsInterpolate.stability-level"></a><h2>Stability Level</h2>
43
38
Stable, unless otherwise indicated
45
<div class="refsynopsisdiv">
46
<a name="VipsInterpolate.synopsis"></a><h2>Synopsis</h2>
47
<pre class="synopsis">
48
#include <vips/vips.h>
50
<a class="link" href="VipsInterpolate.html#VipsInterpolate-struct" title="VipsInterpolate">VipsInterpolate</a>;
51
<span class="returnvalue">void</span> (<a class="link" href="VipsInterpolate.html#VipsInterpolateMethod" title="VipsInterpolateMethod ()">*VipsInterpolateMethod</a>) (<em class="parameter"><code><a class="link" href="VipsInterpolate.html" title="VipsInterpolate"><span class="type">VipsInterpolate</span></a> *interpolate</code></em>,
52
<em class="parameter"><code><span class="type">void</span> *out</code></em>,
53
<em class="parameter"><code><a class="link" href="VipsRegion.html" title="VipsRegion"><span class="type">VipsRegion</span></a> *in</code></em>,
54
<em class="parameter"><code><span class="type">double</span> x</code></em>,
55
<em class="parameter"><code><span class="type">double</span> y</code></em>);
56
<a class="link" href="VipsInterpolate.html#VipsInterpolateClass" title="VipsInterpolateClass">VipsInterpolateClass</a>;
57
<span class="returnvalue">void</span> <a class="link" href="VipsInterpolate.html#vips-interpolate" title="vips_interpolate ()">vips_interpolate</a> (<em class="parameter"><code><a class="link" href="VipsInterpolate.html" title="VipsInterpolate"><span class="type">VipsInterpolate</span></a> *interpolate</code></em>,
58
<em class="parameter"><code><span class="type">void</span> *out</code></em>,
59
<em class="parameter"><code><a class="link" href="VipsRegion.html" title="VipsRegion"><span class="type">VipsRegion</span></a> *in</code></em>,
60
<em class="parameter"><code><span class="type">double</span> x</code></em>,
61
<em class="parameter"><code><span class="type">double</span> y</code></em>);
62
<a class="link" href="VipsInterpolate.html#VipsInterpolateMethod" title="VipsInterpolateMethod ()"><span class="returnvalue">VipsInterpolateMethod</span></a> <a class="link" href="VipsInterpolate.html#vips-interpolate-get-method" title="vips_interpolate_get_method ()">vips_interpolate_get_method</a> (<em class="parameter"><code><a class="link" href="VipsInterpolate.html" title="VipsInterpolate"><span class="type">VipsInterpolate</span></a> *interpolate</code></em>);
63
<span class="returnvalue">int</span> <a class="link" href="VipsInterpolate.html#vips-interpolate-get-window-size" title="vips_interpolate_get_window_size ()">vips_interpolate_get_window_size</a> (<em class="parameter"><code><a class="link" href="VipsInterpolate.html" title="VipsInterpolate"><span class="type">VipsInterpolate</span></a> *interpolate</code></em>);
64
<span class="returnvalue">int</span> <a class="link" href="VipsInterpolate.html#vips-interpolate-get-window-offset" title="vips_interpolate_get_window_offset ()">vips_interpolate_get_window_offset</a> (<em class="parameter"><code><a class="link" href="VipsInterpolate.html" title="VipsInterpolate"><span class="type">VipsInterpolate</span></a> *interpolate</code></em>);
65
#define <a class="link" href="VipsInterpolate.html#VIPS-TRANSFORM-SHIFT:CAPS" title="VIPS_TRANSFORM_SHIFT">VIPS_TRANSFORM_SHIFT</a>
66
#define <a class="link" href="VipsInterpolate.html#VIPS-TRANSFORM-SCALE:CAPS" title="VIPS_TRANSFORM_SCALE">VIPS_TRANSFORM_SCALE</a>
67
#define <a class="link" href="VipsInterpolate.html#VIPS-INTERPOLATE-SHIFT:CAPS" title="VIPS_INTERPOLATE_SHIFT">VIPS_INTERPOLATE_SHIFT</a>
68
#define <a class="link" href="VipsInterpolate.html#VIPS-INTERPOLATE-SCALE:CAPS" title="VIPS_INTERPOLATE_SCALE">VIPS_INTERPOLATE_SCALE</a>
69
<a class="link" href="VipsInterpolate.html" title="VipsInterpolate"><span class="returnvalue">VipsInterpolate</span></a> * <a class="link" href="VipsInterpolate.html#vips-interpolate-nearest-static" title="vips_interpolate_nearest_static ()">vips_interpolate_nearest_static</a> (<em class="parameter"><code><span class="type">void</span></code></em>);
70
<a class="link" href="VipsInterpolate.html" title="VipsInterpolate"><span class="returnvalue">VipsInterpolate</span></a> * <a class="link" href="VipsInterpolate.html#vips-interpolate-bilinear-static" title="vips_interpolate_bilinear_static ()">vips_interpolate_bilinear_static</a> (<em class="parameter"><code><span class="type">void</span></code></em>);
71
<a class="link" href="VipsInterpolate.html" title="VipsInterpolate"><span class="returnvalue">VipsInterpolate</span></a> * <a class="link" href="VipsInterpolate.html#vips-interpolate-new" title="vips_interpolate_new ()">vips_interpolate_new</a> (<em class="parameter"><code>const <span class="type">char</span> *nickname</code></em>);
40
<div class="refsect1">
41
<a name="VipsInterpolate.functions"></a><h2>Functions</h2>
42
<div class="informaltable"><table width="100%" border="0">
44
<col width="150px" class="functions_return">
45
<col class="functions_name">
49
<td class="function_type">
50
<span class="returnvalue">void</span>
52
<td class="function_name">
53
<span class="c_punctuation">(</span><a class="link" href="VipsInterpolate.html#VipsInterpolateMethod" title="VipsInterpolateMethod ()">*VipsInterpolateMethod</a><span class="c_punctuation">)</span> <span class="c_punctuation">()</span>
57
<td class="function_type">
58
<span class="returnvalue">void</span>
60
<td class="function_name">
61
<a class="link" href="VipsInterpolate.html#vips-interpolate" title="vips_interpolate ()">vips_interpolate</a> <span class="c_punctuation">()</span>
65
<td class="function_type">
66
<a class="link" href="VipsInterpolate.html#VipsInterpolateMethod" title="VipsInterpolateMethod ()"><span class="returnvalue">VipsInterpolateMethod</span></a>
68
<td class="function_name">
69
<a class="link" href="VipsInterpolate.html#vips-interpolate-get-method" title="vips_interpolate_get_method ()">vips_interpolate_get_method</a> <span class="c_punctuation">()</span>
73
<td class="function_type">
74
<span class="returnvalue">int</span>
76
<td class="function_name">
77
<a class="link" href="VipsInterpolate.html#vips-interpolate-get-window-size" title="vips_interpolate_get_window_size ()">vips_interpolate_get_window_size</a> <span class="c_punctuation">()</span>
81
<td class="function_type">
82
<span class="returnvalue">int</span>
84
<td class="function_name">
85
<a class="link" href="VipsInterpolate.html#vips-interpolate-get-window-offset" title="vips_interpolate_get_window_offset ()">vips_interpolate_get_window_offset</a> <span class="c_punctuation">()</span>
89
<td class="define_keyword">#define</td>
90
<td class="function_name"><a class="link" href="VipsInterpolate.html#VIPS-TRANSFORM-SHIFT:CAPS" title="VIPS_TRANSFORM_SHIFT">VIPS_TRANSFORM_SHIFT</a></td>
93
<td class="define_keyword">#define</td>
94
<td class="function_name"><a class="link" href="VipsInterpolate.html#VIPS-TRANSFORM-SCALE:CAPS" title="VIPS_TRANSFORM_SCALE">VIPS_TRANSFORM_SCALE</a></td>
97
<td class="define_keyword">#define</td>
98
<td class="function_name"><a class="link" href="VipsInterpolate.html#VIPS-INTERPOLATE-SHIFT:CAPS" title="VIPS_INTERPOLATE_SHIFT">VIPS_INTERPOLATE_SHIFT</a></td>
101
<td class="define_keyword">#define</td>
102
<td class="function_name"><a class="link" href="VipsInterpolate.html#VIPS-INTERPOLATE-SCALE:CAPS" title="VIPS_INTERPOLATE_SCALE">VIPS_INTERPOLATE_SCALE</a></td>
105
<td class="function_type">
106
<a class="link" href="VipsInterpolate.html" title="VipsInterpolate"><span class="returnvalue">VipsInterpolate</span></a> *
108
<td class="function_name">
109
<a class="link" href="VipsInterpolate.html#vips-interpolate-nearest-static" title="vips_interpolate_nearest_static ()">vips_interpolate_nearest_static</a> <span class="c_punctuation">()</span>
113
<td class="function_type">
114
<a class="link" href="VipsInterpolate.html" title="VipsInterpolate"><span class="returnvalue">VipsInterpolate</span></a> *
116
<td class="function_name">
117
<a class="link" href="VipsInterpolate.html#vips-interpolate-bilinear-static" title="vips_interpolate_bilinear_static ()">vips_interpolate_bilinear_static</a> <span class="c_punctuation">()</span>
121
<td class="function_type">
122
<a class="link" href="VipsInterpolate.html" title="VipsInterpolate"><span class="returnvalue">VipsInterpolate</span></a> *
124
<td class="function_name">
125
<a class="link" href="VipsInterpolate.html#vips-interpolate-new" title="vips_interpolate_new ()">vips_interpolate_new</a> <span class="c_punctuation">()</span>
74
131
<div class="refsect1">
75
132
<a name="VipsInterpolate.object-hierarchy"></a><h2>Object Hierarchy</h2>
76
<pre class="synopsis">
78
+----<a class="link" href="libvips-VipsArgument.html#VipsObject">VipsObject</a>
133
<pre class="screen"> <a href="http://library.gnome.org/devel/gobject/unstable/gobject-The-Base-Object-Type.html#GObject">GObject</a>
134
<span class="lineart">╰──</span> <a class="link" href="VipsObject.html" title="VipsObject">VipsObject</a>
135
<span class="lineart">╰──</span> VipsInterpolate
138
<div class="refsect1">
139
<a name="VipsInterpolate.includes"></a><h2>Includes</h2>
140
<pre class="synopsis">#include <vips/vips.h>
82
143
<div class="refsect1">
83
144
<a name="VipsInterpolate.description"></a><h2>Description</h2>
85
A number of image interpolators.
145
<p>A number of image interpolators.</p>
88
147
<div class="refsect1">
89
<a name="VipsInterpolate.details"></a><h2>Details</h2>
90
<div class="refsect2">
91
<a name="VipsInterpolate-struct"></a><h3>VipsInterpolate</h3>
92
<pre class="programlisting">typedef struct _VipsInterpolate VipsInterpolate;</pre>
97
<div class="refsect2">
98
<a name="VipsInterpolateMethod"></a><h3>VipsInterpolateMethod ()</h3>
99
<pre class="programlisting"><span class="returnvalue">void</span> (*VipsInterpolateMethod) (<em class="parameter"><code><a class="link" href="VipsInterpolate.html" title="VipsInterpolate"><span class="type">VipsInterpolate</span></a> *interpolate</code></em>,
100
<em class="parameter"><code><span class="type">void</span> *out</code></em>,
101
<em class="parameter"><code><a class="link" href="VipsRegion.html" title="VipsRegion"><span class="type">VipsRegion</span></a> *in</code></em>,
102
<em class="parameter"><code><span class="type">double</span> x</code></em>,
103
<em class="parameter"><code><span class="type">double</span> y</code></em>);</pre>
105
An interpolation function. It should read source pixels from <em class="parameter"><code>in</code></em> with
148
<a name="VipsInterpolate.functions_details"></a><h2>Functions</h2>
149
<div class="refsect2">
150
<a name="VipsInterpolateMethod"></a><h3>VipsInterpolateMethod ()</h3>
151
<pre class="programlisting"><span class="returnvalue">void</span>
152
<span class="c_punctuation">(</span>*VipsInterpolateMethod<span class="c_punctuation">)</span> (<em class="parameter"><code><a class="link" href="VipsInterpolate.html" title="VipsInterpolate"><span class="type">VipsInterpolate</span></a> *interpolate</code></em>,
153
<em class="parameter"><code><span class="type">void</span> *out</code></em>,
154
<em class="parameter"><code><a class="link" href="VipsRegion.html" title="VipsRegion"><span class="type">VipsRegion</span></a> *in</code></em>,
155
<em class="parameter"><code><span class="type">double</span> x</code></em>,
156
<em class="parameter"><code><span class="type">double</span> y</code></em>);</pre>
157
<p>An interpolation function. It should read source pixels from <em class="parameter"><code>in</code></em>
106
159
<a class="link" href="VipsRegion.html#VIPS-REGION-ADDR:CAPS" title="VIPS_REGION_ADDR()"><code class="function">VIPS_REGION_ADDR()</code></a>, it can look left and up from (x, y) by <em class="parameter"><code>window_offset</code></em>
107
pixels and it can access pixels in a window of size <em class="parameter"><code>window_size</code></em>.
110
The interpolated value should be written to the pixel pointed to by <em class="parameter"><code>out</code></em>.
113
See also: <a class="link" href="VipsInterpolate.html#VipsInterpolateClass" title="VipsInterpolateClass"><span class="type">VipsInterpolateClass</span></a>.
115
<div class="variablelist"><table border="0" class="variablelist">
117
<col align="left" valign="top">
122
<td><p><span class="term"><em class="parameter"><code>interpolate</code></em> :</span></p></td>
123
<td>the interpolator</td>
126
<td><p><span class="term"><em class="parameter"><code>out</code></em> :</span></p></td>
127
<td>write the interpolated pixel here</td>
130
<td><p><span class="term"><em class="parameter"><code>in</code></em> :</span></p></td>
131
<td>read source pixels from here</td>
134
<td><p><span class="term"><em class="parameter"><code>x</code></em> :</span></p></td>
135
<td>interpolate value at this position</td>
138
<td><p><span class="term"><em class="parameter"><code>y</code></em> :</span></p></td>
139
<td>interpolate value at this position</td>
145
<div class="refsect2">
146
<a name="VipsInterpolateClass"></a><h3>VipsInterpolateClass</h3>
147
<pre class="programlisting">typedef struct {
148
VipsObjectClass parent_class;
150
/* Write to pixel out(x,y), interpolating from in(x,y). The caller has
151
* to set the regions up.
153
VipsInterpolateMethod interpolate;
155
/* This interpolator needs a window this many pixels across and down.
157
int (*get_window_size)( VipsInterpolate * );
159
/* Or just set this if you want a constant.
163
/* Stencils are offset by this much. Default to window_size / 2 - 1
164
* (centering) if get_window_offset is NULL and window_offset is -1.
166
int (*get_window_offset)( VipsInterpolate * );
168
} VipsInterpolateClass;
171
The abstract base class for the various VIPS interpolation functions.
172
Use "vips --list classes" to see all the interpolators available.
175
An interpolator consists of a function to perform the interpolation, plus
176
some extra data fields which tell vips how to call the function and what
180
<em class="parameter"><code>window_size</code></em> is the size of the window that the interpolator needs. For
181
example, a bicubic interpolator needs to see a window of 4x4 pixels to be
182
able to interpolate a value.
185
You can either have a function in <em class="parameter"><code>get_window_size</code></em> which returns the window
186
that a specific interpolator needs, or you can leave <em class="parameter"><code>get_window_size</code></em> <code class="literal">NULL</code>
187
and set a constant value in <em class="parameter"><code>window_size</code></em>.
190
<em class="parameter"><code>window_offset</code></em> is how much to offset the window up and left of (x, y). For
191
example, a bicubic interpolator will want a <em class="parameter"><code>window_offset</code></em> of 1.
194
You can either have a function in <em class="parameter"><code>get_window_offset</code></em> which returns the
195
offset that a specific interpolator needs, or you can leave
196
<em class="parameter"><code>get_window_offset</code></em> <code class="literal">NULL</code> and set a constant value in <em class="parameter"><code>window_offset</code></em>.
199
You also need to set <em class="parameter"><code>nickname</code></em> and <em class="parameter"><code>description</code></em> in <a class="link" href="libvips-VipsArgument.html#VipsObject"><span class="type">VipsObject</span></a>.
202
See also: <a class="link" href="VipsInterpolate.html#VipsInterpolateMethod" title="VipsInterpolateMethod ()"><span class="type">VipsInterpolateMethod</span></a>, <a class="link" href="libvips-VipsArgument.html#VipsObject"><span class="type">VipsObject</span></a>,
203
<a class="link" href="VipsInterpolate.html#vips-interpolate-bilinear-static" title="vips_interpolate_bilinear_static ()"><code class="function">vips_interpolate_bilinear_static()</code></a>.
205
<div class="variablelist"><table border="0" class="variablelist">
207
<col align="left" valign="top">
212
<td><p><span class="term"><a class="link" href="libvips-VipsArgument.html#VipsObjectClass" title="struct VipsObjectClass"><span class="type">VipsObjectClass</span></a> <em class="structfield"><code><a name="VipsInterpolateClass.parent-class"></a>parent_class</code></em>;</span></p></td>
216
<td><p><span class="term"><a class="link" href="VipsInterpolate.html#VipsInterpolateMethod" title="VipsInterpolateMethod ()"><span class="type">VipsInterpolateMethod</span></a> <em class="structfield"><code><a name="VipsInterpolateClass.interpolate"></a>interpolate</code></em>;</span></p></td>
217
<td>the interpolation method</td>
220
<td><p><span class="term"><em class="structfield"><code><a name="VipsInterpolateClass.get-window-size"></a>get_window_size</code></em> ()</span></p></td>
221
<td>return the size of the window needed by this method</td>
224
<td><p><span class="term"><span class="type">int</span> <em class="structfield"><code><a name="VipsInterpolateClass.window-size"></a>window_size</code></em>;</span></p></td>
225
<td>or just set this for a constant window size</td>
228
<td><p><span class="term"><em class="structfield"><code><a name="VipsInterpolateClass.get-window-offset"></a>get_window_offset</code></em> ()</span></p></td>
229
<td>return the window offset for this method</td>
232
<td><p><span class="term"><span class="type">int</span> <em class="structfield"><code><a name="VipsInterpolateClass.window-offset"></a>window_offset</code></em>;</span></p></td>
233
<td>or just set this for a constant window offset</td>
239
<div class="refsect2">
240
<a name="vips-interpolate"></a><h3>vips_interpolate ()</h3>
241
<pre class="programlisting"><span class="returnvalue">void</span> vips_interpolate (<em class="parameter"><code><a class="link" href="VipsInterpolate.html" title="VipsInterpolate"><span class="type">VipsInterpolate</span></a> *interpolate</code></em>,
242
<em class="parameter"><code><span class="type">void</span> *out</code></em>,
243
<em class="parameter"><code><a class="link" href="VipsRegion.html" title="VipsRegion"><span class="type">VipsRegion</span></a> *in</code></em>,
244
<em class="parameter"><code><span class="type">double</span> x</code></em>,
245
<em class="parameter"><code><span class="type">double</span> y</code></em>);</pre>
247
Look up the <em class="parameter"><code>interpolate</code></em> method in the class and call it. Use
248
<a class="link" href="VipsInterpolate.html#vips-interpolate-get-method" title="vips_interpolate_get_method ()"><code class="function">vips_interpolate_get_method()</code></a> to get a direct pointer to the function and
249
avoid the lookup overhead.
252
You need to set <em class="parameter"><code>in</code></em> and <em class="parameter"><code>out</code></em> up correctly.
254
<div class="variablelist"><table border="0" class="variablelist">
256
<col align="left" valign="top">
261
<td><p><span class="term"><em class="parameter"><code>interpolate</code></em> :</span></p></td>
262
<td>interpolator to use</td>
265
<td><p><span class="term"><em class="parameter"><code>out</code></em> :</span></p></td>
266
<td>write result here</td>
269
<td><p><span class="term"><em class="parameter"><code>in</code></em> :</span></p></td>
270
<td>read source data from here</td>
273
<td><p><span class="term"><em class="parameter"><code>x</code></em> :</span></p></td>
274
<td>interpolate value at this position</td>
277
<td><p><span class="term"><em class="parameter"><code>y</code></em> :</span></p></td>
278
<td>interpolate value at this position</td>
284
<div class="refsect2">
285
<a name="vips-interpolate-get-method"></a><h3>vips_interpolate_get_method ()</h3>
286
<pre class="programlisting"><a class="link" href="VipsInterpolate.html#VipsInterpolateMethod" title="VipsInterpolateMethod ()"><span class="returnvalue">VipsInterpolateMethod</span></a> vips_interpolate_get_method (<em class="parameter"><code><a class="link" href="VipsInterpolate.html" title="VipsInterpolate"><span class="type">VipsInterpolate</span></a> *interpolate</code></em>);</pre>
288
Look up the <em class="parameter"><code>interpolate</code></em> method in the class and return it. Use this
289
instead of <a class="link" href="VipsInterpolate.html#vips-interpolate" title="vips_interpolate ()"><code class="function">vips_interpolate()</code></a> to cache method dispatch.
291
<div class="variablelist"><table border="0" class="variablelist">
293
<col align="left" valign="top">
298
<td><p><span class="term"><em class="parameter"><code>interpolate</code></em> :</span></p></td>
299
<td>interpolator to use</td>
302
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
303
<td>a pointer to the interpolation function</td>
309
<div class="refsect2">
310
<a name="vips-interpolate-get-window-size"></a><h3>vips_interpolate_get_window_size ()</h3>
311
<pre class="programlisting"><span class="returnvalue">int</span> vips_interpolate_get_window_size (<em class="parameter"><code><a class="link" href="VipsInterpolate.html" title="VipsInterpolate"><span class="type">VipsInterpolate</span></a> *interpolate</code></em>);</pre>
313
Look up an interpolators desired window size.
315
<div class="variablelist"><table border="0" class="variablelist">
317
<col align="left" valign="top">
322
<td><p><span class="term"><em class="parameter"><code>interpolate</code></em> :</span></p></td>
323
<td>interpolator to use</td>
326
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
327
<td>the interpolators required window size</td>
333
<div class="refsect2">
334
<a name="vips-interpolate-get-window-offset"></a><h3>vips_interpolate_get_window_offset ()</h3>
335
<pre class="programlisting"><span class="returnvalue">int</span> vips_interpolate_get_window_offset (<em class="parameter"><code><a class="link" href="VipsInterpolate.html" title="VipsInterpolate"><span class="type">VipsInterpolate</span></a> *interpolate</code></em>);</pre>
337
Look up an interpolators desired window offset.
339
<div class="variablelist"><table border="0" class="variablelist">
341
<col align="left" valign="top">
346
<td><p><span class="term"><em class="parameter"><code>interpolate</code></em> :</span></p></td>
347
<td>interpolator to use</td>
350
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
351
<td>the interpolators required window offset</td>
161
pixels and it can access pixels in a window of size <em class="parameter"><code>window_size</code></em>
163
<p>The interpolated value should be written to the pixel pointed to by <em class="parameter"><code>out</code></em>
165
<p>See also: <span class="type">VipsInterpolateClass</span>.</p>
166
<div class="refsect3">
167
<a name="id-1.3.10.8.2.7"></a><h4>Parameters</h4>
168
<div class="informaltable"><table width="100%" border="0">
170
<col width="150px" class="parameters_name">
171
<col class="parameters_description">
172
<col width="200px" class="parameters_annotations">
176
<td class="parameter_name"><p>interpolate</p></td>
177
<td class="parameter_description"><p>the interpolator</p></td>
178
<td class="parameter_annotations"> </td>
181
<td class="parameter_name"><p>out</p></td>
182
<td class="parameter_description"><p>write the interpolated pixel here</p></td>
183
<td class="parameter_annotations"> </td>
186
<td class="parameter_name"><p>in</p></td>
187
<td class="parameter_description"><p>read source pixels from here</p></td>
188
<td class="parameter_annotations"> </td>
191
<td class="parameter_name"><p>x</p></td>
192
<td class="parameter_description"><p>interpolate value at this position</p></td>
193
<td class="parameter_annotations"> </td>
196
<td class="parameter_name"><p>y</p></td>
197
<td class="parameter_description"><p>interpolate value at this position</p></td>
198
<td class="parameter_annotations"> </td>
205
<div class="refsect2">
206
<a name="vips-interpolate"></a><h3>vips_interpolate ()</h3>
207
<pre class="programlisting"><span class="returnvalue">void</span>
208
vips_interpolate (<em class="parameter"><code><a class="link" href="VipsInterpolate.html" title="VipsInterpolate"><span class="type">VipsInterpolate</span></a> *interpolate</code></em>,
209
<em class="parameter"><code><span class="type">void</span> *out</code></em>,
210
<em class="parameter"><code><a class="link" href="VipsRegion.html" title="VipsRegion"><span class="type">VipsRegion</span></a> *in</code></em>,
211
<em class="parameter"><code><span class="type">double</span> x</code></em>,
212
<em class="parameter"><code><span class="type">double</span> y</code></em>);</pre>
213
<p>Look up the <em class="parameter"><code>interpolate</code></em>
214
method in the class and call it. Use
215
<a class="link" href="VipsInterpolate.html#vips-interpolate-get-method" title="vips_interpolate_get_method ()"><code class="function">vips_interpolate_get_method()</code></a> to get a direct pointer to the function and
216
avoid the lookup overhead.</p>
217
<p>You need to set <em class="parameter"><code>in</code></em>
218
and <em class="parameter"><code>out</code></em>
220
<div class="refsect3">
221
<a name="id-1.3.10.8.3.6"></a><h4>Parameters</h4>
222
<div class="informaltable"><table width="100%" border="0">
224
<col width="150px" class="parameters_name">
225
<col class="parameters_description">
226
<col width="200px" class="parameters_annotations">
230
<td class="parameter_name"><p>interpolate</p></td>
231
<td class="parameter_description"><p>interpolator to use</p></td>
232
<td class="parameter_annotations"> </td>
235
<td class="parameter_name"><p>out</p></td>
236
<td class="parameter_description"><p>write result here</p></td>
237
<td class="parameter_annotations"> </td>
240
<td class="parameter_name"><p>in</p></td>
241
<td class="parameter_description"><p>read source data from here</p></td>
242
<td class="parameter_annotations"> </td>
245
<td class="parameter_name"><p>x</p></td>
246
<td class="parameter_description"><p>interpolate value at this position</p></td>
247
<td class="parameter_annotations"> </td>
250
<td class="parameter_name"><p>y</p></td>
251
<td class="parameter_description"><p>interpolate value at this position</p></td>
252
<td class="parameter_annotations"> </td>
259
<div class="refsect2">
260
<a name="vips-interpolate-get-method"></a><h3>vips_interpolate_get_method ()</h3>
261
<pre class="programlisting"><a class="link" href="VipsInterpolate.html#VipsInterpolateMethod" title="VipsInterpolateMethod ()"><span class="returnvalue">VipsInterpolateMethod</span></a>
262
vips_interpolate_get_method (<em class="parameter"><code><a class="link" href="VipsInterpolate.html" title="VipsInterpolate"><span class="type">VipsInterpolate</span></a> *interpolate</code></em>);</pre>
263
<p>Look up the <em class="parameter"><code>interpolate</code></em>
264
method in the class and return it. Use this
265
instead of <a class="link" href="VipsInterpolate.html#vips-interpolate" title="vips_interpolate ()"><code class="function">vips_interpolate()</code></a> to cache method dispatch.</p>
266
<div class="refsect3">
267
<a name="id-1.3.10.8.4.5"></a><h4>Parameters</h4>
268
<div class="informaltable"><table width="100%" border="0">
270
<col width="150px" class="parameters_name">
271
<col class="parameters_description">
272
<col width="200px" class="parameters_annotations">
275
<td class="parameter_name"><p>interpolate</p></td>
276
<td class="parameter_description"><p>interpolator to use</p></td>
277
<td class="parameter_annotations"> </td>
281
<div class="refsect3">
282
<a name="id-1.3.10.8.4.6"></a><h4>Returns</h4>
283
<p> a pointer to the interpolation function</p>
288
<div class="refsect2">
289
<a name="vips-interpolate-get-window-size"></a><h3>vips_interpolate_get_window_size ()</h3>
290
<pre class="programlisting"><span class="returnvalue">int</span>
291
vips_interpolate_get_window_size (<em class="parameter"><code><a class="link" href="VipsInterpolate.html" title="VipsInterpolate"><span class="type">VipsInterpolate</span></a> *interpolate</code></em>);</pre>
292
<p>Look up an interpolators desired window size.</p>
293
<div class="refsect3">
294
<a name="id-1.3.10.8.5.5"></a><h4>Parameters</h4>
295
<div class="informaltable"><table width="100%" border="0">
297
<col width="150px" class="parameters_name">
298
<col class="parameters_description">
299
<col width="200px" class="parameters_annotations">
302
<td class="parameter_name"><p>interpolate</p></td>
303
<td class="parameter_description"><p>interpolator to use</p></td>
304
<td class="parameter_annotations"> </td>
308
<div class="refsect3">
309
<a name="id-1.3.10.8.5.6"></a><h4>Returns</h4>
310
<p> the interpolators required window size</p>
315
<div class="refsect2">
316
<a name="vips-interpolate-get-window-offset"></a><h3>vips_interpolate_get_window_offset ()</h3>
317
<pre class="programlisting"><span class="returnvalue">int</span>
318
vips_interpolate_get_window_offset (<em class="parameter"><code><a class="link" href="VipsInterpolate.html" title="VipsInterpolate"><span class="type">VipsInterpolate</span></a> *interpolate</code></em>);</pre>
319
<p>Look up an interpolators desired window offset.</p>
320
<div class="refsect3">
321
<a name="id-1.3.10.8.6.5"></a><h4>Parameters</h4>
322
<div class="informaltable"><table width="100%" border="0">
324
<col width="150px" class="parameters_name">
325
<col class="parameters_description">
326
<col width="200px" class="parameters_annotations">
329
<td class="parameter_name"><p>interpolate</p></td>
330
<td class="parameter_description"><p>interpolator to use</p></td>
331
<td class="parameter_annotations"> </td>
335
<div class="refsect3">
336
<a name="id-1.3.10.8.6.6"></a><h4>Returns</h4>
337
<p> the interpolators required window offset</p>
357
342
<div class="refsect2">
358
343
<a name="VIPS-TRANSFORM-SHIFT:CAPS"></a><h3>VIPS_TRANSFORM_SHIFT</h3>
359
344
<pre class="programlisting">#define VIPS_TRANSFORM_SHIFT (6)
362
Many of the vips interpolators use fixed-point arithmetic for coordinate
363
calculation. This is how many bits of precision they use.
346
<p>Many of the vips interpolators use fixed-point arithmetic for coordinate
347
calculation. This is how many bits of precision they use.</p>
367
350
<div class="refsect2">
368
351
<a name="VIPS-TRANSFORM-SCALE:CAPS"></a><h3>VIPS_TRANSFORM_SCALE</h3>
369
352
<pre class="programlisting">#define VIPS_TRANSFORM_SCALE (1 << VIPS_TRANSFORM_SHIFT)
372
<a class="link" href="VipsInterpolate.html#VIPS-TRANSFORM-SHIFT:CAPS" title="VIPS_TRANSFORM_SHIFT"><span class="type">VIPS_TRANSFORM_SHIFT</span></a> as a multiplicative constant.
354
<p><a class="link" href="VipsInterpolate.html#VIPS-TRANSFORM-SHIFT:CAPS" title="VIPS_TRANSFORM_SHIFT"><span class="type">VIPS_TRANSFORM_SHIFT</span></a> as a multiplicative constant.</p>
376
357
<div class="refsect2">
377
358
<a name="VIPS-INTERPOLATE-SHIFT:CAPS"></a><h3>VIPS_INTERPOLATE_SHIFT</h3>
378
359
<pre class="programlisting">#define VIPS_INTERPOLATE_SHIFT (12)
381
Many of the vips interpolators use fixed-point arithmetic for value
382
calcualtion. This is how many bits of precision they use.
361
<p>Many of the vips interpolators use fixed-point arithmetic for value
362
calcualtion. This is how many bits of precision they use.</p>
386
365
<div class="refsect2">
387
366
<a name="VIPS-INTERPOLATE-SCALE:CAPS"></a><h3>VIPS_INTERPOLATE_SCALE</h3>
388
367
<pre class="programlisting">#define VIPS_INTERPOLATE_SCALE (1 << VIPS_INTERPOLATE_SHIFT)
391
<a class="link" href="VipsInterpolate.html#VIPS-INTERPOLATE-SHIFT:CAPS" title="VIPS_INTERPOLATE_SHIFT"><span class="type">VIPS_INTERPOLATE_SHIFT</span></a> as a multiplicative constant.
395
<div class="refsect2">
396
<a name="vips-interpolate-nearest-static"></a><h3>vips_interpolate_nearest_static ()</h3>
397
<pre class="programlisting"><a class="link" href="VipsInterpolate.html" title="VipsInterpolate"><span class="returnvalue">VipsInterpolate</span></a> * vips_interpolate_nearest_static (<em class="parameter"><code><span class="type">void</span></code></em>);</pre>
399
A convenience function that returns a nearest-neighbour interpolator you
402
<div class="variablelist"><table border="0" class="variablelist">
404
<col align="left" valign="top">
408
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
409
<td>a nearest-neighbour interpolator. <span class="annotation">[<acronym title="Don't free data after the code is done."><span class="acronym">transfer none</span></acronym>]</span>
415
<div class="refsect2">
416
<a name="vips-interpolate-bilinear-static"></a><h3>vips_interpolate_bilinear_static ()</h3>
417
<pre class="programlisting"><a class="link" href="VipsInterpolate.html" title="VipsInterpolate"><span class="returnvalue">VipsInterpolate</span></a> * vips_interpolate_bilinear_static (<em class="parameter"><code><span class="type">void</span></code></em>);</pre>
419
A convenience function that returns a bilinear interpolator you
422
<div class="variablelist"><table border="0" class="variablelist">
424
<col align="left" valign="top">
428
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
429
<td>a bilinear interpolator. <span class="annotation">[<acronym title="Don't free data after the code is done."><span class="acronym">transfer none</span></acronym>]</span>
435
<div class="refsect2">
436
<a name="vips-interpolate-new"></a><h3>vips_interpolate_new ()</h3>
437
<pre class="programlisting"><a class="link" href="VipsInterpolate.html" title="VipsInterpolate"><span class="returnvalue">VipsInterpolate</span></a> * vips_interpolate_new (<em class="parameter"><code>const <span class="type">char</span> *nickname</code></em>);</pre>
439
Look up an interpolator from a nickname and make one. You need to free the
440
result with <code class="function">g_object_unref()</code> when you're done with it.
443
See also: <a class="link" href="libvips-VipsArgument.html#vips-type-find" title="vips_type_find ()"><code class="function">vips_type_find()</code></a>.
445
<div class="variablelist"><table border="0" class="variablelist">
447
<col align="left" valign="top">
452
<td><p><span class="term"><em class="parameter"><code>nickname</code></em> :</span></p></td>
453
<td>nickname for interpolator</td>
456
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
457
<td>an interpolator, or <code class="literal">NULL</code> on error.</td>
369
<p><a class="link" href="VipsInterpolate.html#VIPS-INTERPOLATE-SHIFT:CAPS" title="VIPS_INTERPOLATE_SHIFT"><span class="type">VIPS_INTERPOLATE_SHIFT</span></a> as a multiplicative constant.</p>
372
<div class="refsect2">
373
<a name="vips-interpolate-nearest-static"></a><h3>vips_interpolate_nearest_static ()</h3>
374
<pre class="programlisting"><a class="link" href="VipsInterpolate.html" title="VipsInterpolate"><span class="returnvalue">VipsInterpolate</span></a> *
375
vips_interpolate_nearest_static (<em class="parameter"><code><span class="type">void</span></code></em>);</pre>
376
<p>A convenience function that returns a nearest-neighbour interpolator you
377
don't need to free.</p>
378
<div class="refsect3">
379
<a name="id-1.3.10.8.11.5"></a><h4>Returns</h4>
380
<p> a nearest-neighbour interpolator. </p>
381
<p><span class="annotation">[<acronym title="Don't free data after the code is done."><span class="acronym">transfer none</span></acronym>]</span></p>
385
<div class="refsect2">
386
<a name="vips-interpolate-bilinear-static"></a><h3>vips_interpolate_bilinear_static ()</h3>
387
<pre class="programlisting"><a class="link" href="VipsInterpolate.html" title="VipsInterpolate"><span class="returnvalue">VipsInterpolate</span></a> *
388
vips_interpolate_bilinear_static (<em class="parameter"><code><span class="type">void</span></code></em>);</pre>
389
<p>A convenience function that returns a bilinear interpolator you
390
don't need to free.</p>
391
<div class="refsect3">
392
<a name="id-1.3.10.8.12.5"></a><h4>Returns</h4>
393
<p> a bilinear interpolator. </p>
394
<p><span class="annotation">[<acronym title="Don't free data after the code is done."><span class="acronym">transfer none</span></acronym>]</span></p>
398
<div class="refsect2">
399
<a name="vips-interpolate-new"></a><h3>vips_interpolate_new ()</h3>
400
<pre class="programlisting"><a class="link" href="VipsInterpolate.html" title="VipsInterpolate"><span class="returnvalue">VipsInterpolate</span></a> *
401
vips_interpolate_new (<em class="parameter"><code>const <span class="type">char</span> *nickname</code></em>);</pre>
402
<p>Look up an interpolator from a nickname and make one. You need to free the
403
result with <a href="http://library.gnome.org/devel/gobject/unstable/gobject-The-Base-Object-Type.html#g-object-unref"><code class="function">g_object_unref()</code></a> when you're done with it.</p>
404
<p>See also: <a class="link" href="VipsObject.html#vips-type-find" title="vips_type_find ()"><code class="function">vips_type_find()</code></a>.</p>
405
<div class="refsect3">
406
<a name="id-1.3.10.8.13.6"></a><h4>Parameters</h4>
407
<div class="informaltable"><table width="100%" border="0">
409
<col width="150px" class="parameters_name">
410
<col class="parameters_description">
411
<col width="200px" class="parameters_annotations">
414
<td class="parameter_name"><p>nickname</p></td>
415
<td class="parameter_description"><p>nickname for interpolator</p></td>
416
<td class="parameter_annotations"> </td>
420
<div class="refsect3">
421
<a name="id-1.3.10.8.13.7"></a><h4>Returns</h4>
422
<p> an interpolator, or <a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a> on error.</p>
427
<div class="refsect1">
428
<a name="VipsInterpolate.other_details"></a><h2>Types and Values</h2>
464
431
<div class="footer">
466
Generated by GTK-Doc V1.19</div>
433
Generated by GTK-Doc V1.20</div>
b'\\ No newline at end of file'