This commit is contained in:
ZY4N
2024-12-22 16:58:40 +01:00
parent 2704814de2
commit db8db8f9d7
161 changed files with 17102 additions and 0 deletions

View File

@@ -0,0 +1,53 @@
#pragma once
#include <filesystem>
#include <vector>
#include <span>
#include "assets/dynamic_data_store.hpp"
#include "assets/components/point_cloud_vertex_components.hpp"
#include "assets/dynamic_read_buffers/dynamic_point_cloud_buffer.hpp"
#include "assets/dynamic_data_stores/dynamic_point_cloud_store.hpp"
#include "assets/prefetch_lookup.hpp"
#include "assets/prefetch_queue.hpp"
#include "glm/mat4x4.hpp"
#include "util/result.hpp"
struct kitti_loader
{
static constexpr auto name = std::string_view("kitti");
[[nodiscard]] static std::error_code prefetch(
const file_dir_list& paths,
prefetch_queue& queue
);
[[nodiscard]] static std::error_code load(
dynamic_point_cloud_buffer& buffer,
const file_dir_list& paths,
prefetch_lookup& id_lookup,
dynamic_data_store& store,
bool pedantic = false
);
private:
inline static constexpr auto frame_folder = "frames";
[[nodiscard]] static ztu::result<std::size_t> frame_id_from_filename(
std::string_view filename
);
[[nodiscard]] static std::error_code load_point_file(
const std::filesystem::path& filename,
dynamic_point_cloud_buffer& point_cloud
);
static void transform_point_cloud(
std::span<components::point_cloud_vertex::position> points,
const glm::mat4& pose
);
[[nodiscard]] static ztu::result<std::string_view> parent_directory(std::string_view path);
};