UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
FHdrImageWrapper Class Reference

#include <HdrImageWrapper.h>

+ Inheritance diagram for FHdrImageWrapper:

Public Member Functions

IMAGEWRAPPER_API bool SetCompressedFromView (TArrayView64< const uint8 > Data)
 
virtual IMAGEWRAPPER_API bool SetCompressed (const void *InCompressedData, int64 InCompressedSize) override
 
virtual IMAGEWRAPPER_API bool SetRaw (const void *InRawData, int64 InRawSize, const int32 InWidth, const int32 InHeight, const ERGBFormat InFormat, const int32 InBitDepth, const int32 InBytesPerRow) override
 
virtual IMAGEWRAPPER_API TArray64< uint8GetCompressed (int32 Quality=0) override
 
virtual IMAGEWRAPPER_API bool GetRaw (const ERGBFormat InFormat, int32 InBitDepth, TArray64< uint8 > &OutRawData) override
 
virtual IMAGEWRAPPER_API bool GetRaw (const ERGBFormat InFormat, int32 InBitDepth, FDecompressedImageOutput &OutDecompressedImage) override
 
virtual IMAGEWRAPPER_API bool CanSetRawFormat (const ERGBFormat InFormat, const int32 InBitDepth) const override
 
virtual IMAGEWRAPPER_API ERawImageFormat::Type GetSupportedRawFormat (const ERawImageFormat::Type InFormat) const override
 
virtual IMAGEWRAPPER_API int64 GetWidth () const override
 
virtual IMAGEWRAPPER_API int64 GetHeight () const override
 
virtual IMAGEWRAPPER_API int32 GetBitDepth () const override
 
virtual IMAGEWRAPPER_API ERGBFormat GetFormat () const override
 
IMAGEWRAPPER_API const FTextGetErrorMessage () const
 
IMAGEWRAPPER_API void FreeCompressedData ()
 
virtual bool SupportsMetadata () const override
 
virtual void AddMetadata (const FString &InKey, const FString &InValue) override
 
virtual void GetMetadata (TStringMap &OutMetadata) const override
 
bool GetRaw (TArray64< uint8 > &OutRawData)
 
bool GetRaw (FDecompressedImageOutput &OutDecompressedImage)
 
virtual bool GetRaw (const ERGBFormat InFormat, int32 InBitDepth, TArray64< uint8 > &OutRawData)=0
 
virtual bool GetRaw (const ERGBFormat InFormat, int32 InBitDepth, FDecompressedImageOutput &OutDecompressedImage)=0
 
bool GetRaw (const ERGBFormat InFormat, int32 InBitDepth, TArray< uint8 > &OutRawData)
 
bool GetRaw (const ERGBFormat InFormat, int32 InBitDepth, TArrayView64< uint8 > OutRawData)
 
- Public Member Functions inherited from IImageWrapper
virtual TArray64< uint8GetExportData (int32 Quality=0)
 
bool GetRaw (TArray64< uint8 > &OutRawData)
 
bool GetRaw (FDecompressedImageOutput &OutDecompressedImage)
 
bool GetRawImage (FImage &OutImage)
 
bool GetRawImage (FDecompressedImageOutput &OutDecompressedImage)
 
bool GetRaw (const ERGBFormat InFormat, int32 InBitDepth, TArray< uint8 > &OutRawData)
 
bool GetRaw (const ERGBFormat InFormat, int32 InBitDepth, TArrayView64< uint8 > OutRawData)
 
bool GetSRGB () const
 
ERawImageFormat::Type GetClosestRawImageFormat (bool *bIsExactMatch=nullptr) const
 
void SetDebugImageName (const TCHAR *InDebugImageName)
 
virtual ~IImageWrapper ()
 

Additional Inherited Members

- Public Types inherited from IImageWrapper
using TStringMap = TMap< FString, FString >
 
- Static Public Member Functions inherited from IImageWrapper
static IMAGEWRAPPER_API void ConvertRawImageFormat (ERawImageFormat::Type RawFormat, ERGBFormat &OutFormat, int &OutBitDepth)
 
static IMAGEWRAPPER_API ERawImageFormat::Type ConvertRGBFormat (ERGBFormat RGBFormat, int BitDepth, bool *bIsExactMatch=nullptr)
 
static IMAGEWRAPPER_API int64 GetRGBFormatBytesPerPel (ERGBFormat RGBFormat, int BitDepth)
 
- Protected Attributes inherited from IImageWrapper
const TCHARDebugImageName = nullptr
 

Detailed Description

To load the HDR file image format. Does not support all possible types HDR formats (e.g. xyze is not supported)

Member Function Documentation

◆ AddMetadata()

void FHdrImageWrapper::AddMetadata ( const FString &  InKey,
const FString &  InValue 
)
overridevirtual

Adds a key and value to this image's metadata. Will be saved in the image's header and restored when the image is loaded.

Parameters
InKeyMetadata consists of key value pairs.
InValueMetadata consists of key value pairs.

Implements IImageWrapper.

◆ CanSetRawFormat()

bool FHdrImageWrapper::CanSetRawFormat ( const ERGBFormat  InFormat,
const int32  InBitDepth 
) const
overridevirtual

CanSetRawFormat returns true if SetRaw will accept this format

Implements IImageWrapper.

◆ FreeCompressedData()

void FHdrImageWrapper::FreeCompressedData ( )

◆ GetBitDepth()

int32 FHdrImageWrapper::GetBitDepth ( ) const
overridevirtual

Gets the bit depth of the image.

Returns
The bit depth per-channel of the image.

Beware several of the old wrappers (BMP,TGA) incorrectly used to return bits per color not per channel they now correctly return per-channel.

Implements IImageWrapper.

◆ GetCompressed()

TArray64< uint8 > FHdrImageWrapper::GetCompressed ( int32  Quality = 0)
overridevirtual

Gets the compressed data. (call SetRaw first) (Note: It may consume the data set in the SetCompressed function if it was set before)

Returns
Array of the compressed data. returns empty array on failure

Implements IImageWrapper.

◆ GetErrorMessage()

const FText & FHdrImageWrapper::GetErrorMessage ( ) const

◆ GetFormat()

ERGBFormat FHdrImageWrapper::GetFormat ( ) const
overridevirtual

Gets the format of the image. Theoretically, this is the format it would be best to call GetRaw() with, if you support it.

Returns
The format the image data is in

Implements IImageWrapper.

◆ GetHeight()

int64 FHdrImageWrapper::GetHeight ( ) const
overridevirtual

Gets the height of the image.

Returns
Image height.
See also
GetWidth

Implements IImageWrapper.

◆ GetMetadata()

void FHdrImageWrapper::GetMetadata ( TStringMap OutMetadata) const
overridevirtual

Copies this image's metadata to the caller's map.

Parameters
OutMetadataA copy of this image's metadata.

Implements IImageWrapper.

◆ GetRaw() [1/8]

IMAGEWRAPPER_API bool FHdrImageWrapper::GetRaw ( const ERGBFormat  InFormat,
int32  InBitDepth,
FDecompressedImageOutput OutDecompressedImage 
)
overridevirtual

Gets the raw data and meta info (Note: It may consume the data set in the SetRaw function if it was set before)

Parameters
InFormatHow we want to manipulate the RGB data.
InBitDepthThe output bit-depth per channel, normally 8.
OutRawDataWill contain the uncompressed raw data.
OutDecompressedImageWill contain the mip images if available and other metadata.
Returns
true on success, false otherwise.

this is often broken, should only be used with InFormat == GetFormat() DEPRECATED , use GetRaw() with 2 argument or GetRawImage() meta info overload

Implements IImageWrapper.

◆ GetRaw() [2/8]

virtual bool IImageWrapper::GetRaw ( const ERGBFormat  InFormat,
int32  InBitDepth,
FDecompressedImageOutput OutDecompressedImage 
)
virtual

Gets the raw data and meta info (Note: It may consume the data set in the SetRaw function if it was set before)

Parameters
InFormatHow we want to manipulate the RGB data.
InBitDepthThe output bit-depth per channel, normally 8.
OutRawDataWill contain the uncompressed raw data.
OutDecompressedImageWill contain the mip images if available and other metadata.
Returns
true on success, false otherwise.

this is often broken, should only be used with InFormat == GetFormat() DEPRECATED , use GetRaw() with 2 argument or GetRawImage() meta info overload

Implements IImageWrapper.

◆ GetRaw() [3/8]

bool FHdrImageWrapper::GetRaw ( const ERGBFormat  InFormat,
int32  InBitDepth,
TArray64< uint8 > &  OutRawData 
)
overridevirtual

Gets the raw data. (Note: It may consume the data set in the SetRaw function if it was set before)

Parameters
InFormatHow we want to manipulate the RGB data.
InBitDepthThe output bit-depth per channel, normally 8.
OutRawDataWill contain the uncompressed raw data.
Returns
true on success, false otherwise.

this is often broken, should only be used with InFormat == GetFormat() DEPRECATED , use GetRaw() with 1 argument or GetRawImage()

Implements IImageWrapper.

◆ GetRaw() [4/8]

virtual bool IImageWrapper::GetRaw ( const ERGBFormat  InFormat,
int32  InBitDepth,
TArray64< uint8 > &  OutRawData 
)
virtual

Gets the raw data. (Note: It may consume the data set in the SetRaw function if it was set before)

Parameters
InFormatHow we want to manipulate the RGB data.
InBitDepthThe output bit-depth per channel, normally 8.
OutRawDataWill contain the uncompressed raw data.
Returns
true on success, false otherwise.

this is often broken, should only be used with InFormat == GetFormat() DEPRECATED , use GetRaw() with 1 argument or GetRawImage()

Implements IImageWrapper.

◆ GetRaw() [5/8]

bool IImageWrapper::GetRaw ( const ERGBFormat  InFormat,
int32  InBitDepth,
TArray< uint8 > &  OutRawData 
)
inline

Gets the raw data in a TArray. Only use this if you're certain that the image is less than 2 GB in size. Prefer using the overload which takes a TArray64 in general. (Note: It may consume the data set in the SetRaw function if it was set before)

Parameters
InFormatHow we want to manipulate the RGB data.
InBitDepthThe output bit-depth per channel, normally 8.
OutRawDataWill contain the uncompressed raw data.
Returns
true on success, false otherwise.

this is often broken, should only be used with InFormat == GetFormat() DEPRECATED , use GetRaw() with 1 argument or GetRawImage()

◆ GetRaw() [6/8]

bool IImageWrapper::GetRaw ( const ERGBFormat  InFormat,
int32  InBitDepth,
TArrayView64< uint8 OutRawData 
)
inline

Get the raw version of the image and write to the array view (Note: It may consume the data set in the SetRaw function if it was set before)

Parameters
InFormatHow we want to manipulate the RGB data.
InBitDepthThe output bit-depth per channel, normally 8.
OutRawDataWill contain the uncompressed raw data.
Returns
true on success, false otherwise.

this is often broken, should only be used with InFormat == GetFormat() DEPRECATED , use GetRaw() with 1 argument or GetRawImage()

◆ GetRaw() [7/8]

bool IImageWrapper::GetRaw ( FDecompressedImageOutput OutDecompressedImage)
inline

GetRaw after SetCompressed fills the raw data in the native format/depth contained in the file along with meta info Do not use the GetRaw() variants that take format/depth arguments.

Parameters
OutRawDataFilled with raw image data.
OutDecompressedImageFilled with mip images and other metadata.

This GetRaw call replaces the variants with format/depth arguments, but prefer GetRawImage instead.

◆ GetRaw() [8/8]

bool IImageWrapper::GetRaw ( TArray64< uint8 > &  OutRawData)
inline

GetRaw after SetCompressed fills the raw data in the native format/depth contained in the file Do not use the GetRaw() variants that take format/depth arguments.

Parameters
OutRawDataFilled with raw image data.

This GetRaw call replaces the variants with format/depth arguments, but prefer GetRawImage instead.

◆ GetSupportedRawFormat()

ERawImageFormat::Type FHdrImageWrapper::GetSupportedRawFormat ( const ERawImageFormat::Type  InFormat) const
overridevirtual

returns InFormat if supported, else maps to something supported the returned format will pass CanSetRawFormat()

Implements IImageWrapper.

◆ GetWidth()

int64 FHdrImageWrapper::GetWidth ( ) const
overridevirtual

Gets the width of the image.

Returns
Image width.
See also
GetHeight

Implements IImageWrapper.

◆ SetCompressed()

bool FHdrImageWrapper::SetCompressed ( const void InCompressedData,
int64  InCompressedSize 
)
overridevirtual

Sets the compressed data. Can then call GetRaw().

Parameters
InCompressedDataThe memory address of the start of the compressed data.
InCompressedSizeThe size of the compressed data parsed.
Returns
true if data was the expected format.

after SetCompressed, image info queries like GetWidth and GetBitDepth are allowed call GetRaw to get the decoded bits decompression is not done until GetRaw

Implements IImageWrapper.

◆ SetCompressedFromView()

bool FHdrImageWrapper::SetCompressedFromView ( TArrayView64< const uint8 Data)

◆ SetRaw()

bool FHdrImageWrapper::SetRaw ( const void InRawData,
int64  InRawSize,
const int32  InWidth,
const int32  InHeight,
const ERGBFormat  InFormat,
const int32  InBitDepth,
const int32  InBytesPerRow 
)
overridevirtual

Sets the raw image data. Prepares to call GetCompressed() next.

Parameters
InRawDataThe memory address of the start of the raw data.
InRawSizeThe size of the compressed data parsed.
InWidthThe width of the image data.
InHeightthe height of the image data.
InFormatthe format the raw data is in, normally RGBA.
InBitDepththe bit-depth per channel, normally 8.
InBytesPerRowthe number of bytes between rows, 0 = tightly packed rows with no padding.
Returns
true if data was the expected format.

you must not SetRaw() with a format unless it passes CanSetRawFormat() deprecated : avoid direct calls to SetRaw(), use ImageWrapperModule CompressImage instead do not use InBytesPerRow, it is ignored SetRaw does not take gamma information assumes U8 = SRGB and all else = Linear

Implements IImageWrapper.

◆ SupportsMetadata()

bool FHdrImageWrapper::SupportsMetadata ( ) const
overridevirtual

Does this image type support embedded metadata in its header?

PNG is an example of an image type which supports adding user-defined metadata to its header.

Implements IImageWrapper.


The documentation for this class was generated from the following files: