80 lines
2.0 KiB
C
Raw Normal View History

2026-03-10 23:59:59 +08:00
#ifndef POINT_CLOUD_LOADER_H
#define POINT_CLOUD_LOADER_H
#include "VZNL_Types.h"
#include "ErrorCodes.h"
2026-03-10 23:59:59 +08:00
/**
* @brief Load point cloud from TXT file
*
* @param [in] filename Path to TXT file
* @param [out] outPoints Output point array (allocated by function)
* @param [out] outRows Output row count
* @param [out] outCols Output column count
* @param [out] errCode Error code output
* @return 0 on success, non-zero on error
*
* @pre filename != nullptr
* @pre outPoints != nullptr
* @pre outRows != nullptr
* @pre outCols != nullptr
* @pre errCode != nullptr
*
* @post If return value is 0, outPoints contains allocated array
* @post Caller must free outPoints using delete[]
*/
int LoadTxtFile(
const char* filename,
SVzNLPointXYZ** outPoints,
int* outRows,
int* outCols,
int* errCode
);
/**
* @brief Load point cloud from PCD file
*
* @param [in] filename Path to PCD file
* @param [out] outPoints Output point array (allocated by function)
* @param [out] outRows Output row count
* @param [out] outCols Output column count
* @param [out] errCode Error code output
* @return 0 on success, non-zero on error
*
* @pre filename != nullptr
* @pre outPoints != nullptr
* @pre outRows != nullptr
* @pre outCols != nullptr
* @pre errCode != nullptr
*
* @post If return value is 0, outPoints contains allocated array
* @post Caller must free outPoints using delete[]
*/
int LoadPcdFile(
const char* filename,
SVzNLPointXYZ** outPoints,
int* outRows,
int* outCols,
int* errCode
);
2026-03-30 13:54:30 +08:00
/**
* @brief Save point cloud to TXT file
*
* @param [in] filename Path to output TXT file
* @param [in] points Input point array
* @param [in] rows Row count
* @param [in] cols Column count
* @param [out] errCode Error code output
* @return 0 on success, non-zero on error
*/
int SaveTxtFile(
const char* filename,
const SVzNLPointXYZ* points,
int rows,
int cols,
int* errCode
);
2026-03-10 23:59:59 +08:00
#endif // POINT_CLOUD_LOADER_H