cesium-native/extern/vcpkg/ports/spz/loadSpz.patch

30 lines
1.2 KiB
Diff

diff --git a/src/cc/load-spz.cc b/src/cc/load-spz.cc
index e028445..7388d56 100644
--- a/src/cc/load-spz.cc
+++ b/src/cc/load-spz.cc
@@ -635,6 +635,10 @@ GaussianCloud loadSpz(const std::vector<uint8_t> &data, const UnpackOptions &o)
return unpackGaussians(loadSpzPacked(data), o);
}
+GaussianCloud loadSpz(const uint8_t *data, int32_t size, const UnpackOptions &o) {
+ return unpackGaussians(loadSpzPacked(data, size), o);
+}
+
bool saveSpz(const GaussianCloud &g, const PackOptions &o, const std::string &filename) {
std::vector<uint8_t> data;
if (!saveSpz(g, o, &data)) {
diff --git a/src/cc/load-spz.h b/src/cc/load-spz.h
index a624f45..a10e696 100644
--- a/src/cc/load-spz.h
+++ b/src/cc/load-spz.h
@@ -73,6 +73,9 @@ bool saveSpz(
// Loads Gaussian splat from a vector of bytes in packed format.
GaussianCloud loadSpz(const std::vector<uint8_t> &data, const UnpackOptions &options);
+// Loads Gaussian splat from a byte pointer in packed format.
+GaussianCloud loadSpz(const uint8_t *data, int32_t size, const UnpackOptions &options);
+
// Loads Gaussian splat from a vector of bytes in packed format.
PackedGaussians loadSpzPacked(const std::string &filename);
PackedGaussians loadSpzPacked(const uint8_t *data, int32_t size);