Open johanjohan opened 5 years ago
Yeah, check out here for loading into a texture. https://github.com/openframeworks/openFrameworks/blob/638a6cb9a09005d3bbc860f1cb312a435819eca1/libs/openFrameworks/gl/ofCubeMap.cpp#L332
I had to do some checks for OPENGL_ES since some versions or platforms didn't like GL_RGB32F and values over a certain limit would cause strange issues.
float* fPixData = fpix.getData();
unsigned int numFs = fw * fh * fpix.getNumChannels();
for( unsigned int i = 0; i < numFs; i++ ) {
// clamp to the maximum value of float16, medium precision
if(fPixData[i] > 65504.f) {
fPixData[i] = 65504.f;
}
}
Using ofLoadImage( texture, "img.hdr" ) to load a texture should be supported as well. https://github.com/openframeworks/openFrameworks/blob/638a6cb9a09005d3bbc860f1cb312a435819eca1/libs/openFrameworks/graphics/ofImage.cpp#L361-L382
@janimatic I've updated your tests and pushed code to ofTests repo. it seems 16bit resize is still not working
@dimitre nice find, i'll take a look asap! Talking about the current hdr support in ofImage, I believe (I might be wrong) :
@dimitre
i just looked quickly at the new test...
but resizeIOTest_ofImage<float>(thumbnailProxy, "Digital_LAD_HD720_16bit.png");
is using ofImage so the resize is done with FreeImage, not OF if i am not mistaken.
We could try to do the resize though of pixels by loading 16 bits with stb though... (or even simpler, loading float pixels from 16 bits pixels in stb : didn't resizeIOTest_ofPixels<float>(thumbnailProxy, "Digital_LAD_HD720_16bit.png");
work ?)
I think this issue can be tested again with latest master so we know if it can be closed already
Since ofPixels.cpp has not been updated for over a year in the master branch, i therefore assume the following issue has not been fixed. i am using of 0.10.1 with win10 vs2017.
I am resizing images/pixels with the following function. That leads to issues:
calling the same function using image.resize() produces best results
question: i assume that i may use pixelsRes = _pixels; to create a full twin copy, right? if yes, then there is the described issue in the pixel resizeTo() function.
CODE: