Page 1 of 1

copyHDRBuffer(float *buffer) malfunction(?) in sdk 11

Posted: Sun Dec 14, 2008 12:20 am
by fused
it seems that copyHDRBuffer(float *buffer) will only work if copyBuffer(indUChar8 *buffer) was called before. otherwise it will result in an access violation.

can someone confirm, or is it even intended?

edit: also, this function is not documented :)

Posted: Sun Dec 14, 2008 6:53 am
by fused
is there a special reason why the values are clamped to 1.0?

Posted: Sun Dec 14, 2008 8:46 pm
by OnoSendai
Crashing is never intended :)

Posted: Sun Dec 14, 2008 11:17 pm
by fused
:P

what i actually meant is if its not intended to be used without copyBuffer().
feel free to answer my other question, too, ono :)

Posted: Mon Dec 15, 2008 10:52 am
by OnoSendai
It should be able to be used independently of copyBuffer.

It shouldn't be clamped to 1.0.

Posted: Sat Dec 20, 2008 2:49 am
by suvakas
I have a question about the image buffer too. Don't want to make a new thread about it so i ask it here (i hope you don't mind).
What are the max and min values of the pixel color channel when I use:

copyBuffer(buffer);
r = (float)((const char*)buffer)[(y*w + x)*3];

I mean what's the possible lowest and what's the highest value of r?
I'm experimenting with some image filters here and I'm offten geting very funky colors. So i'm thinking i have to clamp my color values, but i'm not sure what are the legal max and min for r,g,b inside the buffer. Cause it seems, that they are not 0-255. Or are they?

Posted: Sat Dec 20, 2008 11:10 am
by OnoSendai
Yes, they're 0-255.
char can be signed, use unsigned char instead.

Posted: Sat Dec 20, 2008 12:09 pm
by suvakas
Thanks a million !
Unsigned char did the trick.