Files
UnrealEngineUWP/Engine/Source/Runtime/ImageWrapper/Public/TgaImageSupport.h
Bryan sefcik b4a6e947d8 Ran IWYU on Public headers under Engine/Source/Runtime/...
Headers are updated to contain any missing #includes needed to compile and #includes are sorted.  Nothing is removed.

#ushell-cherrypick of 21065896 by bryan.sefcik
#preflight 62d4b1a5a6141b6adfb0c892
#jira

#ROBOMERGE-OWNER: Bryan.sefcik
#ROBOMERGE-AUTHOR: bryan.sefcik
#ROBOMERGE-SOURCE: CL 21150156 via CL 21151754 via CL 21154719
#ROBOMERGE-BOT: UE5 (Release-Engine-Staging -> Main) (v972-20964824)
#ROBOMERGE-CONFLICT from-shelf

[CL 21181076 by Bryan sefcik in ue5-main branch]
2022-07-20 11:31:36 -04:00

41 lines
1.1 KiB
C

// Copyright Epic Games, Inc. All Rights Reserved.
#pragma once
#include "CoreMinimal.h"
#include "HAL/Platform.h"
#include "Serialization/Archive.h"
#pragma pack(push,1)
struct FTGAFileHeader
{
uint8 IdFieldLength;
uint8 ColorMapType;
uint8 ImageTypeCode; // 2 for uncompressed RGB format
uint16 ColorMapOrigin;
uint16 ColorMapLength;
uint8 ColorMapEntrySize;
uint16 XOrigin;
uint16 YOrigin;
uint16 Width;
uint16 Height;
uint8 BitsPerPixel;
uint8 ImageDescriptor;
friend FArchive& operator<<( FArchive& Ar, FTGAFileHeader& H )
{
Ar << H.IdFieldLength << H.ColorMapType << H.ImageTypeCode;
Ar << H.ColorMapOrigin << H.ColorMapLength << H.ColorMapEntrySize;
Ar << H.XOrigin << H.YOrigin << H.Width << H.Height << H.BitsPerPixel;
Ar << H.ImageDescriptor;
return Ar;
}
};
#pragma pack(pop)
/**
* This helper allows to decompress TGA data in a pre-allocated memory block.
* The pixel format is necessarily PF_A8R8G8B8.
*/
IMAGEWRAPPER_API bool DecompressTGA_helper( const FTGAFileHeader* TGA, const int64 TGABufferLenght, uint32*& TextureData, const int32 TextureDataSize );