Path: utzoo!utgpu!news-server.csri.toronto.edu!mailrus!uwm.edu!ux1.cso.uiuc.edu!ux1.cso.uiuc.edu!m.cs.uiuc.edu!sunb4!mcooper From: mcooper@sunb4.cs.uiuc.edu Newsgroups: comp.graphics Subject: bit masks Message-ID: <23900013@sunb4> Date: 29 Aug 90 18:11:00 GMT Lines: 59 Nf-ID: #N:sunb4:23900013:000:1566 Nf-From: sunb4.cs.uiuc.edu!mcooper Aug 29 13:11:00 1990 I'm looking for an algorithm (or C code, of you have it) to generate 16 x 16 bit masks. Ideally, I should be able to specify a percentage and the program should spit out the pattern filled appropriately. ie. 100% yeilds 1111111111111111 1111111111111111 1111111111111111 1111111111111111 1111111111111111 1111111111111111 1111111111111111 1111111111111111 1111111111111111 1111111111111111 1111111111111111 1111111111111111 1111111111111111 1111111111111111 1111111111111111 1111111111111111 This is no problem to write,m but the simple way gives you nasty artifacts such as: 25 % yeilds 1000100010001000 1000100010001000 1000100010001000 1000100010001000 1000100010001000 1000100010001000 1000100010001000 1000100010001000 1000100010001000 1000100010001000 1000100010001000 1000100010001000 1000100010001000 1000100010001000 1000100010001000 1000100010001000 Does anyone have code that will properly randomize this stuff to avoid the inevitable artifacts and moire patterns? +-------------------------------------+---------------------------------------+ | "When the going gets weird, | | | the weird turn pro." | Marc Cooper marcc@ncsa.uiuc.edu | | | National Center for Supercomputing | | -Hunter S. Thompson | Applications | +-------------------------------------+---------------------------------------+ | Disclaimer: "It's mine! It's all mine!!" -D. Duck | +-----------------------------------------------------------------------------+