I'm trying to render RGB image from PXCImage::ImageData, and see some issues:
Step 1. set RGB resolution to 320x240, I get pitch: 640, and data layout of each pixel is RGBA. The rendered image is wrong(see attached image)
two questions here:
1. why the pitch is 640? 640 bytes means 160 words in this case(32bit RGB), but the image width is 320 words,
I guess the pitch should be higher or equal to image width(unit: bytes)?
2. according to the comment, COLOR_FORMAT_RGB32 data layout on little endian machine is BGRA, but it's different from
what I really see: RGBA.
Step 2: change resolution to 640x480, now the pitch becomes 1920(480*4, not 640*4), and the color order is wrong.
Step 3: I try depth image, resolution is 320x240, and I got pitch 640(320*2, knowing 2 bytes for each pixel). So depth image is correct.
The Capture viewer tool works well, so there is something wrong with the way I render it.
When I turned to help from documents, I realized that the description about ImageData on local document is out date than the one online.
Is there any sample showing how to render color image from ImageData(planes, specifically)? Or anyone knows what's wrong with it?
Thank you very much!