1IM_MULTIPLY(3) Library Functions Manual IM_MULTIPLY(3)
2
3
4
6 im_cmulnorm, im_multiply - multiply two images
7
9 #include <vips/vips.h>
10
11 int im_cmulnorm(in1, in2, out)
12 IMAGE *in1, *in2, *out;
13
14 int im_multiply(in1, in2, out)
15 IMAGE *in1, *in2, *out;
16
17
19 These functions operate on two images held by image descriptors in1 and
20 in2 and write the result to the image descriptor out. Input images in1
21 and in2 should have the same channels and the same sizes; however they
22 can be of different types. Only the history of the image descriptor
23 pointed by in1 is copied to out.
24
25 im_multiply(3) applied to two integer images multiplies the two images
26 and writes the output as:
27
28 in1 | uchar char ushort short uint int
29 -------+-----------------------------------------
30 in2 |
31 uchar | ushort short ushort short uint int
32 char | short short short short int int
33 ushort | ushort short ushort short uint int
34 short | short short short short int int
35 uint | uint int uint int uint int
36 int | int int int int int int
37
38 If one or more of the images is a floating point type, the output is
39 FMTFLOAT, unless one or more of the inputs is FMTDOUBLE, in which case
40 the output is also FMTDOUBLE.
41
42 If one or more of the images is a complex type, the output is FMTCOM‐
43 PLEX, unless one or more of the inputs is FMTDPCOMPLEX, in which case
44 the output is also FMTDPCOMPLEX.
45
46 For complex input pels (x1,y1) and (x2,y2), im_multiply() writes (x1*x2
47 - y1*y2, x1*y2 + x2*y1).
48
49 im_cmulnorm(3) multiplies two complex images. The complex output is
50 normalised to 1 by dividing both the real and the imaginary part of
51 each pel with the norm; for instance if the complex multiplication pro‐
52 duces (a,b) then the output written by this function is (a/norm,
53 b/norm), where norm=a*a+b*b. Result is checked for norm=0. The func‐
54 tion is useful for phase correlation. Both inputs should be complex.
55
56 Result is float complex if both inputs are float complex. In any other
57 case the result is double complex.
58
59
61 None of the functions checks the result for over/underflow.
62
64 All functions return 0 on success and -1 on error.
65
67 im_subtract(3), im_lintra(3), im_add(3).
68
70 N. Dessipris - 22/04/1991
71 J. Cupitt (im_multiply) - 22/04/1991
72
73
74
75 24 April 1991 IM_MULTIPLY(3)