UFO: Alien Invasion
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
images.h File Reference

Image loading and saving functions. More...

#include "ufotypes.h"
#include "../common/filesys.h"
#include <SDL_video.h>

Go to the source code of this file.

Functions

char const *const * Img_GetImageTypes (void)
 
SDL_Surface * Img_LoadImage (char const *name)
 Loads the specified image from the game filesystem and populates the provided SDL_Surface. More...
 
void R_WriteCompressedTGA (qFILE *f, const byte *buffer, int width, int height)
 
void R_WritePNG (qFILE *f, byte *buffer, int width, int height)
 
void R_WriteJPG (qFILE *f, byte *buffer, int width, int height, int quality)
 

Detailed Description

Image loading and saving functions.

Definition in file images.h.

Function Documentation

char const* const* Img_GetImageTypes ( void  )

Definition at line 46 of file images.cpp.

References IMAGE_TYPES.

Referenced by R_ImageExists().

SDL_Surface* Img_LoadImage ( char const *  name)

Loads the specified image from the game filesystem and populates the provided SDL_Surface.

Image formats are tried in the order they appear in TYPES.

Note
Make sure to free the given SDL_Surface after you are done with it.

Definition at line 435 of file images.cpp.

References Img_LoadJPG(), and Img_LoadPNG().

Referenced by CalcTextureReflectivity(), R_FindImage(), R_LoadImage(), R_ReloadImageData(), and TEST_F().

void R_WriteCompressedTGA ( qFILE f,
const byte buffer,
int  width,
int  height 
)
See also
R_LoadTGA
R_WriteTGA

Definition at line 101 of file images.cpp.

References FS_Write(), index, OBJZERO, TGA_CHANNELS, and TGA_UNMAP_COMP.

Referenced by R_ScreenShot().

void R_WriteJPG ( qFILE f,
byte buffer,
int  width,
int  height,
int  quality 
)
See also
R_ScreenShot_f
R_LoadJPG

Definition at line 224 of file images.cpp.

References qFILE_s::f.

Referenced by R_ScreenShot().

void R_WritePNG ( qFILE f,
byte buffer,
int  width,
int  height 
)
See also
R_LoadTGA
R_LoadJPG
R_FindImage

Definition at line 56 of file images.cpp.

References qFILE_s::f, and i.

Referenced by R_ScreenShot(), and SL_CreatePNGFile().