OpenNI/OpenNI2 — pull request #32 by tomoto (2013-08-18 06:09:23+00:00)
Title: Mirror mode support for the Kinect driver

Here is the patch for the mirror mode support for the Kinect driver. I used #22 as the reference (my kudos to KHeresy).
* Color, Depth, and IR streams with any available pixel formats are supported.
* Sorry for rewriting a lot, but I thought it was necessary to eliminate too many copy-and-pasted frame copy loops. I applied template a lot to achieve this without impacting on the performance. It might look a little cumbersome or overusing at the first glance, but I believe it will contribute to the future maintainability.
* I tested every combination of {Color, Depth, IR} x {all available pixel formats} x {mirror on/off} x {cropping on/off} x {image registration on/off (Depth stream only)} through NIViewer, and all looked fine.
* I also quickly checked the performance around the Depth stream and did not notice any regression. (It even felt a bit faster, but I do not know why.)
* A couple of minor bugs (e,g, wrong calculation of dataSize of Depth stream when both image registration and cropping were on) are also fixed.