Changeset View
Changeset View
Standalone View
Standalone View
extern/draco/draco/src/draco/compression/encode_base.h
- This file was moved from extern/draco/dracoenc/src/draco/compression/encode_base.h.
| Show First 20 Lines • Show All 62 Lines • ▼ Show 20 Lines | protected: | ||||
| void SetEncodingSubmethod(int encoding_submethod) { | void SetEncodingSubmethod(int encoding_submethod) { | ||||
| options_.SetGlobalInt("encoding_submethod", encoding_submethod); | options_.SetGlobalInt("encoding_submethod", encoding_submethod); | ||||
| } | } | ||||
| Status CheckPredictionScheme(GeometryAttribute::Type att_type, | Status CheckPredictionScheme(GeometryAttribute::Type att_type, | ||||
| int prediction_scheme) const { | int prediction_scheme) const { | ||||
| // Out of bound checks: | // Out of bound checks: | ||||
| if (prediction_scheme < PREDICTION_NONE) | if (prediction_scheme < PREDICTION_NONE) { | ||||
| return Status(Status::DRACO_ERROR, | return Status(Status::DRACO_ERROR, | ||||
| "Invalid prediction scheme requested."); | "Invalid prediction scheme requested."); | ||||
| if (prediction_scheme >= NUM_PREDICTION_SCHEMES) | } | ||||
| if (prediction_scheme >= NUM_PREDICTION_SCHEMES) { | |||||
| return Status(Status::DRACO_ERROR, | return Status(Status::DRACO_ERROR, | ||||
| "Invalid prediction scheme requested."); | "Invalid prediction scheme requested."); | ||||
| } | |||||
| // Deprecated prediction schemes: | // Deprecated prediction schemes: | ||||
| if (prediction_scheme == MESH_PREDICTION_TEX_COORDS_DEPRECATED) | if (prediction_scheme == MESH_PREDICTION_TEX_COORDS_DEPRECATED) { | ||||
| return Status(Status::DRACO_ERROR, | return Status(Status::DRACO_ERROR, | ||||
| "MESH_PREDICTION_TEX_COORDS_DEPRECATED is deprecated."); | "MESH_PREDICTION_TEX_COORDS_DEPRECATED is deprecated."); | ||||
| if (prediction_scheme == MESH_PREDICTION_MULTI_PARALLELOGRAM) | } | ||||
| if (prediction_scheme == MESH_PREDICTION_MULTI_PARALLELOGRAM) { | |||||
| return Status(Status::DRACO_ERROR, | return Status(Status::DRACO_ERROR, | ||||
| "MESH_PREDICTION_MULTI_PARALLELOGRAM is deprecated."); | "MESH_PREDICTION_MULTI_PARALLELOGRAM is deprecated."); | ||||
| } | |||||
| // Attribute specific checks: | // Attribute specific checks: | ||||
| if (prediction_scheme == MESH_PREDICTION_TEX_COORDS_PORTABLE) { | if (prediction_scheme == MESH_PREDICTION_TEX_COORDS_PORTABLE) { | ||||
| if (att_type != GeometryAttribute::TEX_COORD) | if (att_type != GeometryAttribute::TEX_COORD) { | ||||
| return Status(Status::DRACO_ERROR, | return Status(Status::DRACO_ERROR, | ||||
| "Invalid prediction scheme for attribute type."); | "Invalid prediction scheme for attribute type."); | ||||
| } | } | ||||
| } | |||||
| if (prediction_scheme == MESH_PREDICTION_GEOMETRIC_NORMAL) { | if (prediction_scheme == MESH_PREDICTION_GEOMETRIC_NORMAL) { | ||||
| if (att_type != GeometryAttribute::NORMAL) { | if (att_type != GeometryAttribute::NORMAL) { | ||||
| return Status(Status::DRACO_ERROR, | return Status(Status::DRACO_ERROR, | ||||
| "Invalid prediction scheme for attribute type."); | "Invalid prediction scheme for attribute type."); | ||||
| } | } | ||||
| } | } | ||||
| // TODO(hemmer): Try to enable more prediction schemes for normals. | // TODO(hemmer): Try to enable more prediction schemes for normals. | ||||
| if (att_type == GeometryAttribute::NORMAL) { | if (att_type == GeometryAttribute::NORMAL) { | ||||
| Show All 29 Lines | |||||