| 337 | } |
| 338 | |
| 339 | bool TextureTool::Convert(TextureData& dst, const TextureData& src, const PixelFormat dstFormat) |
| 340 | { |
| 341 | if (src.GetMipLevels() == 0) |
| 342 | { |
| 343 | LOG(Warning, "Missing source data."); |
| 344 | return true; |
| 345 | } |
| 346 | if (src.Format == dstFormat) |
| 347 | { |
| 348 | LOG(Warning, "Source data and destination format are the same. Cannot perform conversion."); |
| 349 | return true; |
| 350 | } |
| 351 | if (src.Depth != 1) |
| 352 | { |
| 353 | LOG(Warning, "Converting volume texture data is not supported."); |
| 354 | return true; |
| 355 | } |
| 356 | PROFILE_CPU(); |
| 357 | PROFILE_MEM(GraphicsTextures); |
| 358 | |
| 359 | #if COMPILE_WITH_DIRECTXTEX |
| 360 | return ConvertDirectXTex(dst, src, dstFormat); |
| 361 | #elif COMPILE_WITH_STB |
| 362 | return ConvertStb(dst, src, dstFormat); |
| 363 | #else |
| 364 | LOG(Warning, "Converting textures is not supported on this platform."); |
| 365 | return true; |
| 366 | #endif |
| 367 | } |
| 368 | |
| 369 | bool TextureTool::Resize(TextureData& dst, const TextureData& src, int32 dstWidth, int32 dstHeight) |
| 370 | { |
nothing calls this directly
no test coverage detected