| 226 | } |
| 227 | |
| 228 | static inline int32_t GetNumComponentsInType(uint32_t ty) { |
| 229 | if (ty == TINYGLTF_TYPE_SCALAR) { |
| 230 | return 1; |
| 231 | } else if (ty == TINYGLTF_TYPE_VEC2) { |
| 232 | return 2; |
| 233 | } else if (ty == TINYGLTF_TYPE_VEC3) { |
| 234 | return 3; |
| 235 | } else if (ty == TINYGLTF_TYPE_VEC4) { |
| 236 | return 4; |
| 237 | } else if (ty == TINYGLTF_TYPE_MAT2) { |
| 238 | return 4; |
| 239 | } else if (ty == TINYGLTF_TYPE_MAT3) { |
| 240 | return 9; |
| 241 | } else if (ty == TINYGLTF_TYPE_MAT4) { |
| 242 | return 16; |
| 243 | } else { |
| 244 | // Unknown component type |
| 245 | return -1; |
| 246 | } |
| 247 | } |
| 248 | |
| 249 | // TODO(syoyo): Move these functions to TinyGLTF class |
| 250 | bool IsDataURI(const std::string &in); |