Full DataFormat
: is zero byte separator. every other char is 1 byte
FILESTART is - GST2:VERS:WDTH:HGHT:DTFM:MMLM:RSVD:RSVD:RSVD
IMAGE_FORMAT is - FRMT:WI:HG:MIPA:FRM2
IMAGE_PAYLOAD is - SIZE:IMAGEPAYLOAD
SIZE:IMAGEPAYLOAD
SIZE:IMAGEPAYLOAD
SIZE:IMAGEPAYLOAD
SIZE:IMAGEPAYLOAD
FILESTART in detail
FILESTART is GST2:VERS:WDTH:HGHT:DTFM:MMRS:MRSV:RSVD:RSVD:RSVD
Legend:
GST2 - 4 byte ASCII, has to be 'GST2'
VERS - uint32 (4 bytes) file version, has to be 1 in code or CompressedTexture2D::load_image quits
WDTH - uint32 width
HGHT - uint32 height
DTFM - uint32 DataFormat of the file as 1 bit flags: see enum FormatBits
MMLM - MipMap limit
IMAGE_FORMAT in detail: Data based on DRFM format, godot simply loads it as "load image"
IMAGE_PAYLOAD is - FRMT:WI:HG:MIPA:FRM2
FRMT - uint32 - image format enum Texture::DataFormat: "image", "png", "webp", "basis_universal"
WI - uint16 - width
HG - uint16 - height
MIPA - uint32 - literally number of mipmaps as a uint, they are loaded in a for controlled by MIPM
FRM2 - uint32 - format of the image based on enum Image::Format, see bellow
IMAGE_PAYLOAD om detail: Contains two things, a 4 byte uint indicating size and the actual PNG, WebP, basis_universal or (raw) Image.
flag FORMAT_BIT_STREAM DRFM if not set, will read the whole file, if set, will read based on max size given when loading only then will PAYLOAD be rocessed to be read as an image by CompressedTexture2D.
/scene/resources/texture.h // enum FormatBits { FORMAT_BIT_STREAM = 1 << 22, FORMAT_BIT_HAS_MIPMAPS = 1 << 23, FORMAT_BIT_DETECT_3D = 1 << 24, //FORMAT_BIT_DETECT_SRGB = 1 << 25, FORMAT_BIT_DETECT_NORMAL = 1 << 26, FORMAT_BIT_DETECT_ROUGNESS = 1 << 27, };
/scene/resources/image.h // enum DataFormat { DATA_FORMAT_IMAGE, DATA_FORMAT_PNG, DATA_FORMAT_WEBP, DATA_FORMAT_BASIS_UNIVERSAL, };
========================================================
IMHEX pattern for editor: