Quote:

Tony, wanna post a brief description of your current method?


Okay. I'm merging the foreground (text) with the background (player screen.) It's basically 4 nested for() loops, the innermost two of which can short-circuit if we decide that the current pixel we'll be working on needs to be "burned in" (set to black.)

The loops are, basically:

for each row in the text (foreground) bitmap
for each column in the text (foreground) bitmap
for (one column to the left, this column, one column to the right)
for (one row above, this row, one row below)

The innermost two make up 9 total iterations per pixel in the image, but we don't do anything with the middle pixel. Within these loops, the algorithm is basically "if any one of the eight surrounding pixels in the foreground is not black, make this pixel in the background black, and if we do that, short-circuit the rest of the loops." So best-case is 4096 full loop iterations, worst-case is 32,768 (4096 * 8.)

If anyone can think of a simpler way, by all means share it (and feel free to send a patch.)


Edited by tonyc (29/07/2004 19:23)
_________________________
- Tony C
my empeg stuff