---
name: "im_readpoint"
section: "3"
platform: "linux"
package: "libvips-dev"
version: "7.20.7-1+b3"
release: "Debian 6.0 (Squeeze)"
platforms: ["linux"]
url: "https://new.carta.tech/im_paintrect"
---

# im\_readpoint(3)

suck pels up, and paint them down somewhere else

Part of [im\_paintrect(3)](/im_paintrect/3.md).

## 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\>**

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;

int im\_lineset( IMAGE \*in, IMAGE \*out, IMAGE \*mask, IMAGE \*ink,\
\
   int n, int \*x1v, int \*y1v, int \*x2v, int \*y2v )

## DESCRIPTION

**[im\_readpoint(3)](/im_readpoint/3.md)** 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(3)](/im_readpoint/3.md)** 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(3)](/im_plotmask/3.md)** takes an array of 0/255s 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(3)](/im_paintrect/3.md)** 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(3)](/im_fastline/3.md)** is a replacement for  **[im\_line(3)](/im_line/3.md)** which plots the specified ink in the image. The start and end points must lie entirely inside the image.

**[im\_fastlineuser(3)](/im_fastlineuser/3.md)** 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.

**[im\_lineset(3)](/im_lineset/3.md)** copies the image and draws a set of lines on the copy. The lines are drawn using the mask image as a brush to apply the ink image. Useful for nip2.

## RETURN VALUE

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

## SEE ALSO

[im\_insertplace(3)](/im_insertplace/3.md), [im\_smudge(3)](/im_smudge/3.md).

## COPYRIGHT

National Gallery, 1992

## AUTHOR

J. Cupitt
