floating point ImageData?

Questions about the LÖVE API, installing LÖVE and other support related questions go here.
Forum rules
Before you make a thread asking for help, read this.
Post Reply
vjlove
Prole
Posts: 1
Joined: Thu Apr 30, 2015 3:54 am

floating point ImageData?

Post by vjlove »

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.
User avatar
slime
Solid Snayke
Posts: 3160
Joined: Mon Aug 23, 2010 6:45 am
Location: Nova Scotia, Canada
Contact:

Re: floating point ImageData?

Post by slime »

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.
Post Reply

Who is online

Users browsing this forum: Bing [Bot], Google [Bot] and 7 guests