Constructor

VipsImagesdf

Declaration [src]

int
vips_sdf (
  VipsImage** out,
  int width,
  int height,
  VipsSdfShape shape,
  ...
)

Description [src]

Create a signed distance field (SDF) image of the given shape.

Different shapes use different combinations of the optional arguments, see below.

shape VipsSdfShape: create a circle centred on a, radius r.

shape VipsSdfShape: create a box with top-left corner a and bottom-right corner b.

shape VipsSdfShape: create a box with top-left corner a and bottom-right corner b, whose four corners are rounded by the four-element float array corners. corners will default to 0.0.

shape VipsSdfShape: draw a line from a to b.

::: tip “Optional arguments” * a: VipsArrayDouble, first point * b: VipsArrayDouble, second point * r: gdouble, radius * corners: VipsArrayDouble, corner radii

::: seealso vips_grey(), vips_grid(), vips_xyz().

Parameters

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.
width int
 

Horizontal size.

height int
 

Vertical size.

shape VipsSdfShape
 

SDF to create.

... none
 

NULL-terminated list of optional named arguments.

Return value

Returns: int
 

0 on success, -1 on error.