# E:/DevIL/src-IL/src/il_dds.c File Reference

`#include "il_internal.h"`
`#include "il_dds.h"`

## Functions

ILboolean | ilIsValidDds (ILconst_string FileName)
| Checks if the file specified in FileName is a valid .dds file.
ILboolean | ilIsValidDdsF (ILHANDLE File)
| Checks if the ILHANDLE contains a valid .dds file at the current position.
ILboolean | ilIsValidDdsL (const void *Lump, ILuint Size)
| Checks if Lump is a valid .dds lump.
ILboolean | iGetDdsHead (DDSHEAD *Header)
ILboolean | iIsValidDds ()
ILboolean | iCheckDds (DDSHEAD *Head)
ILboolean | ilLoadDds (ILconst_string FileName)
| Reads a .dds file.
ILboolean | ilLoadDdsF (ILHANDLE File)
| Reads an already-opened .dds file.
ILboolean | ilLoadDdsL (const void *Lump, ILuint Size)
| Reads from a memory "lump" that contains a .dds.
ILubyte | iCompFormatToBpp (ILenum Format)
ILubyte | iCompFormatToBpc (ILenum Format)
ILubyte | iCompFormatToChannelCount (ILenum Format)
ILboolean | iLoadDdsCubemapInternal ()
ILboolean | iLoadDdsInternal ()
ILuint | DecodePixelFormat ()
void | AdjustVolumeTexture (DDSHEAD *Head)
ILboolean | ReadData ()
ILboolean | AllocImage ()
ILboolean | Decompress ()
ILboolean | ReadMipmaps ()
void | DxtcReadColors (const ILubyte *Data, Color8888 *Out)
void | DxtcReadColor (ILushort Data, Color8888 *Out)
ILboolean | DecompressDXT1 (ILimage *lImage, ILubyte *lCompData)
ILboolean | DecompressDXT2 (ILimage *lImage, ILubyte *lCompData)
ILboolean | DecompressDXT3 (ILimage *lImage, ILubyte *lCompData)
ILboolean | DecompressDXT4 (ILimage *lImage, ILubyte *lCompData)
ILboolean | DecompressDXT5 (ILimage *lImage, ILubyte *lCompData)
ILboolean | Decompress3Dc ()
ILboolean | DecompressAti1n ()
ILboolean | DecompressRXGB ()
unsigned int | halfToFloat (unsigned short y)
ILboolean | iConvFloat16ToFloat32 (ILuint *dest, ILushort *src, ILuint size)
ILboolean | DecompressFloat (ILuint lCompFormat)
void | CorrectPreMult ()
ILboolean | DecompressARGB ()
void | GetBitsFromMask (ILuint Mask, ILuint *ShiftLeft, ILuint *ShiftRight)
ILubyte *ILAPIENTRY | ilGetDxtcData ()
void | ilFreeSurfaceDxtcData ()
void | ilFreeImageDxtcData ()
ILAPI ILboolean ILAPIENTRY | ilDxtcDataToSurface ()
ILAPI ILboolean ILAPIENTRY | ilDxtcDataToImage ()
ILAPI ILboolean ILAPIENTRY | ilSurfaceToDxtcData (ILenum Format)
ILAPI ILboolean ILAPIENTRY | ilImageToDxtcData (ILenum Format)
ILAPI ILboolean ILAPIENTRY | ilTexImageDxtc (ILint w, ILint h, ILint d, ILenum DxtFormat, const ILubyte *data)
void | iFlipColorBlock (ILubyte *data)
void | iFlipSimpleAlphaBlock (ILushort *data)
void | iComplexAlphaHelper (ILubyte *Data)
void | iFlipComplexAlphaBlock (ILubyte *Data)
void | iFlipDxt1 (ILubyte *data, ILuint count)
void | iFlipDxt3 (ILubyte *data, ILuint count)
void | iFlipDxt5 (ILubyte *data, ILuint count)
void | iFlip3dc (ILubyte *data, ILuint count)
ILAPI void ILAPIENTRY | ilFlipSurfaceDxtcData ()
void | iInvertDxt3Alpha (ILubyte *data)
void | iInvertDxt5Alpha (ILubyte *data)
ILAPI ILboolean ILAPIENTRY | ilInvertSurfaceDxtcDataAlpha ()

## Variables

ILuint | CubemapDirections [CUBEMAP_SIDES]

## Function Documentation

void AdjustVolumeTexture | ( | DDSHEAD * | Head | ) |

(Head->ddsCaps1 & DDS_COMPLEX) ||

Referenced by iLoadDdsInternal().

ILboolean AllocImage | ( |  | ) |

Referenced by iLoadDdsCubemapInternal(), and iLoadDdsInternal().

void CorrectPreMult | ( |  | ) |

Referenced by DecompressDXT2(), and DecompressDXT4().

ILuint DecodePixelFormat | ( |  | ) |

Referenced by iLoadDdsInternal().

ILboolean Decompress | ( |  | ) |

Referenced by ilDxtcDataToSurface(), iLoadDdsCubemapInternal(), iLoadDdsInternal(), and ReadMipmaps().

ILboolean Decompress3Dc | ( |  | ) |

Referenced by Decompress().

ILboolean DecompressARGB | ( |  | ) |

Referenced by Decompress().

ILboolean DecompressAti1n | ( |  | ) |

Referenced by Decompress().

ILboolean DecompressDXT1 | ( | ILimage * | lImage,
|  | ILubyte * | lCompData |
| ) |  |  |

Referenced by Decompress(), and iLoadVtfInternal().

ILboolean DecompressDXT2 | ( | ILimage * | lImage,
|  | ILubyte * | lCompData |
| ) |  |  |

Referenced by Decompress().

ILboolean DecompressDXT3 | ( | ILimage * | lImage,
|  | ILubyte * | lCompData |
| ) |  |  |

Referenced by Decompress(), DecompressDXT2(), and iLoadVtfInternal().

ILboolean DecompressDXT4 | ( | ILimage * | lImage,
|  | ILubyte * | lCompData |
| ) |  |  |

Referenced by Decompress().

ILboolean DecompressDXT5 | ( | ILimage * | lImage,
|  | ILubyte * | lCompData |
| ) |  |  |

Referenced by Decompress(), DecompressDXT4(), and iLoadVtfInternal().

ILboolean DecompressFloat | ( | ILuint | lCompFormat | ) |

Referenced by Decompress().

ILboolean DecompressRXGB | ( |  | ) |

Referenced by Decompress().

void DxtcReadColor | ( | ILushort | Data,
|  | Color8888 * | Out |
| ) |  |  |

Referenced by DecompressDXT1(), and iLoadTplInternal().

void DxtcReadColors | ( | const ILubyte * | Data,
|  | Color8888 * | Out |
| ) |  |  |

Referenced by DecompressDXT3(), and DecompressDXT5().

void GetBitsFromMask | ( | ILuint | Mask,
|  | ILuint * | ShiftLeft,
|  | ILuint * | ShiftRight |
| ) |  |  |

Referenced by DecompressARGB().

unsigned int halfToFloat | ( | unsigned short | y | ) |

Referenced by iConvFloat16ToFloat32().

ILboolean iCheckDds | ( | DDSHEAD * | Head | ) |

Referenced by iIsValidDds(), and iLoadDdsInternal().

ILubyte iCompFormatToBpc | ( | ILenum | Format | ) |

Referenced by iLoadDdsCubemapInternal(), and ReadMipmaps().

ILubyte iCompFormatToBpp | ( | ILenum | Format | ) |

Referenced by AdjustVolumeTexture(), iLoadDdsCubemapInternal(), and ReadMipmaps().

ILubyte iCompFormatToChannelCount | ( | ILenum | Format | ) |

Referenced by AllocImage(), iLoadDdsCubemapInternal(), and ReadMipmaps().

void iComplexAlphaHelper | ( | ILubyte * | Data | ) |

Referenced by iFlipComplexAlphaBlock().

ILboolean iConvFloat16ToFloat32 | ( | ILuint * | dest,
|  | ILushort * | src,
|  | ILuint | size |
| ) |  |  |

Referenced by DecompressFloat(), and iLoadVtfInternal().

void iFlip3dc | ( | ILubyte * | data,
|  | ILuint | count |
| ) |  |  |

Referenced by ilFlipSurfaceDxtcData().

void iFlipColorBlock | ( | ILubyte * | data | ) |

Referenced by iFlipDxt1(), iFlipDxt3(), and iFlipDxt5().

void iFlipComplexAlphaBlock | ( | ILubyte * | Data | ) |

Referenced by iFlip3dc(), and iFlipDxt5().

void iFlipDxt1 | ( | ILubyte * | data,
|  | ILuint | count |
| ) |  |  |

Referenced by ilFlipSurfaceDxtcData().

void iFlipDxt3 | ( | ILubyte * | data,
|  | ILuint | count |
| ) |  |  |

Referenced by ilFlipSurfaceDxtcData().

void iFlipDxt5 | ( | ILubyte * | data,
|  | ILuint | count |
| ) |  |  |

Referenced by ilFlipSurfaceDxtcData().

void iFlipSimpleAlphaBlock | ( | ILushort * | data | ) |

Referenced by iFlipDxt3().

ILboolean iGetDdsHead | ( | DDSHEAD * | Header | ) |

Referenced by iIsValidDds(), and iLoadDdsInternal().

void iInvertDxt3Alpha | ( | ILubyte * | data | ) |

Referenced by ilInvertSurfaceDxtcDataAlpha().

void iInvertDxt5Alpha | ( | ILubyte * | data | ) |

Referenced by ilInvertSurfaceDxtcDataAlpha().

ILboolean iIsValidDds | ( | void |  | ) |

Referenced by ilIsValidDdsF(), and ilIsValidDdsL().

ILAPI ILboolean ILAPIENTRY ilDxtcDataToImage | ( | void |  | ) |

ILAPI ILboolean ILAPIENTRY ilDxtcDataToSurface | ( | void |  | ) |

Referenced by ilDxtcDataToImage().

ILAPI void ILAPIENTRY ilFlipSurfaceDxtcData | ( |  | ) |

void ilFreeImageDxtcData | ( |  | ) |

void ilFreeSurfaceDxtcData | ( |  | ) |

Referenced by ilFreeImageDxtcData(), and ilSurfaceToDxtcData().

ILubyte* ILAPIENTRY ilGetDxtcData | ( |  | ) |

ILAPI ILboolean ILAPIENTRY ilImageToDxtcData | ( | ILenum | Format | ) |

ILAPI ILboolean ILAPIENTRY ilInvertSurfaceDxtcDataAlpha | ( |  | ) |

ILboolean ilIsValidDds | ( | ILconst_string | FileName | ) |

Checks if the file specified in FileName is a valid .dds file.

Referenced by ilIsValid().

ILboolean ilIsValidDdsF | ( | ILHANDLE | File | ) |

Checks if the ILHANDLE contains a valid .dds file at the current position.

Referenced by ilDetermineTypeF(), ilIsValidDds(), and ilIsValidF().

ILboolean ilIsValidDdsL | ( | const void * | Lump,
|  | ILuint | Size |
| ) |  |  |

Checks if Lump is a valid .dds lump.

Referenced by ilDetermineTypeL(), and ilIsValidL().

ILboolean ilLoadDds | ( | ILconst_string | FileName | ) |

Reads a .dds file.

Referenced by ilLoad(), and ilLoadImage().

ILboolean ilLoadDdsF | ( | ILHANDLE | File | ) |

Reads an already-opened .dds file.

Referenced by ilLoadDds(), and ilLoadF().

ILboolean ilLoadDdsL | ( | const void * | Lump,
|  | ILuint | Size |
| ) |  |  |

Reads from a memory "lump" that contains a .dds.

Referenced by ilLoadL().

ILboolean iLoadDdsCubemapInternal | ( |  | ) |

Referenced by iLoadDdsInternal().

ILboolean iLoadDdsInternal | ( | void |  | ) |

Referenced by ilLoadDdsF(), and ilLoadDdsL().

ILAPI ILboolean ILAPIENTRY ilSurfaceToDxtcData | ( | ILenum | Format | ) |

Referenced by ilImageToDxtcData().

ILAPI ILboolean ILAPIENTRY ilTexImageDxtc | ( | ILint | w,
|  | ILint | h,
|  | ILint | d,
|  | ILenum | DxtFormat,
|  | const ILubyte * | data |
| ) |  |  |

ILboolean ReadData | ( |  | ) |

Referenced by iLoadDdsCubemapInternal(), iLoadDdsInternal(), and ReadMipmaps().

ILboolean ReadMipmaps | ( |  | ) |

Referenced by iLoadDdsCubemapInternal(), and iLoadDdsInternal().

## Variable Documentation

ILuint CubemapDirections[CUBEMAP_SIDES]

Initial value:

     {
            DDS_CUBEMAP_POSITIVEX,
            DDS_CUBEMAP_NEGATIVEX,
            DDS_CUBEMAP_POSITIVEY,
            DDS_CUBEMAP_NEGATIVEY,
            DDS_CUBEMAP_POSITIVEZ,
            DDS_CUBEMAP_NEGATIVEZ
    }

Referenced by iLoadDdsCubemapInternal().