CpmlExtents

CpmlExtents — A rectangular area representing a bounding box

Synopsis

                    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);

Description

The CpmlExtents struct groups two pairs representing the rectangular area of a bounding box.

Details

CpmlExtents

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.

cairo_bool_t is_defined;

set to 0 when these extents are undefined

CpmlPair org;

the lowest x,y coordinates

CpmlVector size;

the width (x) and height (y) of the extents

cpml_extents_copy ()

CpmlExtents *       cpml_extents_copy                   (CpmlExtents *extents,
                                                         const CpmlExtents *src);

Copies src in extents.

extents :

the destination CpmlExtents

src :

the source CpmlExtents

Returns :

extents

cpml_extents_from_cairo_text ()

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.

extents :

the destination CpmlExtents

cairo_extents :

the source cairo_text_extents_t struct

Returns :

extents

cpml_extents_add ()

void                cpml_extents_add                    (CpmlExtents *extents,
                                                         const CpmlExtents *src);

Merges extents and src and store the result in extents.

extents :

the destination CpmlExtents

src :

the extents to add

cpml_extents_pair_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).

extents :

the destination CpmlExtents

src :

the AdgPair to add

cpml_extents_is_inside ()

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.

extents :

the container CpmlExtents

src :

the subject CpmlExtents

Returns :

1 if src is totally inside extents, 0 otherwise

cpml_extents_pair_is_inside ()

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.

extents :

the container CpmlExtents

src :

the subject CpmlPair

Returns :

1 if src is inside extents, 0 otherwise

cpml_extents_transform ()

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().

extents :

the container CpmlExtents

matrix :

the transformation matrix
CpmlExtents was last modified by gtk-doc on Mon 05 Jul 2010 11:11:52 PM CEST
Hosted by Get Automatic Drawing Generation at SourceForge.net. Fast, secure and Free Open Source software downloads
Search on this domain