GOffice.BezierSpline

Fields

Name

Type

Access

Description

closed

bool

r/w

whether the curve is closed.

n

int

r/w

spline segments number.

ref_count

int

r

x

float

r/w

control points abscissa.

y

float

r/w

control points ordinates.

Methods

class

init (x, y, n, closed)

destroy ()

to_cairo (cr, horiz_flip)

to_path ()

Details

class GOffice.BezierSpline
classmethod init(x, y, n, closed)
Parameters:
  • x (float) – the x values

  • y (float) – the y values

  • n (int) – the number of x and y values

  • closed (bool) – whether to return a closed curve or not

Returns:

a newly created struct GOffice.BezierSpline instance which should be destroyed by a call to GOffice.BezierSpline.destroy.

Return type:

GOffice.BezierSpline

x and y values must be valid and finite. The returned structure contains the x and y coordinates of all control points, including the incoming data. the n and closed fields are just copies of the corresponding arguments.

destroy()

Destroys the given structures after cleaning all allocated fields.

to_cairo(cr, horiz_flip)
Parameters:
  • cr (cairo.Context) – a cairo context

  • horiz_flip (bool) – whether to flip horizontally (for a RTL canvas).

Renders the spline in \a cr

to_path()
Returns:

GOffice.Path matching spline

Return type:

GOffice.Path

Builds a GOffice.Path using the control points evaluated in GOffice.BezierSpline.init.