🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: rec.games.programmer
Article #1708

Re: Xlib Clipping Revisited

#1708
From: Court Demas
Date: Wed, 16 Dec 1992 00:20
28 lines
2126 bytes
Excerpts from netnews.rec.games.programmer: 14-Dec-92 Re: Xlib Clipping
Revisited Kludge@hardy.u.washingto (1673)

>   I *really* doubt it works for compiled bitmaps - how do you clip code? :)
> Maybe there should be a new type of compiled bitmap that does clipping
> automatically, but I bet that wouldn't have much of a speed advantage over
> regular bitmaps - and they'd be about 8 times as large. 

I actually fooled around with this a bit, and I think it might be
possible.  At least horizontal clipping seems fairly easy - you have a
set on instructions n-bytes long broken into sections of each scanline. 
Just compute the top line and jump into the correct section, and then
check at the end of each line to see if you should cut out (could get a
little hairy though if you wanna do it really fast (self-modifying code,
blech)).  Clipping vertically would take a bit more work but it's
basically the same concept.  Has anybody else played with this?

>   Don't give up on lines, though.  They're pretty easy to write a clipping
> routine, though it's been a while since I tried.  There are quite a few
> books with algorithms for clipping lines in them.  It also looks as if
> the XLib line drawing algorithm could be sped a bit, but I'm not sure.

Maybe implementing the "enhanced" bresenham's (or whatever it's called)
would make it faster - precomputing the length of the spans and such. 
Tricky to implement though (I think Abrash wrote something about this).

> 							-Kludge
-court
Technical Details
Message-ID: <cf=bNLK00Vp=MOqlUB@andrew.cmu.edu>
Path: arc1-ca.pugleaf.net!sparky!uunet!spool.mu.edu!uwm.edu!linac!pacific.mps.ohio-state.edu!cis.ohio-state.edu!news.sei.cmu.edu!fs7.ece.cmu.edu!crabapple.srv.cs.cmu.edu!andrew.cmu.edu!cd2a+
References: <Bz9Fr7.5uy@phage.cshl.org> <1992Dec14.221838.10200@u.washington.edu>

Show Full Headers
Complete Article Headers
Organization: Junior, Math/Computer Science, Carnegie Mellon, Pittsburgh, PA
Path: arc1-ca.pugleaf.net!sparky!uunet!spool.mu.edu!uwm.edu!linac!pacific.mps.ohio-state.edu!cis.ohio-state.edu!news.sei.cmu.edu!fs7.ece.cmu.edu!crabapple.srv.cs.cmu.edu!andrew.cmu.edu!cd2a+
Newsgroups: rec.games.programmer
Message-ID: <cf=bNLK00Vp=MOqlUB@andrew.cmu.edu>
Date: Tue, 15 Dec 1992 19:20:39 -0500 
From: Court Demas <court+@CMU.EDU>
Subject: Re: Xlib Clipping Revisited
In-Reply-To: <1992Dec14.221838.10200@u.washington.edu>
References: <Bz9Fr7.5uy@phage.cshl.org>
 <1992Dec14.221838.10200@u.washington.edu>
Lines: 30