UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
BmpImageSupport.h
Go to the documentation of this file.
1// Copyright Epic Games, Inc. All Rights Reserved.
2
3#pragma once
4
5#include "CoreMinimal.h"
6
9
10// Bitmap compression types.
21
22// Bitmap info header versions.
32
33// Color space type of the bitmap, property introduced in Bitmap header version 4.
35{
36 BCST_BLCS_CALIBRATED_RGB = 0x00000000,
37 BCST_LCS_sRGB = 0x73524742,
39 BCST_PROFILE_LINKED = 0x4C494E4B,
40 BCST_PROFILE_EMBEDDED = 0x4D424544,
41};
42
43// .BMP file header.
44#pragma pack(push,1)
59#pragma pack(pop)
60
61// .BMP subheader.
62#pragma pack(push,1)
64{
77 {
78 Ar << H.biSize << H.biWidth << H.biHeight;
79 Ar << H.biPlanes << H.biBitCount;
80 Ar << H.biCompression << H.biSizeImage;
82 Ar << H.biClrUsed << H.biClrImportant;
83 return Ar;
84 }
85
86public:
88 {
89 // Since there is no field indicating the header version of the bitmap in the FileHeader,
90 // the only way to know the format version is to check the header size.
91 //
92 // note that Adobe (incorrectly) writes biSize as 40 and then BMFH bfOffBits will be 52 or 56
93 // so this code does not detect those variant headers
94 switch (biSize)
95 {
96 case 40:
98 case 52:
99 // + RGB 32 bit masks
101 case 56:
102 // + RGBA 32 bit masks
104 case 108:
106 case 124:
108 default:
110 }
111 }
112};
113#pragma pack(pop)
114
115
116// .BMP subheader V4
117#pragma pack(push,1)
164#pragma pack(pop)
165
166
167#pragma pack(push, 1)
168//Used by InfoHeaders pre-version 4, a structure that is declared after the FBitmapInfoHeader.
170{
171 // RGBA, in header pre-version 4, Alpha was only used as padding.
173};
174#pragma pack(pop)
EBitmapCSType
Definition BmpImageSupport.h:35
@ BCST_LCS_WINDOWS_COLOR_SPACE
@ BCST_BLCS_CALIBRATED_RGB
EBitmapCompression
Definition BmpImageSupport.h:12
@ BCBI_RLE8
Definition BmpImageSupport.h:14
@ BCBI_RGB
Definition BmpImageSupport.h:13
@ BCBI_ALPHABITFIELDS
Definition BmpImageSupport.h:19
@ BCBI_RLE4
Definition BmpImageSupport.h:15
@ BCBI_PNG
Definition BmpImageSupport.h:18
@ BCBI_JPEG
Definition BmpImageSupport.h:17
@ BCBI_BITFIELDS
Definition BmpImageSupport.h:16
EBitmapHeaderVersion
Definition BmpImageSupport.h:24
FPlatformTypes::int32 int32
A 32-bit signed integer.
Definition Platform.h:1125
uint8_t uint8
Definition binka_ue_file_header.h:8
uint16_t uint16
Definition binka_ue_file_header.h:7
uint32_t uint32
Definition binka_ue_file_header.h:6
Definition Archive.h:1208
Definition BmpImageSupport.h:46
friend FArchive & operator<<(FArchive &Ar, FBitmapFileHeader &H)
Definition BmpImageSupport.h:53
uint16 bfReserved1
Definition BmpImageSupport.h:49
uint16 bfType
Definition BmpImageSupport.h:47
uint32 bfSize
Definition BmpImageSupport.h:48
uint16 bfReserved2
Definition BmpImageSupport.h:50
uint32 bfOffBits
Definition BmpImageSupport.h:51
Definition BmpImageSupport.h:119
uint32 biCSType
Definition BmpImageSupport.h:135
int32 bibiEndPointGreenX
Definition BmpImageSupport.h:139
int32 biEndPointGreenZ
Definition BmpImageSupport.h:141
uint32 biClrImportant
Definition BmpImageSupport.h:130
int32 biEndPointBlueZ
Definition BmpImageSupport.h:144
int32 biHeight
Definition BmpImageSupport.h:122
uint32 biGreenMask
Definition BmpImageSupport.h:132
int32 biEndPointRedY
Definition BmpImageSupport.h:137
uint32 biYPelsPerMeter
Definition BmpImageSupport.h:128
uint16 biBitCount
Definition BmpImageSupport.h:124
uint16 biPlanes
Definition BmpImageSupport.h:123
uint32 biWidth
Definition BmpImageSupport.h:121
int32 biEndPointRedX
Definition BmpImageSupport.h:136
uint32 biRedMask
Definition BmpImageSupport.h:131
uint32 biCompression
Definition BmpImageSupport.h:125
uint32 biSizeImage
Definition BmpImageSupport.h:126
friend FArchive & operator<<(FArchive &Ar, FBitmapInfoHeaderV4 &H)
Definition BmpImageSupport.h:149
int32 biEndPointBlueY
Definition BmpImageSupport.h:143
uint32 biXPelsPerMeter
Definition BmpImageSupport.h:127
int32 biEndPointGreenY
Definition BmpImageSupport.h:140
uint32 biClrUsed
Definition BmpImageSupport.h:129
uint32 biAlphaMask
Definition BmpImageSupport.h:134
uint32 biGammaRed
Definition BmpImageSupport.h:145
int32 biEndPointBlueX
Definition BmpImageSupport.h:142
uint32 biGammaBlue
Definition BmpImageSupport.h:147
uint32 biGammaGreen
Definition BmpImageSupport.h:146
int32 bibiEndPointRedZ
Definition BmpImageSupport.h:138
uint32 biSize
Definition BmpImageSupport.h:120
uint32 biBlueMask
Definition BmpImageSupport.h:133
Definition BmpImageSupport.h:64
uint32 biXPelsPerMeter
Definition BmpImageSupport.h:72
uint32 biClrImportant
Definition BmpImageSupport.h:75
EBitmapHeaderVersion GetHeaderVersion() const
Definition BmpImageSupport.h:87
int32 biHeight
Definition BmpImageSupport.h:67
uint32 biYPelsPerMeter
Definition BmpImageSupport.h:73
uint16 biBitCount
Definition BmpImageSupport.h:69
friend FArchive & operator<<(FArchive &Ar, FBitmapInfoHeader &H)
Definition BmpImageSupport.h:76
uint32 biCompression
Definition BmpImageSupport.h:70
uint16 biPlanes
Definition BmpImageSupport.h:68
uint32 biSizeImage
Definition BmpImageSupport.h:71
uint32 biClrUsed
Definition BmpImageSupport.h:74
uint32 biSize
Definition BmpImageSupport.h:65
uint32 biWidth
Definition BmpImageSupport.h:66
Definition BmpImageSupport.h:170
uint32 RGBAMask[4]
Definition BmpImageSupport.h:172