/usr/share/gtk-doc/html/libvips/VipsOperation.html is in libvips-doc 7.40.6-2.
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 | <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>VIPS Reference Manual: VipsOperation</title>
<meta name="generator" content="DocBook XSL Stylesheets V1.78.1">
<link rel="home" href="index.html" title="VIPS Reference Manual">
<link rel="up" href="ch02.html" title="Core VIPS API">
<link rel="prev" href="libvips-generate.html" title="generate">
<link rel="next" href="libvips-error.html" title="error">
<meta name="generator" content="GTK-Doc V1.20 (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="10"><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="#VipsOperation.description" class="shortcut">Description</a></span><span id="nav_hierarchy"> <span class="dim">|</span>
<a href="#VipsOperation.object-hierarchy" class="shortcut">Object Hierarchy</a></span><span id="nav_signals"> <span class="dim">|</span>
<a href="#VipsOperation.signals" class="shortcut">Signals</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="ch02.html"><img src="up.png" width="16" height="16" border="0" alt="Up"></a></td>
<td><a accesskey="p" href="libvips-generate.html"><img src="left.png" width="16" height="16" border="0" alt="Prev"></a></td>
<td><a accesskey="n" href="libvips-error.html"><img src="right.png" width="16" height="16" border="0" alt="Next"></a></td>
</tr></table>
<div class="refentry">
<a name="VipsOperation"></a><div class="titlepage"></div>
<div class="refnamediv"><table width="100%"><tr>
<td valign="top">
<h2><span class="refentrytitle"><a name="VipsOperation.top_of_page"></a>VipsOperation</span></h2>
<p>VipsOperation — the VIPS operation base object class</p>
</td>
<td class="gallery_image" valign="top" align="right"></td>
</tr></table></div>
<div class="refsect1">
<a name="VipsOperation.stability-level"></a><h2>Stability Level</h2>
Stable, unless otherwise indicated
</div>
<div class="refsect1">
<a name="VipsOperation.functions"></a><h2>Functions</h2>
<div class="informaltable"><table width="100%" border="0">
<colgroup>
<col width="150px" class="functions_return">
<col class="functions_name">
</colgroup>
<tbody>
<tr>
<td class="function_type">
<a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a>
</td>
<td class="function_name">
<span class="c_punctuation">(</span><a class="link" href="VipsOperation.html#VipsOperationBuildFn" title="VipsOperationBuildFn ()">*VipsOperationBuildFn</a><span class="c_punctuation">)</span> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<a class="link" href="VipsOperation.html#VipsOperationFlags" title="enum VipsOperationFlags"><span class="returnvalue">VipsOperationFlags</span></a>
</td>
<td class="function_name">
<a class="link" href="VipsOperation.html#vips-operation-get-flags" title="vips_operation_get_flags ()">vips_operation_get_flags</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<span class="returnvalue">void</span>
</td>
<td class="function_name">
<a class="link" href="VipsOperation.html#vips-operation-class-print-usage" title="vips_operation_class_print_usage ()">vips_operation_class_print_usage</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<span class="returnvalue">void</span>
</td>
<td class="function_name">
<a class="link" href="VipsOperation.html#vips-operation-invalidate" title="vips_operation_invalidate ()">vips_operation_invalidate</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="VipsOperation.html#vips-operation-call-valist" title="vips_operation_call_valist ()">vips_operation_call_valist</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<a class="link" href="VipsOperation.html" title="VipsOperation"><span class="returnvalue">VipsOperation</span></a> *
</td>
<td class="function_name">
<a class="link" href="VipsOperation.html#vips-operation-new" title="vips_operation_new ()">vips_operation_new</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="VipsOperation.html#vips-call" title="vips_call ()">vips_call</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="VipsOperation.html#vips-call-split" title="vips_call_split ()">vips_call_split</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="VipsOperation.html#vips-call-split-option-string" title="vips_call_split_option_string ()">vips_call_split_option_string</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<span class="returnvalue">void</span>
</td>
<td class="function_name">
<a class="link" href="VipsOperation.html#vips-call-options" title="vips_call_options ()">vips_call_options</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="VipsOperation.html#vips-call-argv" title="vips_call_argv ()">vips_call_argv</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<span class="returnvalue">void</span>
</td>
<td class="function_name">
<a class="link" href="VipsOperation.html#vips-cache-drop-all" title="vips_cache_drop_all ()">vips_cache_drop_all</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="VipsOperation.html#vips-cache-operation-buildp" title="vips_cache_operation_buildp ()">vips_cache_operation_buildp</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<a class="link" href="VipsOperation.html" title="VipsOperation"><span class="returnvalue">VipsOperation</span></a> *
</td>
<td class="function_name">
<a class="link" href="VipsOperation.html#vips-cache-operation-build" title="vips_cache_operation_build ()">vips_cache_operation_build</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<span class="returnvalue">void</span>
</td>
<td class="function_name">
<a class="link" href="VipsOperation.html#vips-cache-print" title="vips_cache_print ()">vips_cache_print</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<span class="returnvalue">void</span>
</td>
<td class="function_name">
<a class="link" href="VipsOperation.html#vips-cache-set-max" title="vips_cache_set_max ()">vips_cache_set_max</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<span class="returnvalue">void</span>
</td>
<td class="function_name">
<a class="link" href="VipsOperation.html#vips-cache-set-max-mem" title="vips_cache_set_max_mem ()">vips_cache_set_max_mem</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="VipsOperation.html#vips-cache-get-max" title="vips_cache_get_max ()">vips_cache_get_max</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="VipsOperation.html#vips-cache-get-size" title="vips_cache_get_size ()">vips_cache_get_size</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<span class="returnvalue">size_t</span>
</td>
<td class="function_name">
<a class="link" href="VipsOperation.html#vips-cache-get-max-mem" title="vips_cache_get_max_mem ()">vips_cache_get_max_mem</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="VipsOperation.html#vips-cache-get-max-files" title="vips_cache_get_max_files ()">vips_cache_get_max_files</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<span class="returnvalue">void</span>
</td>
<td class="function_name">
<a class="link" href="VipsOperation.html#vips-cache-set-max-files" title="vips_cache_set_max_files ()">vips_cache_set_max_files</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<span class="returnvalue">void</span>
</td>
<td class="function_name">
<a class="link" href="VipsOperation.html#vips-cache-set-dump" title="vips_cache_set_dump ()">vips_cache_set_dump</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<span class="returnvalue">void</span>
</td>
<td class="function_name">
<a class="link" href="VipsOperation.html#vips-cache-set-trace" title="vips_cache_set_trace ()">vips_cache_set_trace</a> <span class="c_punctuation">()</span>
</td>
</tr>
</tbody>
</table></div>
</div>
<div class="refsect1">
<a name="VipsOperation.signals"></a><h2>Signals</h2>
<div class="informaltable"><table border="0">
<colgroup>
<col width="150px" class="signals_return">
<col width="300px" class="signals_name">
<col width="200px" class="signals_flags">
</colgroup>
<tbody><tr>
<td class="signal_type"><span class="returnvalue">void</span></td>
<td class="signal_name"><a class="link" href="VipsOperation.html#VipsOperation-invalidate" title="The “invalidate” signal">invalidate</a></td>
<td class="signal_flags">Run Last</td>
</tr></tbody>
</table></div>
</div>
<div class="refsect1">
<a name="VipsOperation.other"></a><h2>Types and Values</h2>
<div class="informaltable"><table 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="VipsOperation.html#VipsOperationFlags" title="enum VipsOperationFlags">VipsOperationFlags</a></td>
</tr></tbody>
</table></div>
</div>
<div class="refsect1">
<a name="VipsOperation.object-hierarchy"></a><h2>Object Hierarchy</h2>
<pre class="screen"> <a href="http://library.gnome.org/devel/gobject/unstable/gobject-The-Base-Object-Type.html#GObject">GObject</a>
<span class="lineart">╰──</span> <a class="link" href="VipsObject.html" title="VipsObject">VipsObject</a>
<span class="lineart">╰──</span> VipsOperation
<span class="lineart">╰──</span> <a class="link" href="VipsForeignSave.html#VipsForeign">VipsForeign</a>
</pre>
</div>
<div class="refsect1">
<a name="VipsOperation.includes"></a><h2>Includes</h2>
<pre class="synopsis">#include <vips/vips.h>
</pre>
</div>
<div class="refsect1">
<a name="VipsOperation.description"></a><h2>Description</h2>
<p>The <a class="link" href="VipsOperation.html" title="VipsOperation"><span class="type">VipsOperation</span></a> class and associated types and macros.</p>
<p><a class="link" href="VipsOperation.html" title="VipsOperation"><span class="type">VipsOperation</span></a> is the base class for all operations in libvips. It builds
on <a class="link" href="VipsObject.html" title="VipsObject"><span class="type">VipsObject</span></a> to provide the introspection and command-line interface to
libvips. </p>
<p>It also maintains a cache of recent operations. See below. </p>
<p>vips_call(), <a class="link" href="VipsOperation.html#vips-call-split" title="vips_call_split ()"><code class="function">vips_call_split()</code></a> and <a class="link" href="VipsOperation.html#vips-call-split-option-string" title="vips_call_split_option_string ()"><code class="function">vips_call_split_option_string()</code></a> are used
by vips to implement the C API. They can execute any <a class="link" href="VipsOperation.html" title="VipsOperation"><span class="type">VipsOperation</span></a>,
passing in a set of required and optional arguments. Normally you would not
use these functions directly: every operation has a tiny wrapper function
which provides type-safety for the required arguments. For example,
<a class="link" href="libvips-conversion.html#vips-embed" title="vips_embed ()"><code class="function">vips_embed()</code></a> is defined as:</p>
<div class="informalexample"><pre class="programlisting">
int
vips_embed( VipsImage *in, VipsImage **out,
int x, int y, int width, int height, ... )
{
va_list ap;
int result;
va_start( ap, height );
result = vips_call_split( "embed", ap, in, out, x, y, width, height );
va_end( ap );
return( result );
}
</pre></div>
<p></p>
<p>Use <a class="link" href="VipsOperation.html#vips-call-argv" title="vips_call_argv ()"><code class="function">vips_call_argv()</code></a> to run any vips operation from a command-line style
argc/argv array. This is the thing used by the vips main program to
implement the vips command-line interface. </p>
<div class="refsect3">
<a name="id-1.3.6.9.9"></a><h4>
<a class="link" href="VipsOperation.html" title="VipsOperation"><span class="type">VipsOperation</span></a> and reference counting</h4>
<p>After calling a <a class="link" href="VipsOperation.html" title="VipsOperation"><span class="type">VipsOperation</span></a> you are responsible for unreffing any output
objects. For example, consider:</p>
<div class="informalexample"><pre class="programlisting">
VipsImage *im = ...;
VipsImage *t1;
if (vips_invert (im, &t1, NULL))
error ..
</pre></div>
<p></p>
<p>This will invert <em class="parameter"><code>im</code></em>
and return it as a new <a class="link" href="VipsImage.html" title="VipsImage"><span class="type">VipsImage</span></a>, <em class="parameter"><code>t1</code></em>
. As the caller
of <a class="link" href="libvips-arithmetic.html#vips-invert" title="vips_invert ()"><code class="function">vips_invert()</code></a>, you are responsible for <em class="parameter"><code>t1</code></em>
and must unref it when you no
longer need it. If <a class="link" href="libvips-arithmetic.html#vips-invert" title="vips_invert ()"><code class="function">vips_invert()</code></a> fails, no <em class="parameter"><code>t1</code></em>
is returned and you don't
need to do anything. </p>
<p>Consider running two operations, one after the other. You could write:</p>
<div class="informalexample"><pre class="programlisting">
VipsImage *im = ...;
VipsImage *t1, *t2;
if (vips_invert (im, &t1, NULL)) {
g_object_unref (im);
return -1;
}
g_object_unref (im);
if (vips_flip (t1, &t2, VIPS_DIRECTION_HORIZONTAL, NULL)) {
g_object_unref (t1);
return -1;
}
g_object_unref (t1);
</pre></div>
<p></p>
<p>This is correct, but rather long-winded. libvips provides a handy thing to
make a vector of auto-freeing object references. You can write this as:</p>
<div class="informalexample"><pre class="programlisting">
VipsObject *parent = ...;
VipsImage *im = ...;
VipsImage *t = (VipsImage **) vips_object_local_array (parent, 2);
if (vips_invert (im, &t[0], NULL) ||
vips_flip (t[0], &t[1], VIPS_DIRECTION_HORIZONTAL, NULL))
return -1;
</pre></div>
<p></p>
<p>where <em class="parameter"><code>parent</code></em>
is some enclosing object which will be unreffed when this
task is complete. <a class="link" href="VipsObject.html#vips-object-local-array" title="vips_object_local_array ()"><code class="function">vips_object_local_array()</code></a> makes an array of <a class="link" href="VipsObject.html" title="VipsObject"><span class="type">VipsObject</span></a>
(or <a class="link" href="VipsImage.html" title="VipsImage"><span class="type">VipsImage</span></a>, in this case) where when <em class="parameter"><code>parent</code></em>
is freed, all non-NULL
<a class="link" href="VipsObject.html" title="VipsObject"><span class="type">VipsObject</span></a> in the array are also unreffed.</p>
</div>
<div class="refsect3">
<a name="id-1.3.6.9.10"></a><h4>The <a class="link" href="VipsOperation.html" title="VipsOperation"><span class="type">VipsOperation</span></a> cache</h4>
<p>Because all <a class="link" href="VipsObject.html" title="VipsObject"><span class="type">VipsObject</span></a> are immutable, they can be cached. The cache is
very simple to use: instead of calling <a class="link" href="VipsObject.html#vips-object-build" title="vips_object_build ()"><code class="function">vips_object_build()</code></a>, instead call
<a class="link" href="VipsOperation.html#vips-cache-operation-build" title="vips_cache_operation_build ()"><code class="function">vips_cache_operation_build()</code></a>. This function calculates a hash from the
operations's input arguments and looks it up in table of all recent
operations. If there's a hit, the new operation is unreffed, the old
operation reffed, and the old operation returned in place of the new one.</p>
<p>The cache size is controlled with <a class="link" href="VipsOperation.html#vips-cache-set-max" title="vips_cache_set_max ()"><code class="function">vips_cache_set_max()</code></a> and friends.</p>
</div>
</div>
<div class="refsect1">
<a name="VipsOperation.functions_details"></a><h2>Functions</h2>
<div class="refsect2">
<a name="VipsOperationBuildFn"></a><h3>VipsOperationBuildFn ()</h3>
<pre class="programlisting"><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a>
<span class="c_punctuation">(</span>*VipsOperationBuildFn<span class="c_punctuation">)</span> (<em class="parameter"><code><a class="link" href="VipsObject.html" title="VipsObject"><span class="type">VipsObject</span></a> *Param1</code></em>);</pre>
</div>
<hr>
<div class="refsect2">
<a name="vips-operation-get-flags"></a><h3>vips_operation_get_flags ()</h3>
<pre class="programlisting"><a class="link" href="VipsOperation.html#VipsOperationFlags" title="enum VipsOperationFlags"><span class="returnvalue">VipsOperationFlags</span></a>
vips_operation_get_flags (<em class="parameter"><code><a class="link" href="VipsOperation.html" title="VipsOperation"><span class="type">VipsOperation</span></a> *operation</code></em>);</pre>
<p>Returns the set of flags for this operation.</p>
<div class="refsect3">
<a name="id-1.3.6.10.3.5"></a><h4>Parameters</h4>
<div class="informaltable"><table 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>operation</p></td>
<td class="parameter_description"><p>operation to fetch flags from</p></td>
<td class="parameter_annotations"> </td>
</tr></tbody>
</table></div>
</div>
<div class="refsect3">
<a name="id-1.3.6.10.3.6"></a><h4>Returns</h4>
<p> 0 on success, or -1 on error.</p>
<p></p>
</div>
</div>
<hr>
<div class="refsect2">
<a name="vips-operation-class-print-usage"></a><h3>vips_operation_class_print_usage ()</h3>
<pre class="programlisting"><span class="returnvalue">void</span>
vips_operation_class_print_usage (<em class="parameter"><code><span class="type">VipsOperationClass</span> *operation_class</code></em>);</pre>
<p>Print a usage message for the operation to stdout.</p>
<div class="refsect3">
<a name="id-1.3.6.10.4.5"></a><h4>Parameters</h4>
<div class="informaltable"><table 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>operation_class</p></td>
<td class="parameter_description"><p>class to print usage for</p></td>
<td class="parameter_annotations"> </td>
</tr></tbody>
</table></div>
</div>
</div>
<hr>
<div class="refsect2">
<a name="vips-operation-invalidate"></a><h3>vips_operation_invalidate ()</h3>
<pre class="programlisting"><span class="returnvalue">void</span>
vips_operation_invalidate (<em class="parameter"><code><a class="link" href="VipsOperation.html" title="VipsOperation"><span class="type">VipsOperation</span></a> *operation</code></em>);</pre>
</div>
<hr>
<div class="refsect2">
<a name="vips-operation-call-valist"></a><h3>vips_operation_call_valist ()</h3>
<pre class="programlisting"><span class="returnvalue">int</span>
vips_operation_call_valist (<em class="parameter"><code><a class="link" href="VipsOperation.html" title="VipsOperation"><span class="type">VipsOperation</span></a> *operation</code></em>,
<em class="parameter"><code><span class="type">va_list</span> ap</code></em>);</pre>
</div>
<hr>
<div class="refsect2">
<a name="vips-operation-new"></a><h3>vips_operation_new ()</h3>
<pre class="programlisting"><a class="link" href="VipsOperation.html" title="VipsOperation"><span class="returnvalue">VipsOperation</span></a> *
vips_operation_new (<em class="parameter"><code>const <span class="type">char</span> *name</code></em>);</pre>
</div>
<hr>
<div class="refsect2">
<a name="vips-call"></a><h3>vips_call ()</h3>
<pre class="programlisting"><span class="returnvalue">int</span>
vips_call (<em class="parameter"><code>const <span class="type">char</span> *operation_name</code></em>,
<em class="parameter"><code>...</code></em>);</pre>
<p>vips_call() calls the named operation, passing in required arguments, and
then setting any optional ones from the remainder of the arguments as a set
of name/value pairs. </p>
<p>For example, <a class="link" href="libvips-conversion.html#vips-embed" title="vips_embed ()"><code class="function">vips_embed()</code></a> takes six required arguments, <em class="parameter"><code>in</code></em>
, <em class="parameter"><code>out</code></em>
, <em class="parameter"><code>x</code></em>
, <em class="parameter"><code>y</code></em>
,
<em class="parameter"><code>width</code></em>
, <em class="parameter"><code>height</code></em>
; and has two optional arguments, <em class="parameter"><code>extend</code></em>
and <em class="parameter"><code>background</code></em>
.
You can run it with <a class="link" href="VipsOperation.html#vips-call" title="vips_call ()"><code class="function">vips_call()</code></a> like this: </p>
<div class="informalexample"><pre class="programlisting">
VipsImage *in = ...
VipsImage *out;
if( vips_call( "embed", in, &out, 10, 10, 100, 100,
"extend", VIPS_EXTEND_COPY,
NULL ) )
... error
</pre></div>
<p></p>
<p>Normally of course you'd just use the <a class="link" href="libvips-conversion.html#vips-embed" title="vips_embed ()"><code class="function">vips_embed()</code></a> wrapper function and get
type-safety for the required arguments. </p>
<p>See also: <a class="link" href="VipsOperation.html#vips-call-split" title="vips_call_split ()"><code class="function">vips_call_split()</code></a>, <a class="link" href="VipsOperation.html#vips-call-options" title="vips_call_options ()"><code class="function">vips_call_options()</code></a>.</p>
<div class="refsect3">
<a name="id-1.3.6.10.8.10"></a><h4>Parameters</h4>
<div class="informaltable"><table 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>...</p></td>
<td class="parameter_description"><p>required args, then a <a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a>-terminated list of argument/value pairs</p></td>
<td class="parameter_annotations"> </td>
</tr></tbody>
</table></div>
</div>
<div class="refsect3">
<a name="id-1.3.6.10.8.11"></a><h4>Returns</h4>
<p> 0 on success, -1 on error</p>
<p></p>
</div>
</div>
<hr>
<div class="refsect2">
<a name="vips-call-split"></a><h3>vips_call_split ()</h3>
<pre class="programlisting"><span class="returnvalue">int</span>
vips_call_split (<em class="parameter"><code>const <span class="type">char</span> *operation_name</code></em>,
<em class="parameter"><code><span class="type">va_list</span> optional</code></em>,
<em class="parameter"><code>...</code></em>);</pre>
</div>
<hr>
<div class="refsect2">
<a name="vips-call-split-option-string"></a><h3>vips_call_split_option_string ()</h3>
<pre class="programlisting"><span class="returnvalue">int</span>
vips_call_split_option_string (<em class="parameter"><code>const <span class="type">char</span> *operation_name</code></em>,
<em class="parameter"><code>const <span class="type">char</span> *option_string</code></em>,
<em class="parameter"><code><span class="type">va_list</span> optional</code></em>,
<em class="parameter"><code>...</code></em>);</pre>
</div>
<hr>
<div class="refsect2">
<a name="vips-call-options"></a><h3>vips_call_options ()</h3>
<pre class="programlisting"><span class="returnvalue">void</span>
vips_call_options (<em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Commandline-option-parser.html#GOptionGroup"><span class="type">GOptionGroup</span></a> *group</code></em>,
<em class="parameter"><code><a class="link" href="VipsOperation.html" title="VipsOperation"><span class="type">VipsOperation</span></a> *operation</code></em>);</pre>
</div>
<hr>
<div class="refsect2">
<a name="vips-call-argv"></a><h3>vips_call_argv ()</h3>
<pre class="programlisting"><span class="returnvalue">int</span>
vips_call_argv (<em class="parameter"><code><a class="link" href="VipsOperation.html" title="VipsOperation"><span class="type">VipsOperation</span></a> *operation</code></em>,
<em class="parameter"><code><span class="type">int</span> argc</code></em>,
<em class="parameter"><code><span class="type">char</span> **argv</code></em>);</pre>
</div>
<hr>
<div class="refsect2">
<a name="vips-cache-drop-all"></a><h3>vips_cache_drop_all ()</h3>
<pre class="programlisting"><span class="returnvalue">void</span>
vips_cache_drop_all (<em class="parameter"><code><span class="type">void</span></code></em>);</pre>
<p>Drop the whole operation cache, handy for leak tracking.</p>
</div>
<hr>
<div class="refsect2">
<a name="vips-cache-operation-buildp"></a><h3>vips_cache_operation_buildp ()</h3>
<pre class="programlisting"><span class="returnvalue">int</span>
vips_cache_operation_buildp (<em class="parameter"><code><a class="link" href="VipsOperation.html" title="VipsOperation"><span class="type">VipsOperation</span></a> **operation</code></em>);</pre>
<p>Look up <em class="parameter"><code>operation</code></em>
in the cache. If we get a hit, unref <em class="parameter"><code>operation</code></em>
, ref the
old one and return that through the argument pointer. </p>
<p>If we miss, build and add <em class="parameter"><code>operation</code></em>
.</p>
<div class="refsect3">
<a name="id-1.3.6.10.14.6"></a><h4>Parameters</h4>
<div class="informaltable"><table 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>operation</p></td>
<td class="parameter_description"><p>pointer to operation to lookup</p></td>
<td class="parameter_annotations"> </td>
</tr></tbody>
</table></div>
</div>
<div class="refsect3">
<a name="id-1.3.6.10.14.7"></a><h4>Returns</h4>
<p> 0 on success, or -1 on error.</p>
<p></p>
</div>
</div>
<hr>
<div class="refsect2">
<a name="vips-cache-operation-build"></a><h3>vips_cache_operation_build ()</h3>
<pre class="programlisting"><a class="link" href="VipsOperation.html" title="VipsOperation"><span class="returnvalue">VipsOperation</span></a> *
vips_cache_operation_build (<em class="parameter"><code><a class="link" href="VipsOperation.html" title="VipsOperation"><span class="type">VipsOperation</span></a> *operation</code></em>);</pre>
<p>A binding-friendly version of <a class="link" href="VipsOperation.html#vips-cache-operation-buildp" title="vips_cache_operation_buildp ()"><code class="function">vips_cache_operation_buildp()</code></a>.</p>
<p>After calling this, <em class="parameter"><code>operation</code></em>
has the same ref count as when it went in,
and the result must be freed with <a class="link" href="VipsObject.html#vips-object-unref-outputs" title="vips_object_unref_outputs ()"><code class="function">vips_object_unref_outputs()</code></a> and
<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>.</p>
<div class="refsect3">
<a name="id-1.3.6.10.15.6"></a><h4>Parameters</h4>
<div class="informaltable"><table 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>operation</p></td>
<td class="parameter_description"><p>operation to lookup</p></td>
<td class="parameter_annotations"> </td>
</tr></tbody>
</table></div>
</div>
<div class="refsect3">
<a name="id-1.3.6.10.15.7"></a><h4>Returns</h4>
<p> The built operation. </p>
<p><span class="annotation">[<acronym title="Free data after the code is done."><span class="acronym">transfer full</span></acronym>]</span></p>
</div>
</div>
<hr>
<div class="refsect2">
<a name="vips-cache-print"></a><h3>vips_cache_print ()</h3>
<pre class="programlisting"><span class="returnvalue">void</span>
vips_cache_print (<em class="parameter"><code><span class="type">void</span></code></em>);</pre>
<p>Print the whole operation cache to stdout. Handy for debugging.</p>
</div>
<hr>
<div class="refsect2">
<a name="vips-cache-set-max"></a><h3>vips_cache_set_max ()</h3>
<pre class="programlisting"><span class="returnvalue">void</span>
vips_cache_set_max (<em class="parameter"><code><span class="type">int</span> max</code></em>);</pre>
<p>Set the maximum number of operations we keep in cache.</p>
<div class="refsect3">
<a name="id-1.3.6.10.17.5"></a><h4>Parameters</h4>
<div class="informaltable"><table 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>max</p></td>
<td class="parameter_description"><p>maximum number of operation to cache</p></td>
<td class="parameter_annotations"> </td>
</tr></tbody>
</table></div>
</div>
</div>
<hr>
<div class="refsect2">
<a name="vips-cache-set-max-mem"></a><h3>vips_cache_set_max_mem ()</h3>
<pre class="programlisting"><span class="returnvalue">void</span>
vips_cache_set_max_mem (<em class="parameter"><code><span class="type">size_t</span> max_mem</code></em>);</pre>
<p>Set the maximum amount of tracked memory we allow before we start dropping
cached operations. See <a class="link" href="libvips-memory.html#vips-tracked-get-mem" title="vips_tracked_get_mem ()"><code class="function">vips_tracked_get_mem()</code></a>.</p>
<p>See also: <a class="link" href="libvips-memory.html#vips-tracked-get-mem" title="vips_tracked_get_mem ()"><code class="function">vips_tracked_get_mem()</code></a>.</p>
<div class="refsect3">
<a name="id-1.3.6.10.18.6"></a><h4>Parameters</h4>
<div class="informaltable"><table 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>max_mem</p></td>
<td class="parameter_description"><p>maximum amount of tracked memory we use </p></td>
<td class="parameter_annotations"> </td>
</tr></tbody>
</table></div>
</div>
</div>
<hr>
<div class="refsect2">
<a name="vips-cache-get-max"></a><h3>vips_cache_get_max ()</h3>
<pre class="programlisting"><span class="returnvalue">int</span>
vips_cache_get_max (<em class="parameter"><code><span class="type">void</span></code></em>);</pre>
<p>Get the maximum number of operations we keep in cache.</p>
<div class="refsect3">
<a name="id-1.3.6.10.19.5"></a><h4>Returns</h4>
<p> the maximum number of operations we keep in cache</p>
<p></p>
</div>
</div>
<hr>
<div class="refsect2">
<a name="vips-cache-get-size"></a><h3>vips_cache_get_size ()</h3>
<pre class="programlisting"><span class="returnvalue">int</span>
vips_cache_get_size (<em class="parameter"><code><span class="type">void</span></code></em>);</pre>
<p>Get the current number of operations in cache.</p>
<div class="refsect3">
<a name="id-1.3.6.10.20.5"></a><h4>Returns</h4>
<p> get the current number of operations in cache.</p>
<p></p>
</div>
</div>
<hr>
<div class="refsect2">
<a name="vips-cache-get-max-mem"></a><h3>vips_cache_get_max_mem ()</h3>
<pre class="programlisting"><span class="returnvalue">size_t</span>
vips_cache_get_max_mem (<em class="parameter"><code><span class="type">void</span></code></em>);</pre>
<p>Get the maximum amount of tracked memory we allow before we start dropping
cached operations. See <a class="link" href="libvips-memory.html#vips-tracked-get-mem" title="vips_tracked_get_mem ()"><code class="function">vips_tracked_get_mem()</code></a>.</p>
<p>See also: <a class="link" href="libvips-memory.html#vips-tracked-get-mem" title="vips_tracked_get_mem ()"><code class="function">vips_tracked_get_mem()</code></a>.</p>
<div class="refsect3">
<a name="id-1.3.6.10.21.6"></a><h4>Returns</h4>
<p> the maximum amount of tracked memory we allow</p>
<p></p>
</div>
</div>
<hr>
<div class="refsect2">
<a name="vips-cache-get-max-files"></a><h3>vips_cache_get_max_files ()</h3>
<pre class="programlisting"><span class="returnvalue">int</span>
vips_cache_get_max_files (<em class="parameter"><code><span class="type">void</span></code></em>);</pre>
<p>Get the maximum number of tracked files we allow before we start dropping
cached operations. See <a class="link" href="libvips-memory.html#vips-tracked-get-files" title="vips_tracked_get_files ()"><code class="function">vips_tracked_get_files()</code></a>.</p>
<p>See also: <a class="link" href="libvips-memory.html#vips-tracked-get-files" title="vips_tracked_get_files ()"><code class="function">vips_tracked_get_files()</code></a>.</p>
<div class="refsect3">
<a name="id-1.3.6.10.22.6"></a><h4>Returns</h4>
<p> the maximum number of tracked files we allow</p>
<p></p>
</div>
</div>
<hr>
<div class="refsect2">
<a name="vips-cache-set-max-files"></a><h3>vips_cache_set_max_files ()</h3>
<pre class="programlisting"><span class="returnvalue">void</span>
vips_cache_set_max_files (<em class="parameter"><code><span class="type">int</span> max_files</code></em>);</pre>
<p>Set the maximum number of tracked files we allow before we start dropping
cached operations. See <a class="link" href="libvips-memory.html#vips-tracked-get-files" title="vips_tracked_get_files ()"><code class="function">vips_tracked_get_files()</code></a>.</p>
<p>See also: <a class="link" href="libvips-memory.html#vips-tracked-get-files" title="vips_tracked_get_files ()"><code class="function">vips_tracked_get_files()</code></a>.</p>
<div class="refsect3">
<a name="id-1.3.6.10.23.6"></a><h4>Parameters</h4>
<div class="informaltable"><table 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>max_files</p></td>
<td class="parameter_description"><p>max open files we allow</p></td>
<td class="parameter_annotations"> </td>
</tr></tbody>
</table></div>
</div>
</div>
<hr>
<div class="refsect2">
<a name="vips-cache-set-dump"></a><h3>vips_cache_set_dump ()</h3>
<pre class="programlisting"><span class="returnvalue">void</span>
vips_cache_set_dump (<em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gboolean"><span class="type">gboolean</span></a> dump</code></em>);</pre>
<p>Handy for debugging. Print the operation cache to stdout just before exit.</p>
<p>See also: <a class="link" href="VipsOperation.html#vips-cache-set-trace" title="vips_cache_set_trace ()"><code class="function">vips_cache_set_trace()</code></a>.</p>
<div class="refsect3">
<a name="id-1.3.6.10.24.6"></a><h4>Parameters</h4>
<div class="informaltable"><table 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>dump</p></td>
<td class="parameter_description"><p>if <a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#TRUE:CAPS"><code class="literal">TRUE</code></a>, dump the operation cache on exit</p></td>
<td class="parameter_annotations"> </td>
</tr></tbody>
</table></div>
</div>
</div>
<hr>
<div class="refsect2">
<a name="vips-cache-set-trace"></a><h3>vips_cache_set_trace ()</h3>
<pre class="programlisting"><span class="returnvalue">void</span>
vips_cache_set_trace (<em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gboolean"><span class="type">gboolean</span></a> trace</code></em>);</pre>
<p>Handy for debugging. Print operation cache actions to stdout as we run.</p>
<p>See also: <a class="link" href="VipsOperation.html#vips-cache-set-dump" title="vips_cache_set_dump ()"><code class="function">vips_cache_set_dump()</code></a>.</p>
<div class="refsect3">
<a name="id-1.3.6.10.25.6"></a><h4>Parameters</h4>
<div class="informaltable"><table 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>trace</p></td>
<td class="parameter_description"><p>if <a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#TRUE:CAPS"><code class="literal">TRUE</code></a>, trace the operation cache </p></td>
<td class="parameter_annotations"> </td>
</tr></tbody>
</table></div>
</div>
</div>
</div>
<div class="refsect1">
<a name="VipsOperation.other_details"></a><h2>Types and Values</h2>
<div class="refsect2">
<a name="VipsOperationFlags"></a><h3>enum VipsOperationFlags</h3>
<div class="warning"><p><code class="literal">VipsOperationFlags</code> is deprecated and should not be used in newly-written code.</p></div>
<p>Flags we associate with an operation.</p>
<p><em class="parameter"><code>VIPS_OPERATION_SEQUENTIAL</code></em>
means that the operation works like <a class="link" href="libvips-convolution.html#vips-conv" title="vips_conv ()"><code class="function">vips_conv()</code></a>:
it can happily process images top-to-bottom with only small non-local
references.</p>
<p><em class="parameter"><code>VIPS_OPERATION_SEQUENTIAL_UNBUFFERED</code></em>
means that the operation works like
<a class="link" href="libvips-conversion.html#vips-copy" title="vips_copy ()"><code class="function">vips_copy()</code></a>: it can happily process images top-to-bottom and makes no
non-local references. </p>
<p><em class="parameter"><code>VIPS_OPERATION_NOCACHE</code></em>
means that the operation must not be cached by
vips. </p>
<p><em class="parameter"><code>VIPS_OPERATION_DEPRECATED</code></em>
means this is an old operation kept in vips for
compatibility only and should be hidden from users.</p>
<div class="refsect3">
<a name="id-1.3.6.11.2.9"></a><h4>Members</h4>
<div class="informaltable"><table 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-OPERATION-NONE:CAPS"></a>VIPS_OPERATION_NONE</p></td>
<td class="enum_member_description">
<p>no flags</p>
</td>
<td class="enum_member_annotations"> </td>
</tr>
<tr>
<td class="enum_member_name"><p><a name="VIPS-OPERATION-SEQUENTIAL:CAPS"></a>VIPS_OPERATION_SEQUENTIAL</p></td>
<td class="enum_member_description">
<p>can work sequentially</p>
</td>
<td class="enum_member_annotations"> </td>
</tr>
<tr>
<td class="enum_member_name"><p><a name="VIPS-OPERATION-SEQUENTIAL-UNBUFFERED:CAPS"></a>VIPS_OPERATION_SEQUENTIAL_UNBUFFERED</p></td>
<td> </td>
<td> </td>
</tr>
<tr>
<td class="enum_member_name"><p><a name="VIPS-OPERATION-NOCACHE:CAPS"></a>VIPS_OPERATION_NOCACHE</p></td>
<td class="enum_member_description">
<p>must not be cached</p>
</td>
<td class="enum_member_annotations"> </td>
</tr>
<tr>
<td class="enum_member_name"><p><a name="VIPS-OPERATION-DEPRECATED:CAPS"></a>VIPS_OPERATION_DEPRECATED</p></td>
<td class="enum_member_description">
<p>a compatibility thing</p>
</td>
<td class="enum_member_annotations"> </td>
</tr>
</tbody>
</table></div>
</div>
</div>
</div>
<div class="refsect1">
<a name="VipsOperation.signal-details"></a><h2>Signal Details</h2>
<div class="refsect2">
<a name="VipsOperation-invalidate"></a><h3>The <code class="literal">“invalidate”</code> signal</h3>
<pre class="programlisting"><span class="returnvalue">void</span>
user_function (<a class="link" href="VipsOperation.html" title="VipsOperation"><span class="type">VipsOperation</span></a> *vipsoperation,
<a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gpointer"><span class="type">gpointer</span></a> user_data)</pre>
<p>Flags: Run Last</p>
</div>
</div>
<div class="refsect1">
<a name="VipsOperation.see-also"></a><h2>See Also</h2>
object
</div>
</div>
<div class="footer">
<hr>
Generated by GTK-Doc V1.20</div>
</body>
</html>
|