<!-- manual page source format generated by PolyglotMan v3.2, --> <!-- available at http://polyglotman.sourceforge.net/ --> <html> <head> <title>MACROS(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_IMAGE_ADDR, IM_IMAGE_SIZEOF_ELEMENT, IM_IMAGE_SIZEOF_PEL, IM_IMAGE_SIZEOF_LINE, IM_IMAGE_N_ELEMENTS - macros for images <h2><a name='sect1' href='#toc1'>Synopsis</a></h2> <b>#include <vips/vips.h></b> <p> int IM_IMAGE_SIZEOF_ELEMENT( im ) <br> IMAGE *im; <p> int IM_IMAGE_SIZEOF_PEL( im ) <br> IMAGE *im; <p> int IM_IMAGE_SIZEOF_LINE( im ) <br> IMAGE *im; <p> int IM_IMAGE_N_ELEMENTS( im ) <br> IMAGE *im; <p> char *IM_IMAGE_ADDR( im, x, y ) <br> IMAGE *im; <br> int x; <br> int y; <p> <h2><a name='sect2' href='#toc2'>Description</a></h2> These macros help to simplify address arithmetic for images. <p> <a href='IM_IMAGE_SIZEOF_ELEMENT.3.html'>IM_IMAGE_SIZEOF_ELEMENT(3)</a> returns sizeof( one band element ). <p> <a href='IM_IMAGE_SIZEOF_PEL.3.html'>IM_IMAGE_SIZEOF_PEL(3)</a> returns sizeof( one pel ). <p> <a href='IM_IMAGE_SIZEOF_LINE.3.html'>IM_IMAGE_SIZEOF_LINE(3)</a> returns sizeof( one horizontal line of pels ). <p> <a href='IM_IMAGE_N_ELEMENTS.3.html'>IM_IMAGE_N_ELEMENTS(3)</a> returns the number of band elements across a horizontal line. <p> <a href='IM_IMAGE_ADDR.3.html'>IM_IMAGE_ADDR(3)</a> returns a pointer to the pixel at position (x,y) in the image. The point (x,y) should lie within the image. <p> If the macro DEBUG has been defined, then <a href='IM_IMAGE_ADDR.3.html'>IM_IMAGE_ADDR(3)</a> will also perform bounds checking. If you ask for the address of a pel outside the image, then <a href='IM_IMAGE_ADDR.3.html'>IM_IMAGE_ADDR(3)</a> will print an error message of the form: <p> IM_IMAGE_ADDR: point out of bounds, file "test.c", line 18<br> (point x=50, y=0 <br> should have been within Rect left=0, top=0, width=50, height=50)<br> <p> and call <a href='abort.3.html'>abort(3)</a> . <p> DEBUG needs to be defined *before* vips.h is included. Either define DEBUG with -D in your Makefile, or have a #define DEBUG right at the top of your file. <h2><a name='sect3' href='#toc3'>Copyright</a></h2> National Gallery, 1993 <h2><a name='sect4' href='#toc4'>See Also</a></h2> <a href='IM_REGION_ADDR.3.html'>IM_REGION_ADDR(3)</a> , <a href='im_malloc.3.html'>im_malloc(3)</a> , <a href='im_open_local.3.html'>im_open_local(3)</a> . <h2><a name='sect5' href='#toc5'>Author</a></h2> J. Cupitt - 23/7/93 <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'>Copyright</a></li> <li><a name='toc4' href='#sect4'>See Also</a></li> <li><a name='toc5' href='#sect5'>Author</a></li> </ul> </body> </html>