#ifndef SPATIAL_CODEC_DRACO_WRAPPER_H
#define SPATIAL_CODEC_DRACO_WRAPPER_H
#include <stdbool.h>
#include <stddef.h>
#include <stdint.h>
#ifdef __cplusplus
extern "C" {
#endif
typedef enum DracoWrapperPcEncodingMethod {
DRACO_WRAPPER_POINT_CLOUD_SEQUENTIAL_ENCODING = 0,
DRACO_WRAPPER_POINT_CLOUD_KD_TREE_ENCODING = 1,
} DracoWrapperPcEncodingMethod;
typedef struct DracoWrapperEncodeConfig {
uint32_t position_quantization_bits;
uint32_t color_quantization_bits;
uint8_t encoding_speed;
uint8_t decoding_speed;
} DracoWrapperEncodeConfig;
typedef struct DracoWrapperEncodeResult {
bool success;
size_t size;
const uint8_t *data;
char *error_msg;
} DracoWrapperEncodeResult;
typedef struct DracoWrapperDecodeResult {
bool success;
size_t num_points;
float *coords;
uint8_t *colors;
char *error_msg;
} DracoWrapperDecodeResult;
DracoWrapperEncodeResult *draco_wrapper_encode_points_to_draco(
const float *coords,
const uint8_t *colors,
size_t num_points,
DracoWrapperPcEncodingMethod encoding_method,
const DracoWrapperEncodeConfig *config);
DracoWrapperDecodeResult *draco_wrapper_decode_draco_data(const uint8_t *encoded_data, size_t encoded_size);
void draco_wrapper_free_encode_result(DracoWrapperEncodeResult *result);
void draco_wrapper_free_decode_result(DracoWrapperDecodeResult *result);
#ifdef __cplusplus
}
#endif
#endif