----------------------------------------------------------------------------------- Do the texture import for a given aiTexture
| 200 | // ----------------------------------------------------------------------------------- |
| 201 | // Do the texture import for a given aiTexture |
| 202 | int DoExport(const aiTexture *tx, FILE *p, const std::string &extension, unsigned int flags) { |
| 203 | // export the image to the appropriate decoder |
| 204 | if (extension == "bmp") { |
| 205 | SaveAsBMP(p, tx->pcData, tx->mWidth, tx->mHeight, |
| 206 | (0 != (flags & AI_EXTRACT_WRITE_BMP_ALPHA))); |
| 207 | } else if (extension == "tga") { |
| 208 | SaveAsTGA(p, tx->pcData, tx->mWidth, tx->mHeight); |
| 209 | } else { |
| 210 | printf("assimp extract: No available texture encoder found for %s\n", extension.c_str()); |
| 211 | return AssimpCmdExtractError::NoAvailableTextureEncoderFound; |
| 212 | } |
| 213 | return AssimpCmdError::Success; |
| 214 | } |
| 215 | |
| 216 | // ----------------------------------------------------------------------------------- |
| 217 | // Implementation of the assimp extract utility |
no test coverage detected