Graphene.Size

Fields

Name

Type

Access

Description

height

float

r/w

the height

width

float

r/w

the width

Methods

class

alloc ()

class

zero ()

equal (b)

free ()

init (width, height)

init_from_size (src)

interpolate (b, factor)

scale (factor)

Details

class Graphene.Size

A size.

New in version 1.0.

classmethod alloc()
Returns:

the newly allocated Graphene.Size

Return type:

Graphene.Size

Allocates a new Graphene.Size.

The contents of the returned value are undefined.

New in version 1.0.

classmethod zero()
Returns:

a constant size

Return type:

Graphene.Size

A constant pointer to a zero Graphene.Size, useful for equality checks and interpolations.

New in version 1.0.

equal(b)
Parameters:

b (Graphene.Size) – a Graphene.Size

Returns:

true if the sizes are equal

Return type:

bool

Checks whether the two give Graphene.Size are equal.

New in version 1.0.

free()

Frees the resources allocated by Graphene.Size.alloc().

New in version 1.0.

init(width, height)
Parameters:
  • width (float) – the width

  • height (float) – the height

Returns:

the initialized Graphene.Size

Return type:

Graphene.Size

Initializes a Graphene.Size using the given width and height.

New in version 1.0.

init_from_size(src)
Parameters:

src (Graphene.Size) – a Graphene.Size

Returns:

the initialized Graphene.Size

Return type:

Graphene.Size

Initializes a Graphene.Size using the width and height of the given src.

New in version 1.0.

interpolate(b, factor)
Parameters:
Returns:

return location for the interpolated size

Return type:

res: Graphene.Size

Linearly interpolates the two given Graphene.Size using the given interpolation factor.

New in version 1.0.

scale(factor)
Parameters:

factor (float) – the scaling factor

Returns:

return location for the scaled size

Return type:

res: Graphene.Size

Scales the components of a Graphene.Size using the given factor.

New in version 1.0.