cp2077_extractor.cr2w.textures

Texture extraction and conversion logic.

Classes:

DDSFormat(value)

Enum of different formats for DirectDraw Surface .dds files.

Functions:

get_dds_decoder(dds_format)

Returns the function to decode a DDS texture, for use with PIL.Image.frombytes().

get_dds_format_from_compression(compression)

Find the DDS format for the given texture compression type.

texture_to_image(texture)

Convert a texture to a PIL image.

class DDSFormat(value)[source]

Bases: Enum

Enum of different formats for DirectDraw Surface .dds files.

get_dds_decoder(dds_format)[source]

Returns the function to decode a DDS texture, for use with PIL.Image.frombytes().

Parameters

dds_format (DDSFormat)

Return type

Callable[bytes, int, int, bytes]

get_dds_format_from_compression(compression)[source]

Find the DDS format for the given texture compression type.

:param compression

Return type

DDSFormat

texture_to_image(texture)[source]

Convert a texture to a PIL image.

Parameters

texture (CBitmapTexture)

Return type

Image