MCPcopy Create free account
hub / github.com/FlaxEngine/FlaxEngine / Convert

Method Convert

Source/Engine/Tools/TextureTool/TextureTool.cpp:339–367  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

337}
338
339bool 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
369bool TextureTool::Resize(TextureData& dst, const TextureData& src, int32 dstWidth, int32 dstHeight)
370{

Callers

nothing calls this directly

Calls 1

GetMipLevelsMethod · 0.80

Tested by

no test coverage detected