Banks and Images

Blitz3D Forums/Blitz3D Programming/Banks and Images

Nicstt(Posted 2005) [#1]
Just wondering
As i need to perform a large number of operations on images, to speed the process up, is there a way of getting an image into a bank so I can use the bank to quicken the process?


jfk EO-11110(Posted 2005) [#2]
There is a hack, that uses RTLMemoryMove (trough decls) to make a bank handle point straigt to an images space.

From an older thread:
BTW the Imagebuffer hack is based on the fact that Imagebuffer(img)+72 returns the Image Data adress. (Of course, pretty dirty code) A Bank handle has its data adress at offset 4 (bank+4) and the size of the bank at offset 8. So it's possible to steal/bend a bank handles vector and redirect it to an Image Buffer, by writing the adress of the imagebuffers data adress to bank+4 and the size of the image to bank+8 (using RTLMoveMemory). You can then use Userlib commands to receive data directly in a blitz image buffer. Of course, prior program termination the bank should be restored to it's original state (so the content of bank+4 and bank+8 after creation must be backed up.



See Toms original Thread:
http://www.blitzbasic.com/Community/posts.php?topic=30480


big10p(Posted 2005) [#3]
As i need to perform a large number of operations on images, to speed the process up, is there a way of getting an image into a bank so I can use the bank to quicken the process?

I've just needed to do something similar myself. I just ReadPixelFast into a bank, process bank image, then WritePixelFast the data back to the image. Is this too slow for your needs?


Nicstt(Posted 2005) [#4]
yeh too slow really, i need the colour values, and on very large files takes 30 plus minutes. Its ok on sprite sized images, but I just want to speed it up.