Changeset View
Changeset View
Standalone View
Standalone View
extern/draco/dracoenc/src/draco/compression/expert_encode.cc
| Context not available. | |||||
| #include "draco/compression/mesh/mesh_edgebreaker_encoder.h" | #include "draco/compression/mesh/mesh_edgebreaker_encoder.h" | ||||
| #include "draco/compression/mesh/mesh_sequential_encoder.h" | #include "draco/compression/mesh/mesh_sequential_encoder.h" | ||||
| #ifdef DRACO_POINT_CLOUD_COMPRESSION_SUPPORTED | |||||
| #include "draco/compression/point_cloud/point_cloud_kd_tree_encoder.h" | #include "draco/compression/point_cloud/point_cloud_kd_tree_encoder.h" | ||||
| #include "draco/compression/point_cloud/point_cloud_sequential_encoder.h" | #include "draco/compression/point_cloud/point_cloud_sequential_encoder.h" | ||||
| #endif | |||||
| namespace draco { | namespace draco { | ||||
| Context not available. | |||||
| Status ExpertEncoder::EncodeToBuffer(EncoderBuffer *out_buffer) { | Status ExpertEncoder::EncodeToBuffer(EncoderBuffer *out_buffer) { | ||||
| if (point_cloud_ == nullptr) | if (point_cloud_ == nullptr) | ||||
| return Status(Status::ERROR, "Invalid input geometry."); | return Status(Status::DRACO_ERROR, "Invalid input geometry."); | ||||
| if (mesh_ == nullptr) { | if (mesh_ == nullptr) { | ||||
| return EncodePointCloudToBuffer(*point_cloud_, out_buffer); | return EncodePointCloudToBuffer(*point_cloud_, out_buffer); | ||||
| } | } | ||||
| Context not available. | |||||
| Status ExpertEncoder::EncodePointCloudToBuffer(const PointCloud &pc, | Status ExpertEncoder::EncodePointCloudToBuffer(const PointCloud &pc, | ||||
| EncoderBuffer *out_buffer) { | EncoderBuffer *out_buffer) { | ||||
| #ifdef DRACO_POINT_CLOUD_COMPRESSION_SUPPORTED | |||||
| std::unique_ptr<PointCloudEncoder> encoder; | std::unique_ptr<PointCloudEncoder> encoder; | ||||
| const int encoding_method = options().GetGlobalInt("encoding_method", -1); | const int encoding_method = options().GetGlobalInt("encoding_method", -1); | ||||
| Context not available. | |||||
| } else if (encoding_method == POINT_CLOUD_KD_TREE_ENCODING) { | } else if (encoding_method == POINT_CLOUD_KD_TREE_ENCODING) { | ||||
| // Encoding method was explicitly specified but we cannot use it for | // Encoding method was explicitly specified but we cannot use it for | ||||
| // the given input (some of the checks above failed). | // the given input (some of the checks above failed). | ||||
| return Status(Status::ERROR, "Invalid encoding method."); | return Status(Status::DRACO_ERROR, "Invalid encoding method."); | ||||
| } | } | ||||
| } | } | ||||
| if (!encoder) { | if (!encoder) { | ||||
| Context not available. | |||||
| set_num_encoded_points(encoder->num_encoded_points()); | set_num_encoded_points(encoder->num_encoded_points()); | ||||
| set_num_encoded_faces(0); | set_num_encoded_faces(0); | ||||
| return OkStatus(); | return OkStatus(); | ||||
| #else | |||||
| return Status(Status::DRACO_ERROR, "Point cloud encoding is not enabled."); | |||||
| #endif | |||||
| } | } | ||||
| Status ExpertEncoder::EncodeMeshToBuffer(const Mesh &m, | Status ExpertEncoder::EncodeMeshToBuffer(const Mesh &m, | ||||
| Context not available. | |||||