int im_add(in1, in2, out)
IMAGE *in1, *in2, *out;
int im_gadd(a, in1, b, in2, c, out)
double a, b, c;
IMAGE *in1, *in2, *out;
int im_gaddim(a, in1, b, in2, c, out)
double a, b, c;
IMAGE *in1, *in2, *out;
int im_gfadd(a, in1, b, in2, c, out)
double a, b, c;
IMAGE *in1, *in2, *out;
im_add(3)
For two integer images, add the two images and write the output as
in1 - uchar char ushort short uint int
-------|-----------------------------------------
in2 |
uchar | ushort short ushort short uint int
char | short short short short int int
ushort | ushort short ushort short uint int
short | short short short short int int
uint | uint int uint int uint int
int | int int int int int int
If one or more of the images is a floating point type, the output is FMTFLOAT, unless one or more of the inputs is FMTDOUBLE, in which case the output is also FMTDOUBLE.
If one or more of the images is a complex type, the output is FMTCOMPLEX, unless one or more of the inputs is FMTDPCOMPLEX, in which case the output is also FMTDPCOMPLEX.
im_gadd(3) performs generalised addition of two images by calling im_gaddim(3) and im_gfadd(3). These are very old and tired things, and should not be used.
Input should be non complex. Output depends on input according to function called. The result at each point is: a * pel1 + b * pel2 + c, properly rounded if necessary. Pel1 and pel2 are the corresponding pixels from in1 and in2 respectively.
im_gaddim() performs generalised addition of in1 and in2, on the condition they are neither float nor double nor complex. The format of the resultant image is given by the table:
in1 - uchar char ushort short uint int
-------|-----------------------------------------
in2 |
uchar | ushort short ushort short uint int
char | short short short short int int
ushort | ushort short ushort short uint int
short | short short short short int int
uint | uint int uint int uint int
int | int int int int int int
The result at each point is: a * pel1 + b * pel2 + c, properly rounded. Pel1 and pel2 are the corresponding pixels from in1 and in2 respectively.
im_gfadd(3) adds the non-complex images pointed by in1 and in2. Result is float except if one (or both) inputs is double. In the latter case the result is double. The result at each point is: a * pel1 + b * pel2 + c. Pel1 and pel2 are the corresponding pixels from in1 and in2 respectively.