Navigation
API > API/Runtime > API/Runtime/ImageWrapper
Inheritance Hierarchy
- IModuleInterface
- IImageWrapperModule
References
| Module | ImageWrapper |
| Header | /Engine/Source/Runtime/ImageWrapper/Public/IImageWrapperModule.h |
| Include | #include "IImageWrapperModule.h" |
Syntax
class IImageWrapperModule : public IModuleInterface
Remarks
Interface for image wrapper modules.
If you have "Engine" module, then just use FImageUtils::CompressImage/DecompressImage
The easiest way to load/save an image is FImageUtils::LoadImage/SaveImageByExtension
NOTE: Please prefer to work with images through ImageCore FImage/FImageView (not TextureSource/TextureSourceFormat or raw arrays of bytes)
note on SRGB/Gamma handling : it is assumed that non-U8 data is always Linear U8 data is written without changing the bytes the gamma correction of U8 bytes is NOT persisted in the file formats (for read or write) loading will always give you SRGB for U8 (ERawImageFormat::GetDefaultGammaSpace) if U8-float conversions are required, they do respect gamma space
eg. if you write U8 Linear data to EXR, it will be converted to Linear float from U8 Linear correctly if you write U8 Linear to BMP , it will write the U8 bytes unchanged, and on load it will come back in as U8 SRGB
Destructors
| Type | Name | Description | |
|---|---|---|---|
| Virtual destructor. |
Functions
| Type | Name | Description | |
|---|---|---|---|
| bool | CompressImage
(
TArray64< uint8 >& OutData, |
Convert input FImage into a file-format encoded array. | |
| void | ConvertRawImageFormat
(
ERawImageFormat::Type RawFormat, |
Convert an FImageERawImageFormat into an ImageWrapper style {ERGBFormat+BitDepth} mapping is always possible and requires no conversion | |
| ERawImageFormat::Type | ConvertRGBFormat
(
ERGBFormat Format, |
Convert an ImageWrapper style {ERGBFormat+BitDepth} into an ERawImageFormat for FImage returns ERawImageFormat::Invalid if no mapping is possible bIsExactMatch is filled with whether the formats are an exact match or not if not, conversion is needed | |
| TSharedPtr< IImageWrapper > | CreateImageWrapper
(
const EImageFormat InFormat, |
Create an IImageWrapper helper of a specific type | |
| bool | DecompressImage
(
const void* InCompressedData, |
Read an image from file format encoded data. | |
| bool | DecompressImage
(
const void* InCompressedData, |
Read an image from file format encoded data. | |
| EImageFormat | DetectImageFormat
(
const void* InCompressedData, |
Detect image format by looking at the first few bytes of the compressed image data. | |
| EImageFormat | GetDefaultOutputFormat
(
ERawImageFormat::Type RawFormat |
Get a good default output image format for a pixel format | |
| const TCHAR * | GetExtension
(
EImageFormat Format |
Returns extension, not including the "." , 3 or 4 chars | |
| EImageFormat | GetImageFormatFromExtension
(
const TCHAR* Name |
Name can be a full name like "xx.png" or just the extension part, like "png" returns EImageFormat::Invalid if no supported image extension found |