Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!utgpu!water!watnot!watmath!clyde!cbatt!ihnp4!ptsfa!lll-lcc!pyramid!pesnta!phri!roy From: roy@phri.UUCP Newsgroups: comp.graphics Subject: Re: Bounding boxes and drawing dashed vectors in SunView Message-ID: <2605@phri.UUCP> Date: Fri, 27-Feb-87 21:07:46 EST Article-I.D.: phri.2605 Posted: Fri Feb 27 21:07:46 1987 Date-Received: Sun, 1-Mar-87 14:49:18 EST References: <2601@phri.UUCP> <2769@sdcsvax.UCSD.EDU> Reply-To: roy@phri.UUCP (Roy Smith) Organization: Public Health Research Inst. (NY, NY) Lines: 38 Summary: I guess I didn't make myself clear the first time. In <2601@phri.UUCP> I asked 1) how do I find the BoundingBox of an image in a pixrect and 2) how do I draw dashed vectors. In <2769@sdcsvax.UCSD.EDU> hutch@sdcsvax.UCSD.EDU (Jim Hutchison) writes: > include > struct pixrect *frame; > int high, wide; > ... initialize with pr_open(), pr_load(), etc. ... > wide = frame->pr_width; > high = frame->pr_height; This will find the size of the pixrect, which is *not* the same as the BoundingBox. The BoundingBox is the smallest rectangle which encloses all the *not-zero* pixels. Imagine a totally blank screen, except for a single dark pixel in the middle. Using the above method, you will get wide and high set to the size of the screen. The size of the BoundingBox, however, is 1 x 1. > As to your lines, why not just use simple XOR? O.k, O.k, > artistic ability must not be humbled. Well, how about replrop? > Make a small 4 box checkerboard and then use it as the source > for very narrow boxes (1 by x AND y by 1). That would do the > trick since you are only rubberbanding boxes. If I was only rubberbanding boxes (i.e. horizontal and vertical lines) this would work fine, and is essentially the same as what I did when I tried pr_stencil'ing through a 50% screen. The problem is that I want to do arbitrary vectors. This method gives ugly results at odd angles; in fact, at 45 degrees, the vector either is pure white or pure black, depending on the phase of the screen. On the other hand, I will want to rubber-band boxes eventually, and this sounds like a good way to do it. -- Roy Smith, {allegra,cmcl2,philabs}!phri!roy System Administrator, Public Health Research Institute 455 First Avenue, New York, NY 10016 "you can't spell deoxyribonucleic without unix!"