Differential D9642 Diff 31697 extern/draco/draco/src/draco/compression/attributes/prediction_schemes/mesh_prediction_scheme_tex_coords_portable_encoder.h
Changeset View
Changeset View
Standalone View
Standalone View
extern/draco/draco/src/draco/compression/attributes/prediction_schemes/mesh_prediction_scheme_tex_coords_portable_encoder.h
- This file was moved from extern/draco/dracoenc/src/draco/compression/attributes/prediction_schemes/mesh_prediction_scheme_tex_coords_portable_encoder.h.
| Show First 20 Lines • Show All 45 Lines • ▼ Show 20 Lines | public: | ||||
| bool EncodePredictionData(EncoderBuffer *buffer) override; | bool EncodePredictionData(EncoderBuffer *buffer) override; | ||||
| PredictionSchemeMethod GetPredictionMethod() const override { | PredictionSchemeMethod GetPredictionMethod() const override { | ||||
| return MESH_PREDICTION_TEX_COORDS_PORTABLE; | return MESH_PREDICTION_TEX_COORDS_PORTABLE; | ||||
| } | } | ||||
| bool IsInitialized() const override { | bool IsInitialized() const override { | ||||
| if (!predictor_.IsInitialized()) | if (!predictor_.IsInitialized()) { | ||||
| return false; | return false; | ||||
| if (!this->mesh_data().IsInitialized()) | } | ||||
| if (!this->mesh_data().IsInitialized()) { | |||||
| return false; | return false; | ||||
| } | |||||
| return true; | return true; | ||||
| } | } | ||||
| int GetNumParentAttributes() const override { return 1; } | int GetNumParentAttributes() const override { return 1; } | ||||
| GeometryAttribute::Type GetParentAttributeType(int i) const override { | GeometryAttribute::Type GetParentAttributeType(int i) const override { | ||||
| DRACO_DCHECK_EQ(i, 0); | DRACO_DCHECK_EQ(i, 0); | ||||
| (void)i; | (void)i; | ||||
| return GeometryAttribute::POSITION; | return GeometryAttribute::POSITION; | ||||
| } | } | ||||
| bool SetParentAttribute(const PointAttribute *att) override { | bool SetParentAttribute(const PointAttribute *att) override { | ||||
| if (att->attribute_type() != GeometryAttribute::POSITION) | if (att->attribute_type() != GeometryAttribute::POSITION) { | ||||
| return false; // Invalid attribute type. | return false; // Invalid attribute type. | ||||
| if (att->num_components() != 3) | } | ||||
| if (att->num_components() != 3) { | |||||
| return false; // Currently works only for 3 component positions. | return false; // Currently works only for 3 component positions. | ||||
| } | |||||
| predictor_.SetPositionAttribute(*att); | predictor_.SetPositionAttribute(*att); | ||||
| return true; | return true; | ||||
| } | } | ||||
| private: | private: | ||||
| MeshPredictionSchemeTexCoordsPortablePredictor<DataTypeT, MeshDataT> | MeshPredictionSchemeTexCoordsPortablePredictor<DataTypeT, MeshDataT> | ||||
| predictor_; | predictor_; | ||||
| }; | }; | ||||
| ▲ Show 20 Lines • Show All 48 Lines • Show Last 20 Lines | |||||