Table of Contents

## Name

im_paintrect, im_plotmask, im_readpoint, im_plotpoint, im_fastline, im_fastlineuser - suck pels up, and paint them down somewhere else

## Synopsis

#include <vips/vips.h>
#include <vips/rect.h>

int im_readpoint( im, x, y, ink )
IMAGE *im;
int x, y;
PEL *ink;

int im_plotpoint( im, x, y, ink )
IMAGE *im;
int x, y;
PEL *ink;

int im_plotmask( im, ix, iy, ink, mask, r )
IMAGE *im;
int ix, iy;
PEL *ink;
PEL *mask;
Rect *r;

int im_paintrect( im, r, ink )
IMAGE *im;
Rect *r;
PEL *ink;

int im_fastline( im, x1, y1, x2, y2, ink )
IMAGE *im;
int x1, y1, x2, y2;
PEL *ink;

int im_fastlineuser( im, x1, y1, x2, y2,
plot_fn, client1, client2, client3 )
IMAGE *im;
int x1, y1, x2, y2;
int (*plot_fn)();
void *client1, *client2, *client3;

int plot_fn( im, x, y, client1, client2, client3 )
IMAGE *im;
int x, y;
void *client1, *client2, *client3;

## Description

im_readpoint() sucks a pel from position (x,y) into a buffer; all other functions paint that buffer back again in various ways. These functions will work for an image of any type, since they rely on im_readpoint() for their data. If you read a pel from one image and paint with it to another, it is your responsibility to check that the two images have identical pels.

All these functions are `in place,' that is, they write directly to the output image! Be very careful, you can destroy data.

im_plotmask() takes an array of 0/255's and a Rect describing the size and offset of the array. It adds (ix,iy) to the array offset, and then paint pels into all array positions which are non-zero. Rect need not lie inside the image - the function clips carefully at the edges.

im_paintrect() fills the rectangle described with ink. The Rect can be any size and at any position - the function clipps against the edges of the image.

im_fastline() is a replacement for im_line() which plots the specified ink in the image. The start and end points must lie entirely inside the image.

im_fastlineuser() does not plot points, instead it calls a user plot function for every position along the line. There is no clipping - the endpoints may be anywhere at all. Three client values are carried around and passed into the user function.

## Return Value

All functions return 0 on success and -1 on error.

## See Also

im_insertplace(3X) , im_smudge(3X) .

## Copyright

National Gallery, 1992

## Author

J. Cupitt

Table of Contents

- Name
- Synopsis
- Description
- Return Value
- SeeAlso
- Copyright
- Author