GEMLIB  0.44.0
Functions
Utility Library

some usefull utilities function. This library doesn't contain any AES call. More...

Functions

short rc_copy (const GRECT *src, GRECT *dst)
 
short rc_equal (const GRECT *r1, const GRECT *r2)
 
short rc_intersect (const GRECT *src, GRECT *dst)
 
GRECTarray_to_grect (const short *array, GRECT *area)
 
short * grect_to_array (const GRECT *area, short *array)
 

Detailed Description

some usefull utilities function. This library doesn't contain any AES call.

Function Documentation

GRECT* array_to_grect ( const short *  array,
GRECT area 
)

transform a PXY-array structure to a GRECT structure

Parameters
arrayspecify the area using a PXY-array
areawill then contain the area in a GRECT structure
Returns
area is returned.
See also
grect_to_array()

References graphic_rectangle::g_h, graphic_rectangle::g_w, graphic_rectangle::g_x, and graphic_rectangle::g_y.

short* grect_to_array ( const GRECT area,
short *  array 
)

transform a GRECT structure to a PXY-array structure

Parameters
areaspecify the area using a GRECT structure
arraywill then contain the area in a PXY-array
Returns
array is returned.
See also
array_to_grect()

References graphic_rectangle::g_h, graphic_rectangle::g_w, graphic_rectangle::g_x, and graphic_rectangle::g_y.

short rc_copy ( const GRECT src,
GRECT dst 
)

copy a GRECT structure

Parameters
src
dst
Returns
always 1.
short rc_equal ( const GRECT p1,
const GRECT p2 
)

return non-zero value if both area are equal

Parameters
p1an area
p2an other area
Returns
0 if p1 and p2 are not the same area, any other value (not 0) otherwise (p1 equal p2).
short rc_intersect ( const GRECT r1,
GRECT r2 
)

Compute the interesection of two rectangles

Parameters
r1the first rectangle
r2the other rectangle. The intersection area will be returned in r2.
Returns
0 if theses rectangle don't have any common area, any other value value if the intersection exist. Then, r2 will contain the common area.

References graphic_rectangle::g_h, graphic_rectangle::g_w, graphic_rectangle::g_x, and graphic_rectangle::g_y.