1. Masking Pictures
- Posted by Mike Fowler <stoner at NELSUN.GEN.NZ>
May 30, 1997
-
Last edited May 31, 1997
Hi all
i have altered display_image a bit so you can have masks (colours that
are 'clear'). (copy & paste it out of the bottom of this message...)
its really simple: masked_image({x, y}, image_sequence, mask_color)
eg: masked_image({100, 200}, face, 14)
would display the image just like display_image, but all pixels of the
colour 14 would not be drawn, so seeming 'clear' :)
hope its a help to someone...
PS: it will probibally be slower than display_image, because it draws
the pictures pixel-by-pixel, not line-by-line. :(
Mike Fowler - mike.fowler at nelsun.gen.nz
o__ ---
_,>/'_ ---
(_) \(_) ---
Tip for the month: Buy a paper schredder for cutting cabbages.
-- [CODE START HERE] --
global procedure masked_image(sequence xy, sequence pixels, atom mask)
-- display a 2-d sequence of pixels at location xy,
-- with "mask" being clear
-- N.B. coordinates are {x, y} with {0,0} at top left of screen
-- and x values increasing towards the right,
-- and y values increasing towards the bottom of the screen
-- eg: image_masked({100, 100}, face, 15) draws the picture 'face' with
-- all pixels the color '15' left as clear.
for i = 1 to length(pixels) do
for i2 = 1 to length(pixels[i]) do
if pixels[i][i2] = mask_color then
xy[1] = xy[1] + 1
else
machine_proc(4, {pixels[i][i2], xy})
xy[1] = xy[1] + 1
end if
end for
xy[1] = xy[1] - length(pixels[i])
xy[2] = xy[2] + 1
end for
end procedure
-- [CODE ENDS HERE] --
2. Re: Masking Pictures
- Posted by Mike Fowler <stoner at NELSUN.GEN.NZ>
Jun 01, 1997
-
Last edited Jun 02, 1997
-> > Hi all
-> >
-> > i have altered display_image a bit so you can have masks (colours that
-> > are 'clear'). (copy & paste it out of the bottom of this message...)
-> >
-> Hi!
-> I missed getting the full routine - perhaps other readers of the Eu
-> list have as well.
yeah i get my e-mail through a bulliten borad, and its mail failed while
the sysop was away:(... so it stuffed that message bit :(.. sorry bout
that..
-> Would you consider posting it on my uphoria ftp site? That way, it would
-> be available in the future to anyone who needs it.
-> It is: http://www.mindspring.com/~mountains for the web page access,
-> or ftp://ftp.mindspring.com/users/mountains/incoming
okay, consider it done :)
Mike Fowler - mike.fowler at nelsun.gen.nz
o__ ---
_,>/'_ ---
(_) \(_) ---
Tip for the month: Buy a paper schredder for cutting cabbages.