23#ifndef VCL_RENDER_IO_CAMERA_LOAD_H
24#define VCL_RENDER_IO_CAMERA_LOAD_H
26#ifdef VCLIB_WITH_TINYGLTF
30#include <vclib/io/file_format.h>
31#include <vclib/io/mesh/gltf/capability.h>
47inline std::set<FileFormat> loadCameraFormats()
49 std::set<FileFormat> ff;
51#ifdef VCLIB_WITH_TINYGLTF
52 ff.insert(gltfFileFormat());
58template<CameraConcept CameraType = Camera<
float>>
59inline std::vector<CameraType> loadCameras(
const std::string& filename)
62#ifdef VCLIB_WITH_TINYGLTF
63 if (ff == gltfFileFormat())
64 return loadCamerasGltf<CameraType>(filename);
67 throw UnknownFileFormatException(ff.extensions().front());
70template<CameraConcept CameraType = Camera<
float>>
71inline CameraType loadCamera(
const std::string& filename)
73 auto cams = loadCameras<CameraType>(filename);
75 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