Differential D9642 Diff 31697 extern/draco/draco/src/draco/compression/attributes/sequential_attribute_encoders_controller.h
Changeset View
Changeset View
Standalone View
Standalone View
extern/draco/draco/src/draco/compression/attributes/sequential_attribute_encoders_controller.h
- This file was moved from extern/draco/dracoenc/src/draco/compression/attributes/sequential_attribute_encoders_controller.h.
| Show All 36 Lines | public: | ||||
| bool Init(PointCloudEncoder *encoder, const PointCloud *pc) override; | bool Init(PointCloudEncoder *encoder, const PointCloud *pc) override; | ||||
| bool EncodeAttributesEncoderData(EncoderBuffer *out_buffer) override; | bool EncodeAttributesEncoderData(EncoderBuffer *out_buffer) override; | ||||
| bool EncodeAttributes(EncoderBuffer *buffer) override; | bool EncodeAttributes(EncoderBuffer *buffer) override; | ||||
| uint8_t GetUniqueId() const override { return BASIC_ATTRIBUTE_ENCODER; } | uint8_t GetUniqueId() const override { return BASIC_ATTRIBUTE_ENCODER; } | ||||
| int NumParentAttributes(int32_t point_attribute_id) const override { | int NumParentAttributes(int32_t point_attribute_id) const override { | ||||
| const int32_t loc_id = GetLocalIdForPointAttribute(point_attribute_id); | const int32_t loc_id = GetLocalIdForPointAttribute(point_attribute_id); | ||||
| if (loc_id < 0) | if (loc_id < 0) { | ||||
| return 0; | return 0; | ||||
| } | |||||
| return sequential_encoders_[loc_id]->NumParentAttributes(); | return sequential_encoders_[loc_id]->NumParentAttributes(); | ||||
| } | } | ||||
| int GetParentAttributeId(int32_t point_attribute_id, | int GetParentAttributeId(int32_t point_attribute_id, | ||||
| int32_t parent_i) const override { | int32_t parent_i) const override { | ||||
| const int32_t loc_id = GetLocalIdForPointAttribute(point_attribute_id); | const int32_t loc_id = GetLocalIdForPointAttribute(point_attribute_id); | ||||
| if (loc_id < 0) | if (loc_id < 0) { | ||||
| return -1; | return -1; | ||||
| } | |||||
| return sequential_encoders_[loc_id]->GetParentAttributeId(parent_i); | return sequential_encoders_[loc_id]->GetParentAttributeId(parent_i); | ||||
| } | } | ||||
| bool MarkParentAttribute(int32_t point_attribute_id) override { | bool MarkParentAttribute(int32_t point_attribute_id) override { | ||||
| const int32_t loc_id = GetLocalIdForPointAttribute(point_attribute_id); | const int32_t loc_id = GetLocalIdForPointAttribute(point_attribute_id); | ||||
| if (loc_id < 0) | if (loc_id < 0) { | ||||
| return false; | return false; | ||||
| } | |||||
| // Mark the attribute encoder as parent (even when if it is not created | // Mark the attribute encoder as parent (even when if it is not created | ||||
| // yet). | // yet). | ||||
| if (sequential_encoder_marked_as_parent_.size() <= loc_id) { | if (sequential_encoder_marked_as_parent_.size() <= loc_id) { | ||||
| sequential_encoder_marked_as_parent_.resize(loc_id + 1, false); | sequential_encoder_marked_as_parent_.resize(loc_id + 1, false); | ||||
| } | } | ||||
| sequential_encoder_marked_as_parent_[loc_id] = true; | sequential_encoder_marked_as_parent_[loc_id] = true; | ||||
| if (sequential_encoders_.size() <= loc_id) | if (sequential_encoders_.size() <= loc_id) { | ||||
| return true; // Sequential encoders not generated yet. | return true; // Sequential encoders not generated yet. | ||||
| } | |||||
| sequential_encoders_[loc_id]->MarkParentAttribute(); | sequential_encoders_[loc_id]->MarkParentAttribute(); | ||||
| return true; | return true; | ||||
| } | } | ||||
| const PointAttribute *GetPortableAttribute( | const PointAttribute *GetPortableAttribute( | ||||
| int32_t point_attribute_id) override { | int32_t point_attribute_id) override { | ||||
| const int32_t loc_id = GetLocalIdForPointAttribute(point_attribute_id); | const int32_t loc_id = GetLocalIdForPointAttribute(point_attribute_id); | ||||
| if (loc_id < 0) | if (loc_id < 0) { | ||||
| return nullptr; | return nullptr; | ||||
| } | |||||
| return sequential_encoders_[loc_id]->GetPortableAttribute(); | return sequential_encoders_[loc_id]->GetPortableAttribute(); | ||||
| } | } | ||||
| protected: | protected: | ||||
| bool TransformAttributesToPortableFormat() override; | bool TransformAttributesToPortableFormat() override; | ||||
| bool EncodePortableAttributes(EncoderBuffer *out_buffer) override; | bool EncodePortableAttributes(EncoderBuffer *out_buffer) override; | ||||
| bool EncodeDataNeededByPortableTransforms(EncoderBuffer *out_buffer) override; | bool EncodeDataNeededByPortableTransforms(EncoderBuffer *out_buffer) override; | ||||
| Show All 23 Lines | |||||