CpmlExtents — A rectangular area representing a bounding box
CpmlExtents; CpmlExtents * cpml_extents_copy (CpmlExtents *extents, const CpmlExtents *src); CpmlExtents * cpml_extents_from_cairo_text (CpmlExtents *extents, const cairo_text_extents_t *cairo_extents); void cpml_extents_add (CpmlExtents *extents, const CpmlExtents *src); void cpml_extents_pair_add (CpmlExtents *extents, const CpmlPair *src); cairo_bool_t cpml_extents_is_inside (const CpmlExtents *extents, const CpmlExtents *src); cairo_bool_t cpml_extents_pair_is_inside (const CpmlExtents *extents, const CpmlPair *src); void cpml_extents_transform (CpmlExtents *extents, const cairo_matrix_t *matrix);
The CpmlExtents struct groups two pairs representing the rectangular area of a bounding box.
typedef struct {
cairo_bool_t is_defined;
CpmlPair org;
CpmlVector size;
} CpmlExtents;
A structure defining a bounding box area. These APIs expect the
size of the extents to be always positives, so be careful while
directly accessing the size field.
| set to 0 when these extents are undefined | |
|
CpmlPair |
the lowest x,y coordinates |
| the width (x) and height (y) of the extents |
CpmlExtents * cpml_extents_copy (CpmlExtents *extents, const CpmlExtents *src);
Copies src in extents.
|
|
the destination CpmlExtents |
|
|
the source CpmlExtents |
|
Returns : |
extents
|
CpmlExtents * cpml_extents_from_cairo_text (CpmlExtents *extents, const cairo_text_extents_t *cairo_extents);
Converts cairo_extents in a CpmlExtents format and stores the
result in extents.
|
|
the destination CpmlExtents |
|
|
the source cairo_text_extents_t struct |
|
Returns : |
extents
|
void cpml_extents_add (CpmlExtents *extents, const CpmlExtents *src);
Merges extents and src and store the result in extents.
|
|
the destination CpmlExtents |
|
|
the extents to add |
void cpml_extents_pair_add (CpmlExtents *extents, const CpmlPair *src);
Extends extents, if required, to include src. If extents is
undefined, the origin of extents is set to src and its size
will be (0,0).
|
|
the destination CpmlExtents |
|
|
the AdgPair to add |
cairo_bool_t cpml_extents_is_inside (const CpmlExtents *extents, const CpmlExtents *src);
Checks wheter src is enterely contained by extents. If extents
is undefined, 0 will be returned. If src is undefined, 1 will
be returned. The border of extents is considered inside.
|
|
the container CpmlExtents |
|
|
the subject CpmlExtents |
|
Returns : |
1 if src is totally inside extents, 0 otherwise
|
cairo_bool_t cpml_extents_pair_is_inside (const CpmlExtents *extents, const CpmlPair *src);
Checks wheter src is inside extents. If extents is undefined,
0 will be returned. The border of extents is considered inside.
|
|
the container CpmlExtents |
|
|
the subject CpmlPair |
|
Returns : |
1 if src is inside extents, 0 otherwise
|
void cpml_extents_transform (CpmlExtents *extents, const cairo_matrix_t *matrix);
Shortcut to apply a specific transformation matrix to extents.
It basically convert the org field
with cairo_matrix_transform_point() and size
with cairo_matrix_transform_distance().
|
|
the container CpmlExtents |
|
|
the transformation matrix |
CpmlExtentswas last modified by gtk-doc on Sun 21 Feb 2010 10:22:18 PM CET