Loading...
Searching...
No Matches
SplatBinary.hpp
1#pragma once
2
3#include <ossia/dataflow/geometry_port.hpp>
4
5#include <string_view>
6
7namespace Threedim::PrimitiveCloud
8{
9
10// Parse an Antimatter15 .splat file (32 bytes per primitive,
11// fixed schema).
12//
13// On-disk row layout (little-endian, packed, no padding):
14// bytes 0..11 position xyz, 3 × float32
15// bytes 12..23 scale_xyz, 3 × float32 (linear, NOT log-space)
16// bytes 24..27 color rgba, 4 × uint8 unorm
17// bytes 28..31 rotation quat, 4 × uint8 (sign-encoded as
18// (q + 1) * 127.5 around index 0; recipient
19// reconstructs by (b - 128) / 128)
20//
21// We pass these bytes through verbatim. The "3dgs.splat-binary" preset's
22// CSF declares the matching LAYOUT, dequantizes color8 to color, and
23// reconstructs the quat from the int8s.
24//
25// Returns nullptr if `bytes.size() % 32 != 0` or the input is empty.
26ossia::primitive_cloud_component_ptr parse_splat_binary(std::string_view bytes);
27
28} // namespace Threedim::PrimitiveCloud