![]() |
![]() |
![]() |
CPML reference manual | ![]() |
---|---|---|---|---|
Top | Description |
#include <cpml-1/cpml.h> struct CpmlExtents; void cpml_extents_copy (CpmlExtents *extents
,const CpmlExtents *src
); void cpml_extents_from_cairo_text (CpmlExtents *extents
,const cairo_text_extents_t *cairo_extents
); int cpml_extents_equal (const CpmlExtents *extents
,const CpmlExtents *src
); void cpml_extents_add (CpmlExtents *extents
,const CpmlExtents *src
); void cpml_extents_pair_add (CpmlExtents *extents
,const CpmlPair *src
); int cpml_extents_is_inside (const CpmlExtents *extents
,const CpmlExtents *src
); int 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.
struct CpmlExtents { int is_defined; CpmlPair org; CpmlVector size; };
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 |
CpmlVector |
the width (x) and height (y) of the extents |
Since 1.0
void cpml_extents_copy (CpmlExtents *extents
,const CpmlExtents *src
);
Copies src
in extents
.
|
the destination CpmlExtents. [out] |
|
the source CpmlExtents. [in] |
Since 1.0
void 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. [out] |
|
the source cairo_text_extents_t. [in][type gpointer] |
Since 1.0
int cpml_extents_equal (const CpmlExtents *extents
,const CpmlExtents *src
);
Compares extents
to src
and returns 1 if the extents are equals.
Two NULL
or two undefined extents are considered equal, athough
NULL
extents are not equal to undefined extents.
|
the first extents to compare |
|
the second extents to compare |
Returns : |
1 if extents is equal to src ,
0 otherwise. [type gboolean]
|
Since 1.0
void cpml_extents_add (CpmlExtents *extents
,const CpmlExtents *src
);
Merges extents
and src
and store the result in extents
.
|
the destination CpmlExtents. [inout] |
|
the extents to add. [in] |
Since 1.0
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 source and destination CpmlExtents. [inout] |
|
the CpmlPair to add. [in] |
Since 1.0
int 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. [type gboolean]
|
Since 1.0
int 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. [type gboolean]
|
Since 1.0
void cpml_extents_transform (CpmlExtents *extents
,const cairo_matrix_t *matrix
);
Transforms the four corners of extents
with matrix
and
recomputes extents
. This will logically equivalent to transform
an extents box and gets the extents of the resulting shape.
|
the container CpmlExtents. [inout] |
|
the transformation matrix. [in] |
Since 1.0