I have an application where I receive streaming data through bluetooth and would like to display the streamed data in an image. The data is just RGB values (0-255 for RGB). It’s working fine in C#, but I’m having trouble doing the same thing on the iphone. In C# it’s being implemented as a queue. When a new row of data arrives, I dequeue one row worth of pixels, then enqueue the new row of pixels. I then write the queue to the image pixel array. This seemed like it would be faster than reading the entire image, shifting it, adding new data, then writing the pixel array. In C# there is a method that allows me to convert a queue to an array, since a queue won’t have contiguous memory. My question is, is there a faster way to do this than manually repopulating an array from a queue? Or is there a faster way than using a queue? The image only needs to shift down X number of pixels, then write X number of new pixels to the blank spot in the image. Either way, I can’t figure out how to convert the queue to an array, since the only way to access anything besides the first value is by taking values off of the queue. Any suggestions?
I have an application where I receive streaming data through bluetooth and would like
Share
The bottleneck on iOS devices won’t be in converting a queue to an array, but in getting the bitmap array into the device’s display (image or texture) memory. This path can be optimized by using a tiled layer, and only updating the pixels at the end of the end tiles. Then you can scroll the tiled layer inside a scroll view to line up the latest streamed data.