Graphene.Size¶
Fields¶
Name |
Type |
Access |
Description |
---|---|---|---|
height |
r/w |
the height |
|
width |
r/w |
the width |
Methods¶
class |
|
class |
|
|
|
|
|
|
|
|
|
|
|
|
Details¶
- class Graphene.Size¶
A size.
New in version 1.0.
- classmethod alloc()¶
- Returns:
the newly allocated
Graphene.Size
- Return type:
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:
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
) – aGraphene.Size
- Returns:
true
if the sizes are equal- Return type:
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:
- Returns:
the initialized
Graphene.Size
- Return type:
Initializes a
Graphene.Size
using the given width and height.New in version 1.0.
- init_from_size(src)¶
- Parameters:
src (
Graphene.Size
) – aGraphene.Size
- Returns:
the initialized
Graphene.Size
- Return type:
Initializes a
Graphene.Size
using the width and height of the given src.New in version 1.0.
- interpolate(b, factor)¶
- Parameters:
b (
Graphene.Size
) – aGraphene.Size
factor (
float
) – the linear interpolation factor
- 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.