Path: utzoo!utgpu!news-server.csri.toronto.edu!mailrus!tut.cis.ohio-state.edu!zaphod.mps.ohio-state.edu!samsung!emory!hubcap!ncrcae!ncr-sd!sagpd1!jharkins From: jharkins@sagpd1.UUCP (Jim Harkins) Newsgroups: comp.lang.c Subject: Bit map algorithms needed Message-ID: <789@sagpd1.UUCP> Date: 25 May 90 23:12:47 GMT Organization: Scientific Atlanta-GPD, San Diego Lines: 22 I need to implement what I think of as a sliding window over a long string of bits. I have a bitmap spread across several words and I need to find a set of N adjacent bits that are set, and it should easily cross word boundries. In other words, not only are bits 4 and 5 of word 0 adjacent, so are bits 31 of word 0 and bit 0 of word 1. My string of N adjacent bits can be up to 16 bits long, and the bitmap will probably be about 20 words long (at 32 bits per word, but portability would be nice). It's perfectly OK to look for the string in whole words before going back to span edges. That is, if word 0 is AAAA and word 1 is 5555 then it's ok to look for 2 adjacent bits in word 0, then word 1, then the boundry between the words. I think this kind of thing is used a lot in bit mapped graphics, so does anyone have an algorithm or pointer to an algorithm I can use? I'm running C on a 68000 chip, but portability would be nice. Thanks in advance. -- jim jharkins@sagpd1 I *still* don't know who killed Laura Palmer!