File:  [Research Unix] / researchv9 / jtools / src / sunlib / getpoint.c
Revision 1.1.1.1 (vendor branch): download - view: text, annotated - select for diffs
Tue Apr 24 17:21:59 2018 UTC (8 years, 1 month ago) by root
Branches: belllabs, MAIN
CVS tags: researchv9-SUN3_old, researchv9-SUN3, HEAD
researchv9-SUN3(old)

#include "jerq.h"

/*
 * Read back the value of a pixel
 */
getpoint(b,p)
Bitmap *b;
Point p;
{
	int bit;
#ifdef X11
	XImage *im;

	if(b->flag & BI_OFFSCREEN)
		p = sub(p, b->rect.origin);
	im = XGetImage(dpy, b->dr, p.x,  p.y, 1, 1, 1, XYPixmap);
	bit = (*im->data != 0);
	XDestroyImage(im);
#endif X11
#ifdef SUNTOOLS
	if(b->flag & BI_OFFSCREEN) {
		p = sub(p, b->rect.origin);
		bit = (pr_get((Pixrect *)b->dr, p.x, p.y) != 0);
	} else
		bit = (pw_get((Pixwin *)b->dr, p.x, p.y) != 0);
#endif SUNTOOLS
	return (bit);
}

unix.superglobalmegacorp.com

This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.