ReUseX  0.0.5
3D Point Cloud Processing for Building Reuse
Loading...
Searching...
No Matches
gsplat.hpp
Go to the documentation of this file.
1// SPDX-FileCopyrightText: 2026 Povl Filip Sonne-Frederiksen
2//
3// SPDX-License-Identifier: GPL-3.0-or-later
4
5#pragma once
6
7// Serving the Gaussian splats stored in a project (#322).
8//
9// `rux create gsplat` stores its trained model in the `.rux` project (schema
10// v12), exactly as `rux create mesh` stores a mesh, so these routes are
11// ordinary ProjectDB reads and follow the mesh routes shape for shape:
12// a listing, one record, and the blob.
13//
14// Framework-free like the rest of gui/api.hpp: these functions take a
15// ProjectDB and return JSON or bytes, and throw HttpError to signal failure.
16
17#include "gui/api.hpp"
18
19#include <string>
20#include <string_view>
21
22namespace reusex {
23class ProjectDB;
24}
25
26namespace rux::gui {
27
34inline constexpr uint64_t kMaxGsplatBytes = 1024ull * 1024ull * 1024ull;
35
42nlohmann::json gsplats_json(const reusex::ProjectDB &db, const Params &params);
43
46nlohmann::json gsplat_json(const reusex::ProjectDB &db, std::string_view name);
47
52Blob gsplat_blob(const reusex::ProjectDB &db, std::string_view name);
53
54} // namespace rux::gui
Already-decoded query parameters, so handlers never touch crow::request.
Definition api.hpp:118
constexpr uint64_t kMaxGsplatBytes
Upper bound on a splat blob this server will serve in one response.
Definition gsplat.hpp:34
nlohmann::json gsplat_json(const reusex::ProjectDB &db, std::string_view name)
GET /api/v1/gsplats/{name} — one splat's metadata.
nlohmann::json gsplats_json(const reusex::ProjectDB &db, const Params &params)
GET /api/v1/gsplats — every splat stored in the project, paged.
Blob gsplat_blob(const reusex::ProjectDB &db, std::string_view name)
GET /api/v1/gsplats/{name}/data — the INRIA .ply bytes, verbatim.
A non-JSON response body (image, mesh blob).
Definition api.hpp:100