Constructor

VipsImagesdf

Declaration [src]

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

Description [src]

Optional arguments:

  • a: VipsArrayDouble, first point
  • b: VipsArrayDouble, second point
  • r: %gfloat, radius
  • corners: VipsArrayDouble, corner radii

Create a signed distance field (SDF) image of the given shape. Different shapes use different combinations of the optional arguments, see below.

shape #VIPS_SDF_SHAPE_CIRCLE: create a circle centred on a, radius r.

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

shape #VIPS_SDF_SHAPE_ROUNDED_BOX: 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 #VIPS_SDF_SHAPE_LINE: draw a line from a to b.

See also: vips_grey(), vips_grid(), vips_xyz().

This constructor is not directly available to language bindings.

Parameters

out

Type: VipsImage

Output image.

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

Type: int

Horizontal size.

height

Type: int

Vertical size.

shape

Type: VipsSdfShape

SDF to create.

...

Type: 

NULL-terminated list of optional named arguments.

Return value

Type: int

0 on success, -1 on error.