Method

GimpPathstroke_new_from_points

since: 2.4

Declaration [src]

gint
gimp_path_stroke_new_from_points (
  GimpPath* path,
  GimpPathStrokeType type,
  gsize num_points,
  const gdouble* controlpoints,
  gboolean closed
)

Description [src]

Adds a stroke of a given type to the path object.

Adds a stroke of a given type to the path object. The coordinates of the control points can be specified. For now only strokes of the type GIMP_PATH_STROKE_TYPE_BEZIER are supported. The control points are specified as a pair of double values for the x- and y-coordinate. The Bezier stroke type needs a multiple of three control points. Each Bezier segment endpoint (anchor, A) has two additional control points (C) associated. They are specified in the order CACCACCAC

Available since: 2.4

Parameters

type

Type: GimpPathStrokeType

Type of the stroke (always GIMP_PATH_STROKE_TYPE_BEZIER for now).

num_points

Type: gsize

The number of elements in the array, i.e. the number of controlpoints in the stroke * 2 (x- and y-coordinate).

controlpoints

Type: An array of double

List of the x- and y-coordinates of the control points.

The length of the array is specified in the num_points argument.
The data is owned by the caller of the function.
closed

Type: gboolean

Whether the stroke is to be closed or not.

Return value

Type: gint

The stroke ID of the newly created stroke.