Loading, displaying and saving a ofShortImage.

Hi!
Ever since I was told to use ofShortImage for the kinect’s RAW depth I’ve been wondering the following. Keep in mind that I’m just starting to use ofShortImage and I’m very curious about functionality.

1-How would one make a 16 bit greyscale color image on something like Photoshop and what would be a correct file type for it so it can be opened in openF, PNG with 16 bits maybe?
2-For a Color+Depth, RGB-D, that would mean a 8+8+8+16 bits for all the information, right? (I know RAW depth is 11bit)
3-The previous would make it a 40 bit per pixel image? is this a standard?
4-Since I have no 16 bit per color image file, how would I have to look for one on the web and are they loaded just like any other image on openFrameworks? 16*4 = 64bit channel image, can I even display this?
5-When I draw an ofShortImage on screen is it downsampled in order to acomodate to the display? Is this done by openF, openGL or by the hardware driver? What about dithering options?
6-Can a ofShortImage be saved using openFrameworks onto a file while maintaining its bits per channel?

I know it is a lot but I’ve found very little info on ofShortImage even by reading the .h and .cpp and I’m trying to work out a way of using RGB-D as a whole rather than separating it into RGB and D.

Thanks everyone! :smiley:

I’ll try to answer a few of these:

It’s not really a 40 bit image, it is 40 bits total but that’s not how it’s all packed together.

It’s just a grayscale 16 bit image, you can create one in photoshop if you want. FreeImage works fine with loading 16 bit images, so yes, you can display one in OF.

The image isn’t down sampled, it’s just loaded as a GL_RGB16 texture.

Hope that helps a little.

Thank you Joshua!
Yes it does help a lot so thank you. :smiley:

@joshua noble
Ok now I think I get it! I was getting confused with video color spaces with 16 bit color (555) or 24 (888) and UYVY and all that stuff, so thanks to you I went ahead and read more about openGL color spaces and now I get that GL_RGB16 is actually 16 bits per component and not 16 bits for all, so that is perfect for me.

But this does leave me with two questions. ofSetColor(int r, int g, int b) uses values from 0-255. That would be 8bit color, an appropiate colorspace for that would be GL_RGB8, right?
What if one wanted to ofSetColor() with more precision?
Just curious about it, I don’t think I would need such precision.

you can do ofSetColor(ofShortColor(r,g,b)); where r,g,b would be shorts or use ofFloatColor with floats between 0…1

Great! Thanks to you I found it. :stuck_out_tongue:

  
typedef ofColor_<unsigned char> ofColor;  
typedef ofColor_<float> ofFloatColor;  
typedef ofColor_<unsigned short> ofShortColor;  

Thanks arturo.