Differential D9642 Diff 31697 extern/draco/draco/src/draco/compression/attributes/prediction_schemes/mesh_prediction_scheme_tex_coords_encoder.h
Changeset View
Changeset View
Standalone View
Standalone View
extern/draco/draco/src/draco/compression/attributes/prediction_schemes/mesh_prediction_scheme_tex_coords_encoder.h
- This file was moved from extern/draco/dracoenc/src/draco/compression/attributes/prediction_schemes/mesh_prediction_scheme_tex_coords_encoder.h.
| Show All 10 Lines | |||||
| // 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_PREDICTION_SCHEMES_MESH_PREDICTION_SCHEME_TEX_COORDS_ENCODER_H_ | #ifndef DRACO_COMPRESSION_ATTRIBUTES_PREDICTION_SCHEMES_MESH_PREDICTION_SCHEME_TEX_COORDS_ENCODER_H_ | ||||
| #define DRACO_COMPRESSION_ATTRIBUTES_PREDICTION_SCHEMES_MESH_PREDICTION_SCHEME_TEX_COORDS_ENCODER_H_ | #define DRACO_COMPRESSION_ATTRIBUTES_PREDICTION_SCHEMES_MESH_PREDICTION_SCHEME_TEX_COORDS_ENCODER_H_ | ||||
| #include <math.h> | #include <math.h> | ||||
| #include "draco/compression/attributes/prediction_schemes/mesh_prediction_scheme_encoder.h" | #include "draco/compression/attributes/prediction_schemes/mesh_prediction_scheme_encoder.h" | ||||
| #include "draco/compression/bit_coders/rans_bit_encoder.h" | #include "draco/compression/bit_coders/rans_bit_encoder.h" | ||||
| #include "draco/core/varint_encoding.h" | #include "draco/core/varint_encoding.h" | ||||
| #include "draco/core/vector_d.h" | #include "draco/core/vector_d.h" | ||||
| #include "draco/mesh/corner_table.h" | #include "draco/mesh/corner_table.h" | ||||
| namespace draco { | namespace draco { | ||||
| Show All 23 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_DEPRECATED; | return MESH_PREDICTION_TEX_COORDS_DEPRECATED; | ||||
| } | } | ||||
| bool IsInitialized() const override { | bool IsInitialized() const override { | ||||
| if (pos_attribute_ == nullptr) | if (pos_attribute_ == nullptr) { | ||||
| 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. | ||||
| } | |||||
| pos_attribute_ = att; | pos_attribute_ = att; | ||||
| return true; | return true; | ||||
| } | } | ||||
| protected: | protected: | ||||
| Vector3f GetPositionForEntryId(int entry_id) const { | Vector3f GetPositionForEntryId(int entry_id) const { | ||||
| const PointIndex point_id = entry_to_point_id_map_[entry_id]; | const PointIndex point_id = entry_to_point_id_map_[entry_id]; | ||||
| Vector3f pos; | Vector3f pos; | ||||
| ▲ Show 20 Lines • Show All 228 Lines • Show Last 20 Lines | |||||