1. Faster way
- Posted by dubetyrant at hotmail.com Dec 25, 2002
- 410 views
Hello all, -------------------------------------------- Faster way? Don't know but you could try this... Regards, Mike integer wsColor wsColor = 255 image = (image = wsColor) * background + (image != wsColor) * image --This ones going to take a bit of study,are you saying I should approach it like I was doing one large operation on sequence "image" I didnt even know you could use inequality statements as operands. I would see if it couldn't be done in assy code, if you could get the pointers to the bitmaps. Aren't there some graphics libs in the archives in machine code? Kat --Thats one thing Ive got to do more is study the code in the archives closer,theres probably more than one library that would help.But as far as doing it myself in assembly,I dont know where to start. --your my new best friend,I would pay good money to hear stuff like that!(joke) Please do not apologise for being here; we need more of your type. Besides, watching another newbie smack their head into the same old brick wall [1] is always more instructive that listening to some old hack argue about some semicolon or other. Pete [1] as well as being funny [(;-P)] [2] only joking there, of course. --seriously your reply made my day,I appreciate the encouragement.Its hard to ask people to help you figure something out,knowing that you probably wont be able to return the favor anytime soon. you would simply overlay any whitespace found (255) with the image data at that same location. also you are using the 'length' function in your loop control statement. each time this statement is executed so would the length function be re-calculated. calculate it once prior to entering the loop would help. --I thought that the images came in as nested sequences,one sequence for each row on the display screen.But your reply made me think that if I somehow converted the multiple sequences into just one sequence somehow,it would make it faster to work on it.But Im not really sure that they do not just read in as one sequence. seqsize = length(image) for i = 1 to seqsize by 1 do if image[i] = 255 then image[i] = background[i] end if end for Merry Christmas and Happy New Year to All Euphorians Rudy lotterywars (untested) for i = 1 to length(image) do image_row = image[i] back_row = background[i] for j = 1 to length(image_row) do if image_row[j] != 255 then back_row[j] = image_row[j] end if end for background[i] = back_row end for --Thats pretty much what I was looking for, a way to speed up the comparison of two nested sequences with the same amount of elements.I worry about my code taking "the long way around" and I knew that if someone with more experience looked at how I was doing it they would probably know some tips right away. So thanks to all!! And merry Christmas to you and yours!!! -JDUBE