1 // This file is part of OpenMVG, an Open Multiple View Geometry C++ library. 2 3 // Copyright (c) 2015 Pierre Moulon. 4 5 // This Source Code Form is subject to the terms of the Mozilla Public 6 // License, v. 2.0. If a copy of the MPL was not distributed with this 7 // file, You can obtain one at http://mozilla.org/MPL/2.0/. 8 9 #ifndef OPENMVG_SFM_SFM_VIEW_HPP 10 #define OPENMVG_SFM_SFM_VIEW_HPP 11 12 #include <string> 13 14 #include "openMVG/types.hpp" 15 16 namespace openMVG { 17 namespace sfm { 18 19 /// A view define an image by a string and unique indexes for the view, the camera intrinsic & the pose 20 struct View 21 { 22 // image path on disk 23 std::string s_Img_path; 24 25 // Id of the view 26 IndexT id_view; 27 28 // Index of intrinsics and the pose 29 IndexT id_intrinsic, id_pose; 30 31 // image size 32 IndexT ui_width, ui_height; 33 34 // Constructor (use unique index for the view_id) ViewopenMVG::sfm::View35 View( 36 const std::string & sImgPath = "", 37 IndexT view_id = UndefinedIndexT, 38 IndexT intrinsic_id = UndefinedIndexT, 39 IndexT pose_id = UndefinedIndexT, 40 IndexT width = UndefinedIndexT, IndexT height = UndefinedIndexT) 41 :s_Img_path(sImgPath), id_view(view_id), id_intrinsic(intrinsic_id), 42 id_pose(pose_id), ui_width(width), ui_height(height) 43 {} 44 45 virtual ~View() = default; 46 47 /** 48 * Serialization out 49 * @param ar Archive 50 */ 51 template <class Archive> 52 void save( Archive & ar ) const; 53 54 /** 55 * @brief Serialization in 56 * @param ar Archive 57 */ 58 template <class Archive> 59 void load( Archive & ar ); 60 }; 61 62 } // namespace sfm 63 } // namespace openMVG 64 65 #endif // OPENMVG_SFM_SFM_VIEW_HPP 66