MCPcopy Create free account
hub / github.com/assimp/assimp / DoExport

Function DoExport

tools/assimp_cmd/ImageExtractor.cpp:202–214  ·  view source on GitHub ↗

----------------------------------------------------------------------------------- Do the texture import for a given aiTexture

Source from the content-addressed store, hash-verified

200// -----------------------------------------------------------------------------------
201// Do the texture import for a given aiTexture
202int 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

Callers 1

Assimp_ExtractFunction · 0.70

Calls 2

SaveAsBMPFunction · 0.85
SaveAsTGAFunction · 0.85

Tested by

no test coverage detected