Function

Vipsmatrixload

Declaration [src]

int
vips_matrixload (
  const char* filename,
  VipsImage** out,
  ...
)

Description [src]

Reads a matrix from a file.

Matrix files have a simple format that’s supposed to be easy to create with a text editor or a spreadsheet.

The first line has four numbers for width, height, scale and offset (scale and offset may be omitted, in which case they default to 1.0 and 0.0). Scale must be non-zero. Width and height must be positive integers. The numbers are separated by any mixture of spaces, commas, tabs and quotation marks (“). The scale and offset fields may be floating-point, and must use ‘.’ as a decimal separator.

Subsequent lines each hold one row of matrix data, with numbers again separated by any mixture of spaces, commas, tabs and quotation marks (“). The numbers may be floating-point, and must use ‘.’ as a decimal separator.

Extra characters at the ends of lines or at the end of the file are ignored.

See also: vips_matrixload().

This function is not directly available to language bindings

Parameters

filename const char*
 

File to load.

 The data is owned by the caller of the function.
 The value is a NUL terminated UTF-8 string.
out VipsImage
 

Output image.

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

NULL-terminated list of optional named arguments.

Return value

Returns: int
 

0 on success, -1 on error.