On Tue, Nov 9, 2010 at 8:34 PM, Brendan Bolles
<address@hidden> wrote:
On Oct 22, 2010, at 4:21 AM, Ronny Spiegel wrote:
> char *tmpBuf = new char[width * height * getPixelSize(channel.channel().type) * 2];
> buffers.push_back(tmpBuf);
>
> // calculate the address of pixel (0,0)
> char *base = tmpBuf + (getPixelSize(channel.channel().type) * (sz.min.x - sz.min.y * width));
I think your bug might be this (in patch form):
- char *base = tmpBuf + (getPixelSize(channel.channel().type) * (sz.min.x - sz.min.y * width));
+ char *base = tmpBuf + (getPixelSize(channel.channel().type) * (-sz.min.x - (sz.min.y * width));
Also, not sure why you have * 2 at the end of your memory allocation up there.
Brendan