Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!utgpu!water!watnot!watmath!clyde!rutgers!seismo!lll-lcc!pyramid!pesnta!phri!roy From: roy@phri.UUCP Newsgroups: comp.graphics Subject: Bounding boxes and drawing dashed vectors in SunView Message-ID: <2601@phri.UUCP> Date: Tue, 24-Feb-87 12:15:45 EST Article-I.D.: phri.2601 Posted: Tue Feb 24 12:15:45 1987 Date-Received: Fri, 27-Feb-87 05:22:32 EST Reply-To: roy@phri.UUCP (Roy Smith) Organization: Public Health Research Inst. (NY, NY) Lines: 42 I have two questions about the SunView pixrect package. First, is there an easy way to find the bounding box of a memory pixrect? By this I mean the smallest rectangle which encloses every non-zero pixel in the pixrect. We are trying to make movies on a Sun-3 by doing screendumps of the frames we want and then doing screenloads of each in turn. I have a little program which pr_load's all the screendump files and then pr_rop's them to /dev/fb one at a time, which works fine up to about 10 frames; then you run out of physical memory (on a [4-Meg] 3/50) and start thrashing. As long as you have enough physical memory, you can zap frames up on the screen plenty fast, but a 1 second movie isn't much fun. Most of the frames don't come close to the edges of the screen, so we could save a lot of core by just storing the area enclosed by the bounding box, and an x,y offset from the origin of the screen. The only way I can see to find the bounding box is by brute force raster scanning of the pixrect using pr_get(), but this is bound to be slow. Is there a faster way? My second question concerns drawing dashed vectors. I want to create a rubber-band effect (you paste down one endpoint of a vector, and drag the mouse to the other endpoint, with a dashed vector being drawn so you can see what it will look like when you release the mouse button). I tried the obvious way and drew the vectors through a 50% grey screen using pr_stencil, but the results are horrible looking and terribly slow as well. What I really want is a way to say "draw this vector with 10 pixels on, 10 pixels off, where the on-off pattern goes by arc length instead of x and y coordinates", just like PostScript's "setdash" operator. Actually, I then want to XOR this with a pixrect, so I can erase it easily when the mouse moves. My first though was to dive into pr_vector source and modify it to do what I want, but that would leave me with something I couldn't distribute except to other people with source licenses. -- 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!"