openframeworks/openFrameworks — pull request #1156 by prettyextreme (2012-04-09 20:52:22+00:00)
Title: ofImage Memory Reallocations

Streamline reallocation of memory in ofImage.

I have identified a few places in ofImage where it seems that pixel and texture memory was being reallocated in places that were not necessary, that is: when "allocating" memory of the same size as previously allocated. I have not tested these changes extensively, though they are fairly minor and logically easy-to-follow.

These changes provide a drastic speed increase when using setFromPixels() to repeatedly load pixels of the same width/height/bitdepth as one might do when playing back a image/frame sequence.