zawran, any chance you can post a link? I found this one which sounds similar but the .rar that downloads seems to be corrupt.
"You could use a bank, but they are not as fast as arrays."
OK this saves me some testing time, thanx. although it does seem a bit dumb that direct memory access is slower than arrays, after all what is a CPU for!
"Actually I think there is a way to redimension an array in Blitz now that I think of it... But I think you can't then access X,Y with it, you will have to do Y*Width + X, which actually would be another speed boost because you can move the Y*Width outside the X loop. Heck, you can get rid of it entirely if you just increment the offset every pixel now that I think of it. But one multiply every row isn't a big problem."
Yup, I thought the same thing, increment a counter for each pixel read, store the values in a linear array. In delphi instead of writing var = var + 1 you can write Inc(var) which compiles to assembly which is nice and fast!
I have heard something about redimensioning arrays but I can't think where. A bummer for me is that you can't make a Type with a dimension as a field but on BlitzCoder I read about an undocumented feature called BlitzArray (has anyone used this?). It seems that you CAN use this as part of a Type which means you could make a new Image Type that stores the pixels in a BlitzArray. (I hope Blitz frees it properly!) Then you could write your own handling functions and improve on the "Fast" pixel routines. I'll look into it and post any results back.
P.S. can anyone tell me how to reference some text from another post in that grey box?
<a href="http://www.blitzcoder.com/cgi-bin/showcase/showcase_showentry.pl?id=grable07182003232217&comments=no" target="_blank">http://www.blitzcoder.com/cgi-bin/showcase/showcase_showentry.pl?id=grable07182003232217&comments=no</a>The posts infer you may be able to Poke and Peek an image buffer with Ints which sounds great (If it's that simple ;-) ).
"You could use a bank, but they are not as fast as arrays."
OK this saves me some testing time, thanx. although it does seem a bit dumb that direct memory access is slower than arrays, after all what is a CPU for!
"Actually I think there is a way to redimension an array in Blitz now that I think of it... But I think you can't then access X,Y with it, you will have to do Y*Width + X, which actually would be another speed boost because you can move the Y*Width outside the X loop. Heck, you can get rid of it entirely if you just increment the offset every pixel now that I think of it. But one multiply every row isn't a big problem."
Yup, I thought the same thing, increment a counter for each pixel read, store the values in a linear array. In delphi instead of writing var = var + 1 you can write Inc(var) which compiles to assembly which is nice and fast!
I have heard something about redimensioning arrays but I can't think where. A bummer for me is that you can't make a Type with a dimension as a field but on BlitzCoder I read about an undocumented feature called BlitzArray (has anyone used this?). It seems that you CAN use this as part of a Type which means you could make a new Image Type that stores the pixels in a BlitzArray. (I hope Blitz frees it properly!) Then you could write your own handling functions and improve on the "Fast" pixel routines. I'll look into it and post any results back.
P.S. can anyone tell me how to reference some text from another post in that grey box?