WoWs Model Exported
World of Warships 3D model Exporter
Loading...
Searching...
No Matches
DDS texture decoding

Functions

std::vector< uint8_t > wows_stitch_decode_dds (const uint8_t *d, size_t sz, int *W, int *H)
 Decode a DDS texture buffer to raw RGBA pixels.
 
std::vector< uint8_t > wows_stitch_dds_to_png (const std::string &path, int max_sz)
 Load a .dds file from disk and encode it as a PNG byte buffer.
 
std::vector< uint8_t > wows_stitch_dds_to_png_from_memory (const uint8_t *data, size_t size, int max_sz)
 Decode a DDS buffer in memory and encode it as a PNG byte buffer.
 

Detailed Description

Function Documentation

◆ wows_stitch_dds_to_png()

std::vector< uint8_t > wows_stitch_dds_to_png ( const std::string &  path,
int  max_sz 
)

Load a .dds file from disk and encode it as a PNG byte buffer.

If either dimension exceeds max_sz the image is downscaled to fit.

Parameters
pathFilesystem path to the .dds file.
max_szMaximum allowed width or height; 0 means no limit.
Returns
PNG-encoded bytes, or empty on failure.

◆ wows_stitch_dds_to_png_from_memory()

std::vector< uint8_t > wows_stitch_dds_to_png_from_memory ( const uint8_t *  data,
size_t  size,
int  max_sz 
)

Decode a DDS buffer in memory and encode it as a PNG byte buffer.

Like wows_stitch_dds_to_png but operates on an already-loaded DDS buffer rather than a filesystem path. Used when textures are archive-backed.

Parameters
dataPointer to DDS file data in memory.
sizeSize of the DDS data in bytes.
max_szMaximum allowed width or height; 0 means no limit.
Returns
PNG-encoded bytes, or empty on failure.

◆ wows_stitch_decode_dds()

std::vector< uint8_t > wows_stitch_decode_dds ( const uint8_t *  d,
size_t  sz,
int *  W,
int *  H 
)

Decode a DDS texture buffer to raw RGBA pixels.

Supports the BC1/BC3/BC5/BC7 block-compressed formats used in WoWs.

Parameters
dPointer to the DDS file data in memory.
szSize of the DDS data in bytes.
WOutput: decoded image width in pixels.
HOutput: decoded image height in pixels.
Returns
RGBA pixel data (W × H × 4 bytes), or empty on failure.