im_logtra(3)

im_logtra3

Logarithmic, exponential and power transform of an image

Part of im_exptra(3).

Usage

#include <vips/vips.h>

int im_expntra(in, out, base)
IMAGE *in, *out;
double base;

int im_expntra_vec(in, out, n, vec)
IMAGE *in, *out;
int n;
double *vec;

int im_exp10tra(in, out)
IMAGE *in, *out;

int im_exptra(in, out)
IMAGE *in, *out;

int im_log10tra(in, out)
IMAGE *in, *out;

int im_logtra(in, out)
IMAGE *in, *out;

int im_powtra(in, out, exponent)
IMAGE *in, *out;
double exponent;

int im_powtra_vec(in, out, n, vec)
IMAGE *in, *out;
int n;
double *vec;

Overview

Each of the above functions maps in through a log or anti-log function of some sort and writes the result to out. The size and number of bands are unchanged, the output type is float, unless the input is double, in which case the output is double. Non-complex images only!

im_expntra(3) transforms element x of input, to pow(base, x) in output. It detects division by zero, setting those pixels to zero in the output. Beware: it does this silently!

im_expntra_vec(3) works as im_expntra(), but lets you specify a constant per band.

im_exp10tra(3) transforms element x of input, to pow(10,0, x) in output. Internally, it is defined in terms of im_expntra().

im_exptra(3) transforms element x of input, to pow(e, x) in output, where e is the mathematical constant. Internally, it is defined in terms of im_expntra().

im_log10tra(3) transforms element x of input, to log10tra(x) in output.

im_logtra(3) transforms element x of input, to logtra(x) in output.

im_powtra(3) transforms element x of input, to pow(x, exponent) in output. It detects division by zero, setting those pixels to zero in the output. Beware: it does this silently!

im_powtra_vec(3) works as im_powtra(3), but lets you specify a constant per band.

Return value

Each function returns 0 on success and -1 on error.

Releases

Unchanged in 4 releases since Debian 3.1 (Sarge).

  1. 3.1–6.0

Bugs

None of the functions checks for under/overflow. Overflow is very common for many of these functions!

Author

N. Dessipris - 24/04/1991
J. Cupitt (rewrite) - 21/7/93

From libvips-dev 7.20.7-1+b3 in Debian 6.0 (Squeeze). Parsed by carta from the page's man source.