From 7b049a9d65ebefcc5c488bb4d7b741b0aafb07c2 Mon Sep 17 00:00:00 2001 From: Jakob Bornecrantz Date: Wed, 8 Apr 2020 00:59:10 +0100 Subject: [PATCH] t/file: Expose non-hack version of the calibration data save function --- doc/changes/aux/mr.266.3.md | 1 + src/xrt/auxiliary/tracking/t_file.cpp | 8 +++++--- src/xrt/auxiliary/tracking/t_tracking.h | 10 +++++++++- src/xrt/state_trackers/gui/gui_scene_calibrate.c | 2 +- 4 files changed, 16 insertions(+), 5 deletions(-) create mode 100644 doc/changes/aux/mr.266.3.md diff --git a/doc/changes/aux/mr.266.3.md b/doc/changes/aux/mr.266.3.md new file mode 100644 index 000000000..69a23a727 --- /dev/null +++ b/doc/changes/aux/mr.266.3.md @@ -0,0 +1 @@ +tracking: Expose save function with none hardcode path for calibration data. diff --git a/src/xrt/auxiliary/tracking/t_file.cpp b/src/xrt/auxiliary/tracking/t_file.cpp index 1c807fa77..aecf31c3b 100644 --- a/src/xrt/auxiliary/tracking/t_file.cpp +++ b/src/xrt/auxiliary/tracking/t_file.cpp @@ -268,7 +268,8 @@ t_stereo_camera_calibration_load_v1( */ extern "C" bool -t_file_save_raw_data(FILE *calib_file, struct t_stereo_camera_calibration *data) +t_stereo_camera_calibration_save_v1(FILE *calib_file, + struct t_stereo_camera_calibration *data) { StereoCameraCalibrationWrapper wrapped(data); // Dummy matrix @@ -343,7 +344,8 @@ t_stereo_camera_calibration_load_v1_hack( } extern "C" bool -t_file_save_raw_data_hack(struct t_stereo_camera_calibration *data) +t_stereo_camera_calibration_save_v1_hack( + struct t_stereo_camera_calibration *data) { char path_string[PATH_MAX]; char file_string[PATH_MAX]; @@ -366,7 +368,7 @@ t_file_save_raw_data_hack(struct t_stereo_camera_calibration *data) return false; } - t_file_save_raw_data(calib_file, data); + t_stereo_camera_calibration_save_v1(calib_file, data); fclose(calib_file); diff --git a/src/xrt/auxiliary/tracking/t_tracking.h b/src/xrt/auxiliary/tracking/t_tracking.h index 0a56f523c..533e42032 100644 --- a/src/xrt/auxiliary/tracking/t_tracking.h +++ b/src/xrt/auxiliary/tracking/t_tracking.h @@ -185,12 +185,20 @@ bool t_stereo_camera_calibration_load_v1_hack( struct t_stereo_camera_calibration **out_data); +/*! + * Save the given stereo calibration data to the given file. + */ +bool +t_stereo_camera_calibration_save_v1(FILE *calib_file, + struct t_stereo_camera_calibration *data); + /*! * Save raw calibration data to file, hack until prober has storage for such * things. */ bool -t_file_save_raw_data_hack(struct t_stereo_camera_calibration *data); +t_stereo_camera_calibration_save_v1_hack( + struct t_stereo_camera_calibration *data); /* diff --git a/src/xrt/state_trackers/gui/gui_scene_calibrate.c b/src/xrt/state_trackers/gui/gui_scene_calibrate.c index 8d4b116db..14589cbf4 100644 --- a/src/xrt/state_trackers/gui/gui_scene_calibrate.c +++ b/src/xrt/state_trackers/gui/gui_scene_calibrate.c @@ -66,7 +66,7 @@ save_calibration(struct calibration_scene *cs) } // Save the data. - t_file_save_raw_data_hack(cs->status.stereo_data); + t_stereo_camera_calibration_save_v1_hack(cs->status.stereo_data); // Free data, no longer needed. t_stereo_camera_calibration_reference(&cs->status.stereo_data, NULL); -- 2.51.2