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

Method Resize

Source/Engine/Tools/TextureTool/TextureTool.cpp:369–396  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

367}
368
369bool TextureTool::Resize(TextureData& dst, const TextureData& src, int32 dstWidth, int32 dstHeight)
370{
371 if (src.GetMipLevels() == 0)
372 {
373 LOG(Warning, "Missing source data.");
374 return true;
375 }
376 if (src.Width == dstWidth && src.Height == dstHeight)
377 {
378 LOG(Warning, "Source data and destination dimensions are the same. Cannot perform resizing.");
379 return true;
380 }
381 if (src.Depth != 1)
382 {
383 LOG(Warning, "Resizing volume texture data is not supported.");
384 return true;
385 }
386 PROFILE_CPU();
387 PROFILE_MEM(GraphicsTextures);
388#if COMPILE_WITH_DIRECTXTEX
389 return ResizeDirectXTex(dst, src, dstWidth, dstHeight);
390#elif COMPILE_WITH_STB
391 return ResizeStb(dst, src, dstWidth, dstHeight);
392#else
393 LOG(Warning, "Resizing textures is not supported on this platform.");
394 return true;
395#endif
396}
397
398bool TextureTool::UpdateTexture(GPUContext* context, GPUTexture* texture, int32 arrayIndex, int32 mipIndex, Span<byte> data, uint32 rowPitch, uint32 slicePitch, PixelFormat dataFormat)
399{

Callers 15

ContinueWithMethod · 0.45
InitMethod · 0.45
TerrainMethod · 0.45
SetPhysicalMaterialsMethod · 0.45
BeforeExitMethod · 0.45
InitMethod · 0.45
UpdateTransformMethod · 0.45
CookCollisionFunction · 0.45
SetupHeightMapMethod · 0.45
SetupSplatMapMethod · 0.45
InitializeHeightMapMethod · 0.45

Calls 1

GetMipLevelsMethod · 0.80

Tested by

no test coverage detected