/usr/share/gtk-doc/html/libvips/libvips-convolution.html is in libvips-doc 8.4.5-1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 955 956 957 958 959 960 961 962 963 964 965 966 967 968 969 970 971 972 973 974 975 976 977 978 979 980 981 982 983 984 985 986 987 988 989 990 991 992 993 994 995 996 997 998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 | <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>convolution: VIPS Reference Manual</title>
<meta name="generator" content="DocBook XSL Stylesheets V1.79.1">
<link rel="home" href="index.html" title="VIPS Reference Manual">
<link rel="up" href="ch03.html" title="VIPS operation API by section">
<link rel="prev" href="libvips-conversion.html" title="conversion">
<link rel="next" href="VipsForeignSave.html" title="VipsForeignSave">
<meta name="generator" content="GTK-Doc V1.25 (XML mode)">
<link rel="stylesheet" href="style.css" type="text/css">
</head>
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
<table class="navigation" id="top" width="100%" summary="Navigation header" cellpadding="2" cellspacing="5"><tr valign="middle">
<td width="100%" align="left" class="shortcuts">
<a href="#" class="shortcut">Top</a><span id="nav_description"> <span class="dim">|</span>
<a href="#libvips-convolution.description" class="shortcut">Description</a></span>
</td>
<td><a accesskey="h" href="index.html"><img src="home.png" width="16" height="16" border="0" alt="Home"></a></td>
<td><a accesskey="u" href="ch03.html"><img src="up.png" width="16" height="16" border="0" alt="Up"></a></td>
<td><a accesskey="p" href="libvips-conversion.html"><img src="left.png" width="16" height="16" border="0" alt="Prev"></a></td>
<td><a accesskey="n" href="VipsForeignSave.html"><img src="right.png" width="16" height="16" border="0" alt="Next"></a></td>
</tr></table>
<div class="refentry">
<a name="libvips-convolution"></a><div class="titlepage"></div>
<div class="refnamediv"><table width="100%"><tr>
<td valign="top">
<h2><span class="refentrytitle"><a name="libvips-convolution.top_of_page"></a>convolution</span></h2>
<p>convolution — convolve and correlate images</p>
</td>
<td class="gallery_image" valign="top" align="right"></td>
</tr></table></div>
<div class="refsect1">
<a name="libvips-convolution.stability-level"></a><h2>Stability Level</h2>
<acronym title="The intention of a Stable interface is to enable arbitrary third parties to
develop applications to these interfaces, release them, and have confidence that
they will run on all minor releases of the product (after the one in which the
interface was introduced, and within the same major release). Even at a major
release, incompatible changes are expected to be rare, and to have strong
justifications.
"><span class="acronym">Stable</span></acronym>, unless otherwise indicated
</div>
<div class="refsect1">
<a name="libvips-convolution.functions"></a><h2>Functions</h2>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="functions_return">
<col class="functions_name">
</colgroup>
<tbody>
<tr>
<td class="function_type">
<span class="returnvalue">int</span>
</td>
<td class="function_name">
<a class="link" href="libvips-convolution.html#vips-conv" title="vips_conv ()">vips_conv</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<span class="returnvalue">int</span>
</td>
<td class="function_name">
<a class="link" href="libvips-convolution.html#vips-convf" title="vips_convf ()">vips_convf</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<span class="returnvalue">int</span>
</td>
<td class="function_name">
<a class="link" href="libvips-convolution.html#vips-convi" title="vips_convi ()">vips_convi</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<span class="returnvalue">int</span>
</td>
<td class="function_name">
<a class="link" href="libvips-convolution.html#vips-conva" title="vips_conva ()">vips_conva</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<span class="returnvalue">int</span>
</td>
<td class="function_name">
<a class="link" href="libvips-convolution.html#vips-convsep" title="vips_convsep ()">vips_convsep</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<span class="returnvalue">int</span>
</td>
<td class="function_name">
<a class="link" href="libvips-convolution.html#vips-convasep" title="vips_convasep ()">vips_convasep</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<span class="returnvalue">int</span>
</td>
<td class="function_name">
<a class="link" href="libvips-convolution.html#vips-compass" title="vips_compass ()">vips_compass</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<span class="returnvalue">int</span>
</td>
<td class="function_name">
<a class="link" href="libvips-convolution.html#vips-gaussblur" title="vips_gaussblur ()">vips_gaussblur</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<span class="returnvalue">int</span>
</td>
<td class="function_name">
<a class="link" href="libvips-convolution.html#vips-sharpen" title="vips_sharpen ()">vips_sharpen</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<span class="returnvalue">int</span>
</td>
<td class="function_name">
<a class="link" href="libvips-convolution.html#vips-spcor" title="vips_spcor ()">vips_spcor</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<span class="returnvalue">int</span>
</td>
<td class="function_name">
<a class="link" href="libvips-convolution.html#vips-fastcor" title="vips_fastcor ()">vips_fastcor</a> <span class="c_punctuation">()</span>
</td>
</tr>
</tbody>
</table></div>
</div>
<div class="refsect1">
<a name="libvips-convolution.other"></a><h2>Types and Values</h2>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="name">
<col class="description">
</colgroup>
<tbody><tr>
<td class="datatype_keyword">enum</td>
<td class="function_name"><a class="link" href="libvips-convolution.html#VipsCombine" title="enum VipsCombine">VipsCombine</a></td>
</tr></tbody>
</table></div>
</div>
<div class="refsect1">
<a name="libvips-convolution.includes"></a><h2>Includes</h2>
<pre class="synopsis">#include <vips/vips.h>
</pre>
</div>
<div class="refsect1">
<a name="libvips-convolution.description"></a><h2>Description</h2>
<p>These operations convolve an image in some way, or are operations based on
simple convolution, or are useful with convolution.</p>
</div>
<div class="refsect1">
<a name="libvips-convolution.functions_details"></a><h2>Functions</h2>
<div class="refsect2">
<a name="vips-conv"></a><h3>vips_conv ()</h3>
<pre class="programlisting"><span class="returnvalue">int</span>
vips_conv (<em class="parameter"><code><a class="link" href="VipsImage.html" title="VipsImage"><span class="type">VipsImage</span></a> *in</code></em>,
<em class="parameter"><code><a class="link" href="VipsImage.html" title="VipsImage"><span class="type">VipsImage</span></a> **out</code></em>,
<em class="parameter"><code><a class="link" href="VipsImage.html" title="VipsImage"><span class="type">VipsImage</span></a> *mask</code></em>,
<em class="parameter"><code>...</code></em>);</pre>
<p>Optional arguments:</p>
<div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; ">
<li class="listitem"><p><em class="parameter"><code>precision</code></em>
: <a class="link" href="libvips-basic.html#VipsPrecision" title="enum VipsPrecision"><span class="type">VipsPrecision</span></a>, calculation accuracy</p></li>
<li class="listitem"><p><em class="parameter"><code>layers</code></em>
: <code class="literal">gint</code>, number of layers for approximation</p></li>
<li class="listitem"><p><em class="parameter"><code>cluster</code></em>
: <code class="literal">gint</code>, cluster lines closer than this distance</p></li>
</ul></div>
<p>Convolution. </p>
<p>Perform a convolution of <em class="parameter"><code>in</code></em>
with <em class="parameter"><code>mask</code></em>
.
Each output pixel is calculated as:</p>
<div class="informalexample">
<table class="listing_frame" border="0" cellpadding="0" cellspacing="0">
<tbody>
<tr>
<td class="listing_lines" align="right"><pre>1</pre></td>
<td class="listing_code"><pre class="programlisting">sigma<span class="gtkdoc opt">[</span>i<span class="gtkdoc opt">]{</span>pixel<span class="gtkdoc opt">[</span>i<span class="gtkdoc opt">] *</span> mask<span class="gtkdoc opt">[</span>i<span class="gtkdoc opt">]} /</span> scale <span class="gtkdoc opt">+</span> offset</pre></td>
</tr>
</tbody>
</table>
</div>
<p></p>
<p>where scale and offset are part of <em class="parameter"><code>mask</code></em>
. </p>
<p>If <em class="parameter"><code>precision</code></em>
is <a class="link" href="libvips-basic.html#VIPS-PRECISION-INTEGER:CAPS"><span class="type">VIPS_PRECISION_INTEGER</span></a>, then
elements of <em class="parameter"><code>mask</code></em>
are converted to
integers before convolution, using <code class="function">rint()</code>,
and the output image
always has the same <a class="link" href="VipsImage.html#VipsBandFormat" title="enum VipsBandFormat"><span class="type">VipsBandFormat</span></a> as the input image. </p>
<p>For <a class="link" href="VipsImage.html#VIPS-FORMAT-UCHAR:CAPS"><span class="type">VIPS_FORMAT_UCHAR</span></a> images, <a class="link" href="libvips-convolution.html#vips-conv" title="vips_conv ()"><code class="function">vips_conv()</code></a> uses a fast vector path based on
fixed-point arithmetic. This can produce slightly different results.
Disable the vector path with <code class="literal">--vips-novector</code> or <code class="literal">VIPS_NOVECTOR</code> or
<code class="function">vips_vector_set_enabled()</code>.</p>
<p>If <em class="parameter"><code>precision</code></em>
is <a class="link" href="libvips-basic.html#VIPS-PRECISION-FLOAT:CAPS"><span class="type">VIPS_PRECISION_FLOAT</span></a> then the convolution is performed
with floating-point arithmetic. The output image
is always <a class="link" href="VipsImage.html#VIPS-FORMAT-FLOAT:CAPS"><span class="type">VIPS_FORMAT_FLOAT</span></a> unless <em class="parameter"><code>in</code></em>
is <a class="link" href="VipsImage.html#VIPS-FORMAT-DOUBLE:CAPS"><span class="type">VIPS_FORMAT_DOUBLE</span></a>, in which case
<em class="parameter"><code>out</code></em>
is also <a class="link" href="VipsImage.html#VIPS-FORMAT-DOUBLE:CAPS"><span class="type">VIPS_FORMAT_DOUBLE</span></a>. </p>
<p>If <em class="parameter"><code>precision</code></em>
is <a class="link" href="libvips-basic.html#VIPS-PRECISION-APPROXIMATE:CAPS"><span class="type">VIPS_PRECISION_APPROXIMATE</span></a> then, like
<a class="link" href="libvips-basic.html#VIPS-PRECISION-INTEGER:CAPS"><span class="type">VIPS_PRECISION_INTEGER</span></a>, <em class="parameter"><code>mask</code></em>
is converted to int before convolution, and
the output image
always has the same <a class="link" href="VipsImage.html#VipsBandFormat" title="enum VipsBandFormat"><span class="type">VipsBandFormat</span></a> as the input image. </p>
<p>Larger values for <em class="parameter"><code>layers</code></em>
give more accurate
results, but are slower. As <em class="parameter"><code>layers</code></em>
approaches the mask radius, the
accuracy will become close to exact convolution and the speed will drop to
match. For many large masks, such as Gaussian, <em class="parameter"><code>n_layers</code></em>
need be only 10% of
this value and accuracy will still be good.</p>
<p>Smaller values of <em class="parameter"><code>cluster</code></em>
will give more accurate results, but be slower
and use more memory. 10% of the mask radius is a good rule of thumb.</p>
<p>See also: <a class="link" href="libvips-convolution.html#vips-convsep" title="vips_convsep ()"><code class="function">vips_convsep()</code></a>.</p>
<div class="refsect3">
<a name="vips-conv.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody>
<tr>
<td class="parameter_name"><p>in</p></td>
<td class="parameter_description"><p>input image</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>out</p></td>
<td class="parameter_description"><p>output image</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>mask</p></td>
<td class="parameter_description"><p>convolve with this mask</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>...</p></td>
<td class="parameter_description"><p><code class="literal">NULL</code>-terminated list of optional named arguments</p></td>
<td class="parameter_annotations"> </td>
</tr>
</tbody>
</table></div>
</div>
<div class="refsect3">
<a name="vips-conv.returns"></a><h4>Returns</h4>
<p> 0 on success, -1 on error</p>
</div>
</div>
<hr>
<div class="refsect2">
<a name="vips-convf"></a><h3>vips_convf ()</h3>
<pre class="programlisting"><span class="returnvalue">int</span>
vips_convf (<em class="parameter"><code><a class="link" href="VipsImage.html" title="VipsImage"><span class="type">VipsImage</span></a> *in</code></em>,
<em class="parameter"><code><a class="link" href="VipsImage.html" title="VipsImage"><span class="type">VipsImage</span></a> **out</code></em>,
<em class="parameter"><code><a class="link" href="VipsImage.html" title="VipsImage"><span class="type">VipsImage</span></a> *mask</code></em>,
<em class="parameter"><code>...</code></em>);</pre>
<p>Convolution. This is a low-level operation, see <a class="link" href="libvips-convolution.html#vips-conv" title="vips_conv ()"><code class="function">vips_conv()</code></a> for something
more convenient. </p>
<p>Perform a convolution of <em class="parameter"><code>in</code></em>
with <em class="parameter"><code>mask</code></em>
.
Each output pixel is
calculated as sigma[i]{pixel[i] * mask[i]} / scale + offset, where scale
and offset are part of <em class="parameter"><code>mask</code></em>
. </p>
<p>The convolution is performed with floating-point arithmetic. The output image
is always <a class="link" href="VipsImage.html#VIPS-FORMAT-FLOAT:CAPS"><span class="type">VIPS_FORMAT_FLOAT</span></a> unless <em class="parameter"><code>in</code></em>
is <a class="link" href="VipsImage.html#VIPS-FORMAT-DOUBLE:CAPS"><span class="type">VIPS_FORMAT_DOUBLE</span></a>, in which case
<em class="parameter"><code>out</code></em>
is also <a class="link" href="VipsImage.html#VIPS-FORMAT-DOUBLE:CAPS"><span class="type">VIPS_FORMAT_DOUBLE</span></a>. </p>
<p>See also: <a class="link" href="libvips-convolution.html#vips-conv" title="vips_conv ()"><code class="function">vips_conv()</code></a>.</p>
<div class="refsect3">
<a name="vips-convf.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody>
<tr>
<td class="parameter_name"><p>in</p></td>
<td class="parameter_description"><p>input image</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>out</p></td>
<td class="parameter_description"><p>output image</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>mask</p></td>
<td class="parameter_description"><p>convolve with this mask</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>...</p></td>
<td class="parameter_description"><p><code class="literal">NULL</code>-terminated list of optional named arguments</p></td>
<td class="parameter_annotations"> </td>
</tr>
</tbody>
</table></div>
</div>
<div class="refsect3">
<a name="vips-convf.returns"></a><h4>Returns</h4>
<p> 0 on success, -1 on error</p>
</div>
</div>
<hr>
<div class="refsect2">
<a name="vips-convi"></a><h3>vips_convi ()</h3>
<pre class="programlisting"><span class="returnvalue">int</span>
vips_convi (<em class="parameter"><code><a class="link" href="VipsImage.html" title="VipsImage"><span class="type">VipsImage</span></a> *in</code></em>,
<em class="parameter"><code><a class="link" href="VipsImage.html" title="VipsImage"><span class="type">VipsImage</span></a> **out</code></em>,
<em class="parameter"><code><a class="link" href="VipsImage.html" title="VipsImage"><span class="type">VipsImage</span></a> *mask</code></em>,
<em class="parameter"><code>...</code></em>);</pre>
<p>Integer convolution. This is a low-level operation, see <a class="link" href="libvips-convolution.html#vips-conv" title="vips_conv ()"><code class="function">vips_conv()</code></a> for
something more convenient. </p>
<p><em class="parameter"><code>mask</code></em>
is converted to an integer mask with <code class="function">rint()</code> of each element, rint of
scale and rint of offset. Each output pixel is then calculated as </p>
<div class="informalexample">
<table class="listing_frame" border="0" cellpadding="0" cellspacing="0">
<tbody>
<tr>
<td class="listing_lines" align="right"><pre>1</pre></td>
<td class="listing_code"><pre class="programlisting">sigma<span class="gtkdoc opt">[</span>i<span class="gtkdoc opt">]{</span>pixel<span class="gtkdoc opt">[</span>i<span class="gtkdoc opt">] *</span> mask<span class="gtkdoc opt">[</span>i<span class="gtkdoc opt">]} /</span> scale <span class="gtkdoc opt">+</span> offset</pre></td>
</tr>
</tbody>
</table>
</div>
<p></p>
<p>The output image always has the same <a class="link" href="VipsImage.html#VipsBandFormat" title="enum VipsBandFormat"><span class="type">VipsBandFormat</span></a> as the input image. </p>
<p>For <a class="link" href="VipsImage.html#VIPS-FORMAT-UCHAR:CAPS"><span class="type">VIPS_FORMAT_UCHAR</span></a> images, <a class="link" href="libvips-convolution.html#vips-convi" title="vips_convi ()"><code class="function">vips_convi()</code></a> uses a fast vector path based on
fixed-point arithmetic. This can produce slightly different results.
Disable the vector path with <code class="literal">--vips-novector</code> or <code class="literal">VIPS_NOVECTOR</code> or
<code class="function">vips_vector_set_enabled()</code>.</p>
<p>See also: <a class="link" href="libvips-convolution.html#vips-conv" title="vips_conv ()"><code class="function">vips_conv()</code></a>.</p>
<div class="refsect3">
<a name="vips-convi.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody>
<tr>
<td class="parameter_name"><p>in</p></td>
<td class="parameter_description"><p>input image</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>out</p></td>
<td class="parameter_description"><p>output image</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>mask</p></td>
<td class="parameter_description"><p>convolve with this mask</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>...</p></td>
<td class="parameter_description"><p><code class="literal">NULL</code>-terminated list of optional named arguments</p></td>
<td class="parameter_annotations"> </td>
</tr>
</tbody>
</table></div>
</div>
<div class="refsect3">
<a name="vips-convi.returns"></a><h4>Returns</h4>
<p> 0 on success, -1 on error</p>
</div>
</div>
<hr>
<div class="refsect2">
<a name="vips-conva"></a><h3>vips_conva ()</h3>
<pre class="programlisting"><span class="returnvalue">int</span>
vips_conva (<em class="parameter"><code><a class="link" href="VipsImage.html" title="VipsImage"><span class="type">VipsImage</span></a> *in</code></em>,
<em class="parameter"><code><a class="link" href="VipsImage.html" title="VipsImage"><span class="type">VipsImage</span></a> **out</code></em>,
<em class="parameter"><code><a class="link" href="VipsImage.html" title="VipsImage"><span class="type">VipsImage</span></a> *mask</code></em>,
<em class="parameter"><code>...</code></em>);</pre>
<p>Optional arguments:</p>
<div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; ">
<li class="listitem"><p><em class="parameter"><code>layers</code></em>
: <code class="literal">gint</code>, number of layers for approximation</p></li>
<li class="listitem"><p><em class="parameter"><code>cluster</code></em>
: <code class="literal">gint</code>, cluster lines closer than this distance</p></li>
</ul></div>
<p>Perform an approximate integer convolution of <em class="parameter"><code>in</code></em>
with <em class="parameter"><code>mask</code></em>
.
This is a low-level operation, see
<a class="link" href="libvips-convolution.html#vips-conv" title="vips_conv ()"><code class="function">vips_conv()</code></a> for something more convenient. </p>
<p>The output image
always has the same <a class="link" href="VipsImage.html#VipsBandFormat" title="enum VipsBandFormat"><span class="type">VipsBandFormat</span></a> as the input image.
Elements of <em class="parameter"><code>mask</code></em>
are converted to
integers before convolution.</p>
<p>Larger values for <em class="parameter"><code>layers</code></em>
give more accurate
results, but are slower. As <em class="parameter"><code>layers</code></em>
approaches the mask radius, the
accuracy will become close to exact convolution and the speed will drop to
match. For many large masks, such as Gaussian, <em class="parameter"><code>layers</code></em>
need be only 10% of
this value and accuracy will still be good.</p>
<p>Smaller values of <em class="parameter"><code>cluster</code></em>
will give more accurate results, but be slower
and use more memory. 10% of the mask radius is a good rule of thumb.</p>
<p>See also: <a class="link" href="libvips-convolution.html#vips-conv" title="vips_conv ()"><code class="function">vips_conv()</code></a>.</p>
<div class="refsect3">
<a name="vips-conva.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody>
<tr>
<td class="parameter_name"><p>in</p></td>
<td class="parameter_description"><p>input image</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>out</p></td>
<td class="parameter_description"><p>output image</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>mask</p></td>
<td class="parameter_description"><p>convolution mask</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>...</p></td>
<td class="parameter_description"><p><code class="literal">NULL</code>-terminated list of optional named arguments</p></td>
<td class="parameter_annotations"> </td>
</tr>
</tbody>
</table></div>
</div>
<div class="refsect3">
<a name="vips-conva.returns"></a><h4>Returns</h4>
<p> 0 on success, -1 on error</p>
</div>
</div>
<hr>
<div class="refsect2">
<a name="vips-convsep"></a><h3>vips_convsep ()</h3>
<pre class="programlisting"><span class="returnvalue">int</span>
vips_convsep (<em class="parameter"><code><a class="link" href="VipsImage.html" title="VipsImage"><span class="type">VipsImage</span></a> *in</code></em>,
<em class="parameter"><code><a class="link" href="VipsImage.html" title="VipsImage"><span class="type">VipsImage</span></a> **out</code></em>,
<em class="parameter"><code><a class="link" href="VipsImage.html" title="VipsImage"><span class="type">VipsImage</span></a> *mask</code></em>,
<em class="parameter"><code>...</code></em>);</pre>
<p>Optional arguments:</p>
<div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; ">
<li class="listitem"><p><em class="parameter"><code>precision</code></em>
: calculation accuracy</p></li>
<li class="listitem"><p><em class="parameter"><code>layers</code></em>
: number of layers for approximation</p></li>
<li class="listitem"><p><em class="parameter"><code>cluster</code></em>
: cluster lines closer than this distance</p></li>
</ul></div>
<p>Perform a separable convolution of <em class="parameter"><code>in</code></em>
with <em class="parameter"><code>mask</code></em>
.
See <a class="link" href="libvips-convolution.html#vips-conv" title="vips_conv ()"><code class="function">vips_conv()</code></a> for a detailed description.</p>
<p>The mask must be 1xn or nx1 elements. </p>
<p>The image is convolved twice: once with <em class="parameter"><code>mask</code></em>
and then again with <em class="parameter"><code>mask</code></em>
rotated by 90 degrees. This is much faster for certain types of mask
(gaussian blur, for example) than doing a full 2D convolution.</p>
<p>See also: <a class="link" href="libvips-convolution.html#vips-conv" title="vips_conv ()"><code class="function">vips_conv()</code></a>, <a class="link" href="libvips-create.html#vips-gaussmat" title="vips_gaussmat ()"><code class="function">vips_gaussmat()</code></a>.</p>
<div class="refsect3">
<a name="vips-convsep.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody>
<tr>
<td class="parameter_name"><p>in</p></td>
<td class="parameter_description"><p>input image</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>out</p></td>
<td class="parameter_description"><p>output image</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>mask</p></td>
<td class="parameter_description"><p>convolution mask</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>...</p></td>
<td class="parameter_description"><p><code class="literal">NULL</code>-terminated list of optional named arguments</p></td>
<td class="parameter_annotations"> </td>
</tr>
</tbody>
</table></div>
</div>
<div class="refsect3">
<a name="vips-convsep.returns"></a><h4>Returns</h4>
<p> 0 on success, -1 on error</p>
</div>
</div>
<hr>
<div class="refsect2">
<a name="vips-convasep"></a><h3>vips_convasep ()</h3>
<pre class="programlisting"><span class="returnvalue">int</span>
vips_convasep (<em class="parameter"><code><a class="link" href="VipsImage.html" title="VipsImage"><span class="type">VipsImage</span></a> *in</code></em>,
<em class="parameter"><code><a class="link" href="VipsImage.html" title="VipsImage"><span class="type">VipsImage</span></a> **out</code></em>,
<em class="parameter"><code><a class="link" href="VipsImage.html" title="VipsImage"><span class="type">VipsImage</span></a> *mask</code></em>,
<em class="parameter"><code>...</code></em>);</pre>
<p>Optional arguments:</p>
<div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"><p><em class="parameter"><code>layers</code></em>
: <code class="literal">gint</code>, number of layers for approximation</p></li></ul></div>
<p>Approximate separable integer convolution. This is a low-level operation, see
<a class="link" href="libvips-convolution.html#vips-convsep" title="vips_convsep ()"><code class="function">vips_convsep()</code></a> for something more convenient. </p>
<p>The image is convolved twice: once with <em class="parameter"><code>mask</code></em>
and then again with <em class="parameter"><code>mask</code></em>
rotated by 90 degrees.
<em class="parameter"><code>mask</code></em>
must be 1xn or nx1 elements.
Elements of <em class="parameter"><code>mask</code></em>
are converted to
integers before convolution.</p>
<p>Larger values for <em class="parameter"><code>layers</code></em>
give more accurate
results, but are slower. As <em class="parameter"><code>layers</code></em>
approaches the mask radius, the
accuracy will become close to exact convolution and the speed will drop to
match. For many large masks, such as Gaussian, <em class="parameter"><code>layers</code></em>
need be only 10% of
this value and accuracy will still be good.</p>
<p>The output image
always has the same <a class="link" href="VipsImage.html#VipsBandFormat" title="enum VipsBandFormat"><span class="type">VipsBandFormat</span></a> as the input image. </p>
<p>See also: <a class="link" href="libvips-convolution.html#vips-convsep" title="vips_convsep ()"><code class="function">vips_convsep()</code></a>.</p>
<div class="refsect3">
<a name="vips-convasep.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody>
<tr>
<td class="parameter_name"><p>in</p></td>
<td class="parameter_description"><p>input image</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>out</p></td>
<td class="parameter_description"><p>output image</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>mask</p></td>
<td class="parameter_description"><p>convolve with this mask</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>...</p></td>
<td class="parameter_description"><p><code class="literal">NULL</code>-terminated list of optional named arguments</p></td>
<td class="parameter_annotations"> </td>
</tr>
</tbody>
</table></div>
</div>
<div class="refsect3">
<a name="vips-convasep.returns"></a><h4>Returns</h4>
<p> 0 on success, -1 on error</p>
</div>
</div>
<hr>
<div class="refsect2">
<a name="vips-compass"></a><h3>vips_compass ()</h3>
<pre class="programlisting"><span class="returnvalue">int</span>
vips_compass (<em class="parameter"><code><a class="link" href="VipsImage.html" title="VipsImage"><span class="type">VipsImage</span></a> *in</code></em>,
<em class="parameter"><code><a class="link" href="VipsImage.html" title="VipsImage"><span class="type">VipsImage</span></a> **out</code></em>,
<em class="parameter"><code><a class="link" href="VipsImage.html" title="VipsImage"><span class="type">VipsImage</span></a> *mask</code></em>,
<em class="parameter"><code>...</code></em>);</pre>
</div>
<hr>
<div class="refsect2">
<a name="vips-gaussblur"></a><h3>vips_gaussblur ()</h3>
<pre class="programlisting"><span class="returnvalue">int</span>
vips_gaussblur (<em class="parameter"><code><a class="link" href="VipsImage.html" title="VipsImage"><span class="type">VipsImage</span></a> *in</code></em>,
<em class="parameter"><code><a class="link" href="VipsImage.html" title="VipsImage"><span class="type">VipsImage</span></a> **out</code></em>,
<em class="parameter"><code><span class="type">double</span> sigma</code></em>,
<em class="parameter"><code>...</code></em>);</pre>
<p>Optional arguments:</p>
<div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; ">
<li class="listitem"><p><em class="parameter"><code>precision</code></em>
: <a class="link" href="libvips-basic.html#VipsPrecision" title="enum VipsPrecision"><span class="type">VipsPrecision</span></a> for blur, default VIPS_PRECISION_INTEGER</p></li>
<li class="listitem"><p><em class="parameter"><code>min_ampl</code></em>
: minimum amplitude, default 0.2</p></li>
</ul></div>
<p>This operator runs <a class="link" href="libvips-create.html#vips-gaussmat" title="vips_gaussmat ()"><code class="function">vips_gaussmat()</code></a> and <a class="link" href="libvips-convolution.html#vips-convsep" title="vips_convsep ()"><code class="function">vips_convsep()</code></a> for you on an image.
Set <em class="parameter"><code>min_ampl</code></em>
smaller to generate a larger, more accurate mask. Set <em class="parameter"><code>sigma</code></em>
larger to make the blur more blurry. </p>
<p>See also: <a class="link" href="libvips-create.html#vips-gaussmat" title="vips_gaussmat ()"><code class="function">vips_gaussmat()</code></a>, <a class="link" href="libvips-convolution.html#vips-convsep" title="vips_convsep ()"><code class="function">vips_convsep()</code></a>.</p>
<div class="refsect3">
<a name="vips-gaussblur.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody>
<tr>
<td class="parameter_name"><p>in</p></td>
<td class="parameter_description"><p>input image</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>out</p></td>
<td class="parameter_description"><p>output image</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>sigma</p></td>
<td class="parameter_description"><p>how large a mask to use</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>...</p></td>
<td class="parameter_description"><p><code class="literal">NULL</code>-terminated list of optional named arguments</p></td>
<td class="parameter_annotations"> </td>
</tr>
</tbody>
</table></div>
</div>
<div class="refsect3">
<a name="vips-gaussblur.returns"></a><h4>Returns</h4>
<p> 0 on success, -1 on error.</p>
</div>
</div>
<hr>
<div class="refsect2">
<a name="vips-sharpen"></a><h3>vips_sharpen ()</h3>
<pre class="programlisting"><span class="returnvalue">int</span>
vips_sharpen (<em class="parameter"><code><a class="link" href="VipsImage.html" title="VipsImage"><span class="type">VipsImage</span></a> *in</code></em>,
<em class="parameter"><code><a class="link" href="VipsImage.html" title="VipsImage"><span class="type">VipsImage</span></a> **out</code></em>,
<em class="parameter"><code>...</code></em>);</pre>
<p>Optional arguments:</p>
<div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; ">
<li class="listitem"><p><em class="parameter"><code>sigma</code></em>
: sigma of gaussian</p></li>
<li class="listitem"><p><em class="parameter"><code>x1</code></em>
: flat/jaggy threshold</p></li>
<li class="listitem"><p><em class="parameter"><code>y2</code></em>
: maximum amount of brightening</p></li>
<li class="listitem"><p><em class="parameter"><code>y3</code></em>
: maximum amount of darkening</p></li>
<li class="listitem"><p><em class="parameter"><code>m1</code></em>
: slope for flat areas</p></li>
<li class="listitem"><p><em class="parameter"><code>m2</code></em>
: slope for jaggy areas</p></li>
</ul></div>
<p>Selectively sharpen the L channel of a LAB image. The input image is
transformed to <a class="link" href="VipsImage.html#VIPS-INTERPRETATION-LABS:CAPS"><span class="type">VIPS_INTERPRETATION_LABS</span></a>. </p>
<p>The operation performs a gaussian blur of radius <em class="parameter"><code>radius</code></em>
and subtracts
from <em class="parameter"><code>in</code></em>
to generate a high-frequency signal. This signal is passed
through a lookup table formed from the five parameters and added back to
<em class="parameter"><code>in</code></em>
.</p>
<p>The lookup table is formed like this:</p>
<div class="informalexample">
<table class="listing_frame" border="0" cellpadding="0" cellspacing="0">
<tbody>
<tr>
<td class="listing_lines" align="right"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17</pre></td>
<td class="listing_code"><pre class="programlisting"><span class="gtkdoc opt">^</span>
y2 <span class="gtkdoc opt">|- - - - - -----------</span>
<span class="gtkdoc opt">| /</span>
<span class="gtkdoc opt">| /</span> slope m2
<span class="gtkdoc opt">| .../</span>
<span class="gtkdoc opt">-</span>x1 <span class="gtkdoc opt">| ... |</span>
<span class="gtkdoc opt">-------------------...----------------------></span>
<span class="gtkdoc opt">| ... |</span> x1
<span class="gtkdoc opt">|...</span> slope m1
<span class="gtkdoc opt">/ |</span>
<span class="gtkdoc opt">/</span> m2 <span class="gtkdoc opt">|</span>
<span class="gtkdoc opt">/ |</span>
<span class="gtkdoc opt">/ |</span>
<span class="gtkdoc opt">/ |</span>
<span class="gtkdoc opt">/ |</span>
______<span class="gtkdoc opt">/</span> _ _ _ _ _ _ <span class="gtkdoc opt">| -</span>y3
<span class="gtkdoc opt">|</span></pre></td>
</tr>
</tbody>
</table>
</div>
<p></p>
<p>For screen output, we suggest the following settings (the defaults):</p>
<div class="informalexample">
<table class="listing_frame" border="0" cellpadding="0" cellspacing="0">
<tbody>
<tr>
<td class="listing_lines" align="right"><pre>1
2
3
4
5
6</pre></td>
<td class="listing_code"><pre class="programlisting">sigma <span class="gtkdoc opt">==</span> <span class="number">0.5</span>
x1 <span class="gtkdoc opt">==</span> <span class="number">2</span>
y2 <span class="gtkdoc opt">==</span> <span class="function">10</span> <span class="gtkdoc opt">(</span>don<span class="string">'t brighten by more than 10 L*)</span>
<span class="string">y3 == 20 (can darken by up to 20 L*)</span>
<span class="string">m1 == 0 (no sharpening in flat areas)</span>
<span class="string">m2 == 3 (some sharpening in jaggy areas)</span></pre></td>
</tr>
</tbody>
</table>
</div>
<p></p>
<p>If you want more or less sharpening, we suggest you just change the
m2 parameter. </p>
<p>The <em class="parameter"><code>sigma</code></em>
parameter changes the width of the fringe and can be
adjusted according to the output printing resolution. As an approximate
guideline, use 0.5 for 4 pixels/mm (display resolution),
1.0 for 12 pixels/mm and 1.5 for 16 pixels/mm (300 dpi == 12
pixels/mm). These figures refer to the image raster, not the half-tone
resolution.</p>
<p>See also: <a class="link" href="libvips-convolution.html#vips-conv" title="vips_conv ()"><code class="function">vips_conv()</code></a>.</p>
<div class="refsect3">
<a name="vips-sharpen.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody>
<tr>
<td class="parameter_name"><p>in</p></td>
<td class="parameter_description"><p>input image</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>out</p></td>
<td class="parameter_description"><p>output image</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>...</p></td>
<td class="parameter_description"><p><code class="literal">NULL</code>-terminated list of optional named arguments</p></td>
<td class="parameter_annotations"> </td>
</tr>
</tbody>
</table></div>
</div>
<div class="refsect3">
<a name="vips-sharpen.returns"></a><h4>Returns</h4>
<p> 0 on success, -1 on error.</p>
</div>
</div>
<hr>
<div class="refsect2">
<a name="vips-spcor"></a><h3>vips_spcor ()</h3>
<pre class="programlisting"><span class="returnvalue">int</span>
vips_spcor (<em class="parameter"><code><a class="link" href="VipsImage.html" title="VipsImage"><span class="type">VipsImage</span></a> *in</code></em>,
<em class="parameter"><code><a class="link" href="VipsImage.html" title="VipsImage"><span class="type">VipsImage</span></a> *ref</code></em>,
<em class="parameter"><code><a class="link" href="VipsImage.html" title="VipsImage"><span class="type">VipsImage</span></a> **out</code></em>,
<em class="parameter"><code>...</code></em>);</pre>
<p>Calculate a correlation surface.</p>
<p><em class="parameter"><code>ref</code></em>
is placed at every position in <em class="parameter"><code>in</code></em>
and the correlation coefficient
calculated. The output
image is always float.</p>
<p>The output
image is the same size as the input. Extra input edge pixels are made by
copying the existing edges outwards. </p>
<p>The correlation coefficient is calculated as:</p>
<div class="informalexample">
<table class="listing_frame" border="0" cellpadding="0" cellspacing="0">
<tbody>
<tr>
<td class="listing_lines" align="right"><pre>1
2
3
4</pre></td>
<td class="listing_code"><pre class="programlisting"><span class="function">sumij</span> <span class="gtkdoc opt">(</span><span class="function">ref</span><span class="gtkdoc opt">(</span>i<span class="gtkdoc opt">,</span>j<span class="gtkdoc opt">)-</span><span class="function">mean</span><span class="gtkdoc opt">(</span>ref<span class="gtkdoc opt">))(</span><span class="function">inkl</span><span class="gtkdoc opt">(</span>i<span class="gtkdoc opt">,</span>j<span class="gtkdoc opt">)-</span><span class="function">mean</span><span class="gtkdoc opt">(</span>inkl<span class="gtkdoc opt">))</span>
<span class="function">c</span><span class="gtkdoc opt">(</span>k<span class="gtkdoc opt">,</span>l<span class="gtkdoc opt">) = ------------------------------------------------</span>
<span class="function">sqrt</span><span class="gtkdoc opt">(</span><span class="function">sumij</span> <span class="gtkdoc opt">(</span><span class="function">ref</span><span class="gtkdoc opt">(</span>i<span class="gtkdoc opt">,</span>j<span class="gtkdoc opt">)-</span><span class="function">mean</span><span class="gtkdoc opt">(</span>ref<span class="gtkdoc opt">))^</span><span class="number">2</span><span class="gtkdoc opt">) *</span>
<span class="function">sqrt</span><span class="gtkdoc opt">(</span><span class="function">sumij</span> <span class="gtkdoc opt">(</span><span class="function">inkl</span><span class="gtkdoc opt">(</span>i<span class="gtkdoc opt">,</span>j<span class="gtkdoc opt">)-</span><span class="function">mean</span><span class="gtkdoc opt">(</span>inkl<span class="gtkdoc opt">))^</span><span class="number">2</span><span class="gtkdoc opt">)</span></pre></td>
</tr>
</tbody>
</table>
</div>
<p></p>
<p>where inkl is the area of <em class="parameter"><code>in</code></em>
centred at position (k,l).</p>
<p>from Niblack "An Introduction to Digital Image Processing",
Prentice/Hall, pp 138.</p>
<p>If the number of bands differs, one of the images
must have one band. In this case, an n-band image is formed from the
one-band image by joining n copies of the one-band image together, and then
the two n-band images are operated upon.</p>
<p>The output image is always float, unless either of the two inputs is
double, in which case the output is also double.</p>
<p>See also: <a class="link" href="libvips-convolution.html#vips-fastcor" title="vips_fastcor ()"><code class="function">vips_fastcor()</code></a>.</p>
<div class="refsect3">
<a name="vips-spcor.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody>
<tr>
<td class="parameter_name"><p>in</p></td>
<td class="parameter_description"><p>input image</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>ref</p></td>
<td class="parameter_description"><p>reference image</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>out</p></td>
<td class="parameter_description"><p>output image</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>...</p></td>
<td class="parameter_description"><p><code class="literal">NULL</code>-terminated list of optional named arguments</p></td>
<td class="parameter_annotations"> </td>
</tr>
</tbody>
</table></div>
</div>
<div class="refsect3">
<a name="vips-spcor.returns"></a><h4>Returns</h4>
<p> 0 on success, -1 on error</p>
</div>
</div>
<hr>
<div class="refsect2">
<a name="vips-fastcor"></a><h3>vips_fastcor ()</h3>
<pre class="programlisting"><span class="returnvalue">int</span>
vips_fastcor (<em class="parameter"><code><a class="link" href="VipsImage.html" title="VipsImage"><span class="type">VipsImage</span></a> *in</code></em>,
<em class="parameter"><code><a class="link" href="VipsImage.html" title="VipsImage"><span class="type">VipsImage</span></a> *ref</code></em>,
<em class="parameter"><code><a class="link" href="VipsImage.html" title="VipsImage"><span class="type">VipsImage</span></a> **out</code></em>,
<em class="parameter"><code>...</code></em>);</pre>
<p>Calculate a fast correlation surface.</p>
<p><em class="parameter"><code>ref</code></em>
is placed at every position in <em class="parameter"><code>in</code></em>
and the sum of squares of
differences calculated. </p>
<p>The output
image is the same size as the input. Extra input edge pixels are made by
copying the existing edges outwards. </p>
<p>If the number of bands differs, one of the images
must have one band. In this case, an n-band image is formed from the
one-band image by joining n copies of the one-band image together, and then
the two n-band images are operated upon.</p>
<p>The output type is uint if both inputs are integer, float if both are float
or complex, and double if either is double or double complex.
In other words, the output type is just large enough to hold the whole
range of possible values.</p>
<p>See also: <a class="link" href="libvips-convolution.html#vips-spcor" title="vips_spcor ()"><code class="function">vips_spcor()</code></a>.</p>
<div class="refsect3">
<a name="vips-fastcor.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody>
<tr>
<td class="parameter_name"><p>in</p></td>
<td class="parameter_description"><p>input image</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>ref</p></td>
<td class="parameter_description"><p>reference image</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>out</p></td>
<td class="parameter_description"><p>output image</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>...</p></td>
<td class="parameter_description"><p><code class="literal">NULL</code>-terminated list of optional named arguments</p></td>
<td class="parameter_annotations"> </td>
</tr>
</tbody>
</table></div>
</div>
<div class="refsect3">
<a name="vips-fastcor.returns"></a><h4>Returns</h4>
<p> 0 on success, -1 on error</p>
</div>
</div>
</div>
<div class="refsect1">
<a name="libvips-convolution.other_details"></a><h2>Types and Values</h2>
<div class="refsect2">
<a name="VipsCombine"></a><h3>enum VipsCombine</h3>
<p>How to combine values.</p>
<div class="refsect3">
<a name="VipsCombine.members"></a><h4>Members</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="300px" class="enum_members_name">
<col class="enum_members_description">
<col width="200px" class="enum_members_annotations">
</colgroup>
<tbody>
<tr>
<td class="enum_member_name"><p><a name="VIPS-COMBINE-MAX:CAPS"></a>VIPS_COMBINE_MAX</p></td>
<td class="enum_member_description">
<p>take the maximum of the possible values</p>
</td>
<td class="enum_member_annotations"> </td>
</tr>
<tr>
<td class="enum_member_name"><p><a name="VIPS-COMBINE-SUM:CAPS"></a>VIPS_COMBINE_SUM</p></td>
<td class="enum_member_description">
<p>sum all the values</p>
</td>
<td class="enum_member_annotations"> </td>
</tr>
<tr>
<td class="enum_member_name"><p><a name="VIPS-COMBINE-LAST:CAPS"></a>VIPS_COMBINE_LAST</p></td>
<td> </td>
<td> </td>
</tr>
</tbody>
</table></div>
</div>
</div>
</div>
</div>
<div class="footer">
<hr>Generated by GTK-Doc V1.25</div>
</body>
</html>
|