UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
BlockCodingHelpers.cpp File Reference

Classes

struct  DXT1Block
 
struct  AlphaBlock
 
struct  BC4Block
 
struct  DXT5Block
 
struct  BC5Block
 
struct  BC6Block
 
struct  BC7Block
 
struct  ASTCBlock
 
struct  FloatPixel
 
struct  Float16Pixel
 

Macros

#define MAKE_565(r, g, b)   (((r>>3) << 11) | ((g>>2) << 5) | (b>>3))
 
#define MAKE_8888(r, g, b, a)   ((a << 24) | (b << 16) | (g << 8) | r)
 
#define UNORM16(x)   (x << 8) | x
 
#define UNORM16_SRGB(x)   (x << 8) | 0x80
 
#define NUM_LEVEL_COLORS   14
 

Functions

DXT1Block MakeDXT1 (const uint8 *Rgb)
 
BC4Block MakeBC4 (const uint8 *R)
 
DXT5Block MakeDXT5 (const uint8 *Rgba)
 
BC5Block MakeBC5 (const uint8 *Rg)
 
BC7Block MakeBC7 (const uint8 *rgb)
 
ASTCBlock MakeASTC (const uint8 *rgb, bool sRGB)
 
uint16_t Float32ToFloat16 (float value)
 
Float16Pixel MakeFloat16 (const uint8 *rgb)
 
BC6Block MakeBC6 (const uint8 *rgb)
 
FloatPixel MakeFloat (const uint8 *rgb)
 
uint32 MakeRGBA (const uint8 *Rgba)
 
uint32 MakeBGRA (const uint8 *Rgba)
 
template<class PixelType >
void PatchLine (PixelType *data, const PixelType &value, int items)
 
template<class PixelType >
void PatchBlock (PixelType *data, const PixelType &value, int Width, int Height, int Stride)
 
template<class PixelType >
void Patch (PixelType *data, PixelType value, int width, int height, int borderWidth, int Stride)
 
void BakeDebugInfo (const FVTUploadTileBuffer &TileBuffer, int32 Width, int32 Height, int32 Border, EPixelFormat Format, int32 MipLevel)
 
bool UniformColorPixels (const FVTUploadTileBuffer &TileBuffer, int32 Width, int32 Height, EPixelFormat Format, const uint8 *Color)
 

Variables

unsigned char MipColors [NUM_LEVEL_COLORS][3]
 
unsigned char MipGreys [NUM_LEVEL_COLORS][1]
 

Macro Definition Documentation

◆ MAKE_565

#define MAKE_565 (   r,
  g,
 
)    (((r>>3) << 11) | ((g>>2) << 5) | (b>>3))

◆ MAKE_8888

#define MAKE_8888 (   r,
  g,
  b,
 
)    ((a << 24) | (b << 16) | (g << 8) | r)

◆ NUM_LEVEL_COLORS

#define NUM_LEVEL_COLORS   14

◆ UNORM16

#define UNORM16 (   x)    (x << 8) | x

◆ UNORM16_SRGB

#define UNORM16_SRGB (   x)    (x << 8) | 0x80

Function Documentation

◆ BakeDebugInfo()

void BakeDebugInfo ( const FVTUploadTileBuffer TileBuffer,
int32  Width,
int32  Height,
int32  Border,
EPixelFormat  Format,
int32  MipLevel 
)

◆ Float32ToFloat16()

uint16_t Float32ToFloat16 ( float  value)

◆ MakeASTC()

ASTCBlock MakeASTC ( const uint8 rgb,
bool  sRGB 
)

◆ MakeBC4()

BC4Block MakeBC4 ( const uint8 R)

◆ MakeBC5()

BC5Block MakeBC5 ( const uint8 Rg)

◆ MakeBC6()

BC6Block MakeBC6 ( const uint8 rgb)

◆ MakeBC7()

BC7Block MakeBC7 ( const uint8 rgb)

◆ MakeBGRA()

uint32 MakeBGRA ( const uint8 Rgba)

◆ MakeDXT1()

DXT1Block MakeDXT1 ( const uint8 Rgb)

◆ MakeDXT5()

DXT5Block MakeDXT5 ( const uint8 Rgba)

◆ MakeFloat()

FloatPixel MakeFloat ( const uint8 rgb)

◆ MakeFloat16()

Float16Pixel MakeFloat16 ( const uint8 rgb)

◆ MakeRGBA()

uint32 MakeRGBA ( const uint8 Rgba)

◆ Patch()

template<class PixelType >
void Patch ( PixelType *  data,
PixelType  value,
int  width,
int  height,
int  borderWidth,
int  Stride 
)

This patches a borderWidth pixels wide border around the given image to the 'value'

◆ PatchBlock()

template<class PixelType >
void PatchBlock ( PixelType *  data,
const PixelType &  value,
int  Width,
int  Height,
int  Stride 
)
inline

◆ PatchLine()

template<class PixelType >
void PatchLine ( PixelType *  data,
const PixelType &  value,
int  items 
)
inline

◆ UniformColorPixels()

bool UniformColorPixels ( const FVTUploadTileBuffer TileBuffer,
int32  Width,
int32  Height,
EPixelFormat  Format,
const uint8 Color 
)

Variable Documentation

◆ MipColors

Initial value:
=
{
{ 255, 255, 255 },
{ 255, 255, 000 },
{ 000, 255, 255 },
{ 000, 255, 000 },
{ 255, 000, 255 },
{ 255, 000, 000 },
{ 000, 000, 255 },
{ 128, 128, 128 },
{ 128, 128, 000 },
{ 000, 128, 128 },
{ 000, 128, 000 },
{ 128, 000, 128 },
{ 128, 000, 000 },
{ 000, 000, 128 }
}

◆ MipGreys

Initial value:
=
{
{ 255 },
{ 220 },
{ 200 },
{ 180 },
{ 160 },
{ 140 },
{ 120 },
{ 100 },
{ 80 },
{ 60 },
{ 40 },
{ 20 },
{ 10 },
{ 0 }
}