Differential D9642 Diff 31697 extern/draco/draco/src/draco/compression/attributes/sequential_integer_attribute_decoder.h
Changeset View
Changeset View
Standalone View
Standalone View
extern/draco/draco/src/draco/compression/attributes/sequential_integer_attribute_decoder.h
- This file was moved from extern/draco/dracoenc/src/draco/compression/attributes/sequential_integer_attribute_decoder.h.
| Show All 9 Lines | |||||
| // distributed under the License is distributed on an "AS IS" BASIS, | // distributed under the License is distributed on an "AS IS" BASIS, | ||||
| // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||||
| // See the License for the specific language governing permissions and | // See the License for the specific language governing permissions and | ||||
| // limitations under the License. | // limitations under the License. | ||||
| // | // | ||||
| #ifndef DRACO_COMPRESSION_ATTRIBUTES_SEQUENTIAL_INTEGER_ATTRIBUTE_DECODER_H_ | #ifndef DRACO_COMPRESSION_ATTRIBUTES_SEQUENTIAL_INTEGER_ATTRIBUTE_DECODER_H_ | ||||
| #define DRACO_COMPRESSION_ATTRIBUTES_SEQUENTIAL_INTEGER_ATTRIBUTE_DECODER_H_ | #define DRACO_COMPRESSION_ATTRIBUTES_SEQUENTIAL_INTEGER_ATTRIBUTE_DECODER_H_ | ||||
| #include "draco/draco_features.h" | |||||
| #include "draco/compression/attributes/prediction_schemes/prediction_scheme_decoder.h" | #include "draco/compression/attributes/prediction_schemes/prediction_scheme_decoder.h" | ||||
| #include "draco/compression/attributes/sequential_attribute_decoder.h" | #include "draco/compression/attributes/sequential_attribute_decoder.h" | ||||
| #include "draco/draco_features.h" | |||||
| namespace draco { | namespace draco { | ||||
| // Decoder for attributes encoded with the SequentialIntegerAttributeEncoder. | // Decoder for attributes encoded with the SequentialIntegerAttributeEncoder. | ||||
| class SequentialIntegerAttributeDecoder : public SequentialAttributeDecoder { | class SequentialIntegerAttributeDecoder : public SequentialAttributeDecoder { | ||||
| public: | public: | ||||
| SequentialIntegerAttributeDecoder(); | SequentialIntegerAttributeDecoder(); | ||||
| bool Init(PointCloudDecoder *decoder, int attribute_id) override; | bool Init(PointCloudDecoder *decoder, int attribute_id) override; | ||||
| Show All 21 Lines | protected: | ||||
| // Called after all integer values are decoded. The implementation should | // Called after all integer values are decoded. The implementation should | ||||
| // use this method to store the values into the attribute. | // use this method to store the values into the attribute. | ||||
| virtual bool StoreValues(uint32_t num_values); | virtual bool StoreValues(uint32_t num_values); | ||||
| void PreparePortableAttribute(int num_entries, int num_components); | void PreparePortableAttribute(int num_entries, int num_components); | ||||
| int32_t *GetPortableAttributeData() { | int32_t *GetPortableAttributeData() { | ||||
| if (portable_attribute()->size() == 0) | if (portable_attribute()->size() == 0) { | ||||
| return nullptr; | return nullptr; | ||||
| } | |||||
| return reinterpret_cast<int32_t *>( | return reinterpret_cast<int32_t *>( | ||||
| portable_attribute()->GetAddress(AttributeValueIndex(0))); | portable_attribute()->GetAddress(AttributeValueIndex(0))); | ||||
| } | } | ||||
| private: | private: | ||||
| // Stores decoded values into the attribute with a data type AttributeTypeT. | // Stores decoded values into the attribute with a data type AttributeTypeT. | ||||
| template <typename AttributeTypeT> | template <typename AttributeTypeT> | ||||
| void StoreTypedValues(uint32_t num_values); | void StoreTypedValues(uint32_t num_values); | ||||
| std::unique_ptr<PredictionSchemeTypedDecoderInterface<int32_t>> | std::unique_ptr<PredictionSchemeTypedDecoderInterface<int32_t>> | ||||
| prediction_scheme_; | prediction_scheme_; | ||||
| }; | }; | ||||
| } // namespace draco | } // namespace draco | ||||
| #endif // DRACO_COMPRESSION_ATTRIBUTES_SEQUENTIAL_INTEGER_ATTRIBUTE_DECODER_H_ | #endif // DRACO_COMPRESSION_ATTRIBUTES_SEQUENTIAL_INTEGER_ATTRIBUTE_DECODER_H_ | ||||