Changeset View
Changeset View
Standalone View
Standalone View
extern/draco/dracoenc/src/draco/compression/encode_base.h
| Context not available. | |||||
| 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 < 0) | if (prediction_scheme < PREDICTION_NONE) | ||||
| return Status(Status::ERROR, "Invalid prediction scheme requested."); | return Status(Status::DRACO_ERROR, | ||||
| "Invalid prediction scheme requested."); | |||||
| if (prediction_scheme >= NUM_PREDICTION_SCHEMES) | if (prediction_scheme >= NUM_PREDICTION_SCHEMES) | ||||
| return Status(Status::ERROR, "Invalid prediction scheme requested."); | return Status(Status::DRACO_ERROR, | ||||
| "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::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) | |||||
| return Status(Status::DRACO_ERROR, | |||||
| "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::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::ERROR, | return Status(Status::DRACO_ERROR, | ||||
| "Invalid prediction scheme for attribute type."); | "Invalid prediction scheme for attribute type."); | ||||
| } | } | ||||
| } | } | ||||
| Context not available. | |||||
| if (att_type == GeometryAttribute::NORMAL) { | if (att_type == GeometryAttribute::NORMAL) { | ||||
| if (!(prediction_scheme == PREDICTION_DIFFERENCE || | if (!(prediction_scheme == PREDICTION_DIFFERENCE || | ||||
| prediction_scheme == MESH_PREDICTION_GEOMETRIC_NORMAL)) { | prediction_scheme == MESH_PREDICTION_GEOMETRIC_NORMAL)) { | ||||
| return Status(Status::ERROR, | return Status(Status::DRACO_ERROR, | ||||
| "Invalid prediction scheme for attribute type."); | "Invalid prediction scheme for attribute type."); | ||||
| } | } | ||||
| } | } | ||||
| Context not available. | |||||