23#ifndef VCL_IO_CAMERA_LOAD_H
24#define VCL_IO_CAMERA_LOAD_H
26#ifdef VCLIB_WITH_TINYGLTF
30#include <vclib/io/file_format.h>
32#ifdef VCLIB_WITH_TINYGLTF
33#include <vclib/io/mesh/gltf/capability.h>
36#include <vclib/space/core.h>
52inline std::set<FileFormat> loadCameraFormats()
54 std::set<FileFormat> ff;
56#ifdef VCLIB_WITH_TINYGLTF
57 ff.insert(gltfFileFormat());
63template<CameraConcept CameraType = Camera<
float>>
64std::vector<CameraType> loadCameras(
const std::string& filename)
67#ifdef VCLIB_WITH_TINYGLTF
68 if (ff == gltfFileFormat())
69 return loadCamerasGltf<CameraType>(filename);
72 throw UnknownFileFormatException(ff.extensions().front());
75template<CameraConcept CameraType = Camera<
float>>
76CameraType loadCamera(
const std::string& filename)
78 auto cams = loadCameras<CameraType>(filename);
80 throw std::runtime_error(
"No cameras in file: " + filename);
static FileFormat fileFormat(const std::string &filename)
Get the file format of a file from its filename.
Definition file_info.h:280