1SUBTRACTION(3)             Library Functions Manual             SUBTRACTION(3)
2
3
4

NAME

6       im_subtract - subtracts two images
7

SYNOPSIS

9       #include <vips/vips.h>
10
11       int im_subtract(in1, in2, out)
12       IMAGE *in1, *in2, *out;
13

DESCRIPTION

15       This  functions calculates in1 - in2 and writes the result in the image
16       descriptor out.  Input images in1 and in2 should have the same channels
17       and  the  same sizes; however they can be of different types.  Only the
18       history of the image descriptor pointed by in1 is copied to out.
19
20       The type of the output is given by the table:
21
22        in1    - uchar   char   ushort  short  uint  int
23        -------|-----------------------------------------
24        in2    |
25        uchar  | short   short  short   short  int   int
26        char   | short   short  short   short  int   int
27        ushort | short   short  short   short  int   int
28        short  | short   short  short   short  int   int
29        uint   | int     int    int     int    int   int
30        int    | int     int    int     int    int   int
31
32       The result of this operation cannot be unsigned. For float  types,  the
33       refult  is  float unless one of the inputs is double, in which case the
34       result is double. For complex types the result  is  FMTCOMPLEX,  unless
35       one  of  the inputs is FMTDPCOMPLEX, in which case the output is FMTDP‐
36       COMPLEX.
37
38

BUGS

40       None of the functions checks the result for over/underflow.
41

RETURN VALUE

43       All functions return 0 on success and -1 on error.
44

SEE ALSO

46       im_add(3), im_lintra(3), im_multiply(3).
47
49       National Gallery, 1995
50
51
52
53                                 24 April 1991                  SUBTRACTION(3)
Impressum