Changeset View
Changeset View
Standalone View
Standalone View
extern/draco/dracoenc/src/draco/compression/decode.cc
| Context not available. | |||||
| } else if (method == POINT_CLOUD_KD_TREE_ENCODING) { | } else if (method == POINT_CLOUD_KD_TREE_ENCODING) { | ||||
| return std::unique_ptr<PointCloudDecoder>(new PointCloudKdTreeDecoder()); | return std::unique_ptr<PointCloudDecoder>(new PointCloudKdTreeDecoder()); | ||||
| } | } | ||||
| return Status(Status::ERROR, "Unsupported encoding method."); | return Status(Status::DRACO_ERROR, "Unsupported encoding method."); | ||||
| } | } | ||||
| #endif | #endif | ||||
| Context not available. | |||||
| } else if (method == MESH_EDGEBREAKER_ENCODING) { | } else if (method == MESH_EDGEBREAKER_ENCODING) { | ||||
| return std::unique_ptr<MeshDecoder>(new MeshEdgebreakerDecoder()); | return std::unique_ptr<MeshDecoder>(new MeshEdgebreakerDecoder()); | ||||
| } | } | ||||
| return Status(Status::ERROR, "Unsupported encoding method."); | return Status(Status::DRACO_ERROR, "Unsupported encoding method."); | ||||
| } | } | ||||
| #endif | #endif | ||||
| Context not available. | |||||
| return static_cast<std::unique_ptr<PointCloud>>(std::move(mesh)); | return static_cast<std::unique_ptr<PointCloud>>(std::move(mesh)); | ||||
| #endif | #endif | ||||
| } | } | ||||
| return Status(Status::ERROR, "Unsupported geometry type."); | return Status(Status::DRACO_ERROR, "Unsupported geometry type."); | ||||
| } | } | ||||
| StatusOr<std::unique_ptr<Mesh>> Decoder::DecodeMeshFromBuffer( | StatusOr<std::unique_ptr<Mesh>> Decoder::DecodeMeshFromBuffer( | ||||
| Context not available. | |||||
| DracoHeader header; | DracoHeader header; | ||||
| DRACO_RETURN_IF_ERROR(PointCloudDecoder::DecodeHeader(&temp_buffer, &header)) | DRACO_RETURN_IF_ERROR(PointCloudDecoder::DecodeHeader(&temp_buffer, &header)) | ||||
| if (header.encoder_type != POINT_CLOUD) { | if (header.encoder_type != POINT_CLOUD) { | ||||
| return Status(Status::ERROR, "Input is not a point cloud."); | return Status(Status::DRACO_ERROR, "Input is not a point cloud."); | ||||
| } | } | ||||
| DRACO_ASSIGN_OR_RETURN(std::unique_ptr<PointCloudDecoder> decoder, | DRACO_ASSIGN_OR_RETURN(std::unique_ptr<PointCloudDecoder> decoder, | ||||
| CreatePointCloudDecoder(header.encoder_method)) | CreatePointCloudDecoder(header.encoder_method)) | ||||
| Context not available. | |||||
| DRACO_RETURN_IF_ERROR(decoder->Decode(options_, in_buffer, out_geometry)) | DRACO_RETURN_IF_ERROR(decoder->Decode(options_, in_buffer, out_geometry)) | ||||
| return OkStatus(); | return OkStatus(); | ||||
| #else | #else | ||||
| return Status(Status::ERROR, "Unsupported geometry type."); | return Status(Status::DRACO_ERROR, "Unsupported geometry type."); | ||||
| #endif | #endif | ||||
| } | } | ||||
| Context not available. | |||||
| DracoHeader header; | DracoHeader header; | ||||
| DRACO_RETURN_IF_ERROR(PointCloudDecoder::DecodeHeader(&temp_buffer, &header)) | DRACO_RETURN_IF_ERROR(PointCloudDecoder::DecodeHeader(&temp_buffer, &header)) | ||||
| if (header.encoder_type != TRIANGULAR_MESH) { | if (header.encoder_type != TRIANGULAR_MESH) { | ||||
| return Status(Status::ERROR, "Input is not a mesh."); | return Status(Status::DRACO_ERROR, "Input is not a mesh."); | ||||
| } | } | ||||
| DRACO_ASSIGN_OR_RETURN(std::unique_ptr<MeshDecoder> decoder, | DRACO_ASSIGN_OR_RETURN(std::unique_ptr<MeshDecoder> decoder, | ||||
| CreateMeshDecoder(header.encoder_method)) | CreateMeshDecoder(header.encoder_method)) | ||||
| Context not available. | |||||
| DRACO_RETURN_IF_ERROR(decoder->Decode(options_, in_buffer, out_geometry)) | DRACO_RETURN_IF_ERROR(decoder->Decode(options_, in_buffer, out_geometry)) | ||||
| return OkStatus(); | return OkStatus(); | ||||
| #else | #else | ||||
| return Status(Status::ERROR, "Unsupported geometry type."); | return Status(Status::DRACO_ERROR, "Unsupported geometry type."); | ||||
| #endif | #endif | ||||
| } | } | ||||
| Context not available. | |||||