UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
ImageCoreUtils.h
Go to the documentation of this file.
1// Copyright Epic Games, Inc. All Rights Reserved.
2
3/*=============================================================================
4ImageCoreUtils.h: Image utility functions.
5=============================================================================*/
6
7#pragma once
8
9#include "CoreMinimal.h"
11#include "ImageCore.h"
12#include "PixelFormat.h"
13#include "UObject/NameTypes.h"
14
15// ImageCore Module does not use Engine, but it can see TextureDefines
16// do not use Engine functions here
17//
18// keep the ImageCore.h includes as minimal as possible
19// put any functions that need more headers here
20
22{
23 // IsImageImportPossible returns false if the image dimensions are not supported to import
24 // if this function returns true, image import might still fail due to further constraints
25 // (this constraint is weaker than the one actually required)
26 // (see IsImportResolutionValid, which is also still weaker than the final constraint)
27 // IsImageImportPossible does not check current Engine config or platform limits, only hard-coded absolute limits
29
30 // Returns the number of mips that constitute a full mip chain for the given top level mip size.
31 // InVolumeZ is ignored unless bInIsVolume is true
33
34 // ETextureSourceFormat and ERawImageFormat::Type are one-to-one :
37
38 // EPixelFormat is the graphics texture pixel format
39 // it is a much larger superset of ERawImageFormat
40 // GetPixelFormatForRawImageFormat does not map to the very closest EPixelFormat
41 // instead map to a close one that is actually usable as Texture
42 // if *pOutEquivalentFormat != InFormat , then conversion is needed
43 // and conversion can be done using CopyImage to OutEquivalentFormat
46
47
49
57
58 // return an ERawImageFormat for a PixelFormat
59 // these are not equal and you cannot blit between them
60 // it's just the closest reasonable thing that can hold that PixelFormat
61 // often there is no good match
63};
FPlatformTypes::int64 int64
A 64-bit signed integer.
Definition Platform.h:1127
FPlatformTypes::int32 int32
A 32-bit signed integer.
Definition Platform.h:1125
UE_FORCEINLINE_HINT TSharedRef< CastToType, Mode > StaticCastSharedRef(TSharedRef< CastFromType, Mode > const &InSharedRef)
Definition SharedPointer.h:127
EPixelFormat
Definition PixelFormat.h:16
ETextureSourceFormat
Definition TextureDefines.h:351
Definition NameTypes.h:617
Type
Definition ImageCore.h:57
Definition ImageCoreUtils.h:22
IMAGECORE_API ERawImageFormat::Type GetRawImageFormatForPixelFormat(EPixelFormat PF)
Definition ImageCoreUtils.cpp:204
IMAGECORE_API FName ConvertToUncompressedTextureFormatName(ERawImageFormat::Type Format)
Definition ImageCoreUtils.cpp:136
IMAGECORE_API ETextureSourceFormat GetCommonSourceFormat(ETextureSourceFormat Format1, ETextureSourceFormat Format2)
Definition ImageCoreUtils.cpp:169
IMAGECORE_API ERawImageFormat::Type ConvertToRawImageFormat(ETextureSourceFormat Format)
Definition ImageCoreUtils.cpp:87
IMAGECORE_API bool IsImageImportPossible(int64 Width, int64 Height)
Definition ImageCoreUtils.cpp:7
IMAGECORE_API ETextureSourceFormat ConvertToTextureSourceFormat(ERawImageFormat::Type Format)
Definition ImageCoreUtils.cpp:115
IMAGECORE_API int32 GetMipCountFromDimensions(int32 InSizeX, int32 InSizeY, int32 InVolumeZ, bool bInIsVolume)
Definition ImageCoreUtils.cpp:35
IMAGECORE_API EPixelFormat GetPixelFormatForRawImageFormat(ERawImageFormat::Type InFormat, ERawImageFormat::Type *pOutEquivalentFormat=nullptr)
Definition ImageCoreUtils.cpp:42