void changeRegistration(int value) { openni::ImageRegistrationMode mode = (openni::ImageRegistrationMode)value; if (!g_device.isValid() || !g_device.isImageRegistrationModeSupported(mode)) { return; } g_device.setImageRegistrationMode(mode); }
void toggleImageRegistration(int) { openni::ImageRegistrationMode mode = g_device.getImageRegistrationMode(); openni::ImageRegistrationMode newMode = openni::IMAGE_REGISTRATION_OFF; if (mode == openni::IMAGE_REGISTRATION_OFF) { newMode = openni::IMAGE_REGISTRATION_DEPTH_TO_COLOR; } if (g_device.isImageRegistrationModeSupported(newMode)) { g_device.setImageRegistrationMode(newMode); } else { displayError("Couldn't change image registration to unsupported mode"); } }