### Constructor

# Vips Image sdf

#### 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` `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`.

Optional arguments

- `a`: `VipsArrayDouble`, first point
- `b`: `VipsArrayDouble`, second point
- `r`: `gdouble`, radius
- `corners`: `VipsArrayDouble`, corner radii

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.