floating point ImageData?
Forum rules
Before you make a thread asking for help, read this.
Before you make a thread asking for help, read this.
floating point ImageData?
It seems that Canvas:getImageData() always converts the pixels to UNSIGNED_BYTE, probably since ImageData wants it that way. Is there anyway I can get access to the floating point pixel data in my 'rgba32f' Canvas, from Lua? I know I can get there in a shader, but that also won't let me 'export' the data to Lua. Or is there another way? Also would like to get the f.p. Canvas contents into a .HDR or similar file format...but the raw floats would be okay. I guess I can write a version of Canvas::newImageData() in C++ that doesn't do the pixel format conversion, but I'm hoping to stay in Lua.
- slime
- Solid Snayke
- Posts: 3163
- Joined: Mon Aug 23, 2010 6:45 am
- Location: Nova Scotia, Canada
- Contact:
Re: floating point ImageData?
There isn't any way at the moment.
I guess you could draw the Canvas to a separate rgba8 canvas using the "replace" [wiki]BlendMode[/wiki] and a pixel shader which outputs pixel colors in the RGBE (RGB plus a shared exponent in the alpha channel) format, which is what .hdr files use I believe.
I guess you could draw the Canvas to a separate rgba8 canvas using the "replace" [wiki]BlendMode[/wiki] and a pixel shader which outputs pixel colors in the RGBE (RGB plus a shared exponent in the alpha channel) format, which is what .hdr files use I believe.
Who is online
Users browsing this forum: Bing [Bot], Nikki and 2 guests