Here is an example of a simple function in C and in C++. Figure 3.1 shows the example from section 5 of the VIPS Application Programmers' Guide, and figure 3.2 shows the same function in C++.
This example is supposed to show a lot of operations joined together -- it is
not actually very useful, nor the most efficient way to code up this problem.
There's im_lintra_vec()
which does exactly this much more quickly.