Function

Vipsswitch

Declaration [src]

int
vips_switch (
  VipsImage** tests,
  VipsImage** out,
  int n,
  ...
)

Description [src]

The tests images are evaluated and at each point the index of the first non-zero value is written to out. If all tests are false, the value (n + 1) is written.

Images in tests must have one band. They are expanded to the bounding box of the set of images in tests, and that size is used for out. tests can have up to 255 elements.

Combine with vips_case() to make an efficient multi-way vips_ifthenelse().

See also: vips_maplut(), vips_case(), vips_ifthenelse().

This function is not directly available to language bindings

Parameters

tests An array of VipsImage*
 

Test these images.

 The length of the array is specified in the n argument.
 The data is owned by the caller of the function.
out VipsImage
 

Output index image.

 The argument will be set by the function.
 The called function takes ownership of the data, and is responsible for freeing it.
n int
 

Number of input images.

...
 

NULL-terminated list of optional named arguments.

Return value

Returns: int
 

0 on success, -1 on error.