<!-- manual page source format generated by PolyglotMan v3.2, --> <!-- available at http://polyglotman.sourceforge.net/ --> <html> <head> <title>Rect(3) manual page</title> </head> <body bgcolor='white'> <a href='#toc'>Table of Contents</a><p> <h2><a name='sect0' href='#toc0'>Name</a></h2> im_rect_marginadjust, im_rect_includespoint, im_rect_includesrect, im_rect_intersectrect, im_rect_isempty, im_rect_unionrect, im_rect_normalise, im_rect_equalsrect, im_rect_dup, IM_RECT_RIGHT, IM_RECT_BOTTOM, IM_RECT_HCENTRE, IM_RECT_VCENTRE - rectangle algebra functions <h2><a name='sect1' href='#toc1'>Synopsis</a></h2> #include <vips/vips.h> <br> typedef struct { <br> <tt> </tt> <tt> </tt> int left, top, width, height;<br> <br> } Rect; <p> #define IM_RECT_RIGHT(R) ((R)->left + (R)->width) <br> #define IM_RECT_BOTTOM(R) ((R)->top + (R)->height) <br> #define IM_RECT_HCENTRE(R) ((R)->left + (R)->width / 2) <br> #define IM_RECT_VCENTRE(R) ((R)->top + (R)->height / 2) <p> void im_rect_marginadjust( Rect *r, int n ); <br> int im_rect_includespoint( Rect *r, int x, int y ); <br> int im_rect_includesrect( Rect *r1, Rect *r2 ); <br> void im_rect_intersectrect( Rect *r1, Rect *r2, Rect *r3 ); <br> int im_rect_isempty( Rect *r ); <br> void im_rect_unionrect( Rect *r1, Rect *r2, Rect *r3 ); <br> int im_rect_equalsrect( Rect *r1, Rect *r2 ); <br> Rect *im_rect_dup( Rect *r ); <br> void im_rect_normalise( Rect *r ); <h2><a name='sect2' href='#toc2'>Description</a></h2> These functions perform simple algebra on Rect structs. There should also be a set of functions to do rectlist algebra. <p> <a href='im_rect_marginadjust.3.html'>im_rect_marginadjust(3)</a> expands a Rect by n units up, down, left and right. Negative expansions shrink the Rect. <p> <a href='im_rect_includespoint.3.html'>im_rect_includespoint(3)</a> returns non-zero if point (x,y) lies within Rect r. <p> <a href='im_rect_includesrect.3.html'>im_rect_includesrect(3)</a> returns non-zero if Rect r2 lies completely within Rect r1. <p> <a href='im_rect_intersectrect.3.html'>im_rect_intersectrect(3)</a> fills Rect r3 with the intersection of Rects r1 and r2. <p> <a href='im_rect_isempty.3.html'>im_rect_isempty(3)</a> returns non-zero if Rect r has either width less than or equal to 0 or height less than or equal to 0. <p> <a href='im_rect_unionrect.3.html'>im_rect_unionrect(3)</a> fills Rect r3 with the bounding box of Rect r1 and Rect r2. A proper union operation requires lists of rectangles, sadly. <p> <a href='im_rect_equalsrect.3.html'>im_rect_equalsrect(3)</a> returns non-zero if r1 and r2 are identical. <p> <a href='im_rect_dup.3.html'>im_rect_dup(3)</a> allocates memory for a new Rect structure and copies the elements of r into it. It returns a pointer to the new struct, or NULL on error. <p> <a href='im_rect_normalise.3.html'>im_rect_normalise(3)</a> flips r so that the same pixels are enclosed, but width and height are guaranteed >=0. <p> <h2><a name='sect3' href='#toc3'>See Also</a></h2> <a href='im_prepare.3.html'>im_prepare(3)</a> , <a href='im_region_create.3.html'>im_region_create(3)</a> <h2><a name='sect4' href='#toc4'>Copyright</a></h2> National Gallery, 1992 <h2><a name='sect5' href='#toc5'>Author</a></h2> J. Cupitt <p> <hr><p> <a name='toc'><b>Table of Contents</b></a><p> <ul> <li><a name='toc0' href='#sect0'>Name</a></li> <li><a name='toc1' href='#sect1'>Synopsis</a></li> <li><a name='toc2' href='#sect2'>Description</a></li> <li><a name='toc3' href='#sect3'>See Also</a></li> <li><a name='toc4' href='#sect4'>Copyright</a></li> <li><a name='toc5' href='#sect5'>Author</a></li> </ul> </body> </html>