Top |
#define | GRAPHENE_SIZE_INIT() |
graphene_size_t * | graphene_size_alloc () |
void | graphene_size_free () |
graphene_size_t * | graphene_size_init () |
graphene_size_t * | graphene_size_init_from_size () |
bool | graphene_size_equal () |
void | graphene_size_scale () |
void | graphene_size_interpolate () |
const graphene_size_t * | graphene_size_zero () |
graphene_size_t represents a size composed of a graphene_size_t.width
by a graphene_size_t.height
.
#define GRAPHENE_SIZE_INIT(_w,_h) (graphene_size_t) { .width = (_w), .height = (_h) }
Initializes a graphene_size_t with the given sizes when declaring it, e.g.:
1 |
graphene_size_t size = GRAPHENE_SIZE_INIT (100.f, 100.f); |
Since: 1.0
graphene_size_t *
graphene_size_alloc (void
);
Allocates a new graphene_size_t.
The contents of the returned value are undefined.
[constructor]
Since: 1.0
void
graphene_size_free (graphene_size_t *s
);
Frees the resources allocated by graphene_size_alloc()
.
Since: 1.0
graphene_size_t * graphene_size_init (graphene_size_t *s
,float width
,float height
);
Initializes a graphene_size_t using the given width
and height
.
Since: 1.0
graphene_size_t * graphene_size_init_from_size (graphene_size_t *s
,const graphene_size_t *src
);
Initializes a graphene_size_t using the width and height of
the given src
.
Since: 1.0
bool graphene_size_equal (const graphene_size_t *a
,const graphene_size_t *b
);
Checks whether the two give graphene_size_t are equal.
Since: 1.0
void graphene_size_scale (const graphene_size_t *s
,float factor
,graphene_size_t *res
);
Scales the components of a graphene_size_t using the given factor
.
s |
||
factor |
the scaling factor |
|
res |
return location for the scaled size. |
[out caller-allocates] |
Since: 1.0
void graphene_size_interpolate (const graphene_size_t *a
,const graphene_size_t *b
,double factor
,graphene_size_t *res
);
Linearly interpolates the two given graphene_size_t using the given
interpolation factor
.
a |
||
b |
||
factor |
the linear interpolation factor |
|
res |
return location for the interpolated size. |
[out caller-allocates] |
Since: 1.0
const graphene_size_t *
graphene_size_zero (void
);
A constant pointer to a zero graphene_size_t, useful for equality checks and interpolations.
Since: 1.0
#define GRAPHENE_SIZE_INIT_ZERO GRAPHENE_SIZE_INIT (0.f, 0.f)
Initializes a graphene_size_t to (0, 0) when declaring it.
Since: 1.0