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.
Sorry for another commit after sending the pull request. It is to refactor around KinectStreamImpl and DepthKinectStream to achieve better encapsulation of Windows & NUI dependent details within KinectStreamImpl.
Here is the patch for the mirror mode support for the Kinect driver. I used #22 as the reference (my kudos to KHeresy).