Image loading and saving functions. More...
#include "images.h"
#include <jpeglib.h>
#include <png.h>
Go to the source code of this file.
Defines | |
#define | TGA_UNMAP_UNCOMP 2 |
#define | TGA_UNMAP_COMP 10 |
#define | TGA_CHANNELS 3 |
Functions | |
const char ** | Img_GetImageTypes (void) |
void | R_WritePNG (qFILE *f, byte *buffer, int width, int height) |
void | R_WriteCompressedTGA (qFILE *f, const byte *buffer, int width, int height) |
void | R_WriteJPG (qFILE *f, byte *buffer, int width, int height, int quality) |
static qboolean | Img_LoadTypedImage (const char *name, char *type, SDL_Surface **surf) |
Loads the specified image from the game filesystem and populates the provided SDL_Surface. | |
qboolean | Img_LoadImage (const char *name, SDL_Surface **surf) |
Loads the specified image from the game filesystem and populates the provided SDL_Surface. | |
Variables | |
static char * | IMAGE_TYPES [] = { "tga", "png", "jpg", NULL } |
static SDL_PixelFormat | format |
Image loading and saving functions.
Definition in file images.c.
#define TGA_CHANNELS 3 |
Definition at line 120 of file images.c.
Referenced by R_WriteCompressedTGA().
#define TGA_UNMAP_COMP 10 |
Definition at line 68 of file images.c.
Referenced by R_WriteCompressedTGA().
const char** Img_GetImageTypes | ( | void | ) |
qboolean Img_LoadImage | ( | const char * | name, | |
SDL_Surface ** | surf | |||
) |
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.
SDL_Surface
after you are done with it. Definition at line 338 of file images.c.
References i, IMAGE_TYPES, Img_LoadTypedImage(), qfalse, and qtrue.
Referenced by CalcTextureReflectivity(), R_FindImage(), and R_LoadImage().
static qboolean Img_LoadTypedImage | ( | const char * | name, | |
char * | type, | |||
SDL_Surface ** | surf | |||
) | [static] |
Loads the specified image from the game filesystem and populates the provided SDL_Surface.
Definition at line 293 of file images.c.
References byte, format, FS_FreeFile(), FS_LoadFile(), len, MAX_QPATH, qfalse, and qtrue.
Referenced by Img_LoadImage().
Definition at line 126 of file images.c.
References byte, FS_Write(), header, TGA_CHANNELS, and TGA_UNMAP_COMP.
Referenced by R_ScreenShot().
Definition at line 252 of file images.c.
References byte, qFILE_s::f, and qtrue.
Referenced by R_ScreenShot().
Definition at line 80 of file images.c.
References qFILE_s::f, and i.
Referenced by R_ScreenShot().
SDL_PixelFormat format [static] |
{ NULL, 32, 4, 0, 0, 0, 0, 24, 16, 8, 0, 0xff000000, 0x00ff0000, 0x0000ff00, 0x000000ff, 0, 1 }
default pixel format to which all images are converted
Definition at line 40 of file images.c.
Referenced by G_ClientAction(), Img_LoadTypedImage(), and sound::WavFileLoader::LoadFromStream().
char* IMAGE_TYPES[] = { "tga", "png", "jpg", NULL } [static] |
image formats, tried in this order
Definition at line 37 of file images.c.
Referenced by Img_GetImageTypes(), and Img_LoadImage().