UFO: Alien Invasion
|
Image loading and saving functions. More...
#include "images.h"
#include "shared.h"
#include <jpeglib.h>
#include <png.h>
#include <zlib.h>
#include <jerror.h>
Go to the source code of this file.
Data Structures | |
struct | bufState_t |
Macros | |
#define | TGA_UNMAP_COMP 10 |
#define | TGA_CHANNELS 3 |
Functions | |
char const *const * | 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 byte * | readFile (char const *const name, char const *const suffix, size_t &len) |
static SDL_Surface * | createSurface (int const height, int const width) |
static void | readMem (png_struct *const png, png_byte *const dst, png_size_t const size) |
static SDL_Surface * | Img_LoadPNG (char const *const name) |
static void | djpeg_nop (jpeg_decompress_struct *) |
static boolean | djpeg_fill_input_buffer (jpeg_decompress_struct *const cinfo) |
static void | djpeg_skip_input_data (jpeg_decompress_struct *const cinfo, long const num_bytes) |
static SDL_Surface * | Img_LoadJPG (char const *const name) |
SDL_Surface * | Img_LoadImage (char const *name) |
Loads the specified image from the game filesystem and populates the provided SDL_Surface. More... | |
Variables | |
static char const *const | IMAGE_TYPES [] = { "png", "jpg", nullptr } |
Image loading and saving functions.
Definition in file images.cpp.
#define TGA_CHANNELS 3 |
Definition at line 95 of file images.cpp.
Referenced by R_WriteCompressedTGA().
#define TGA_UNMAP_COMP 10 |
Definition at line 44 of file images.cpp.
Referenced by R_WriteCompressedTGA().
Definition at line 270 of file images.cpp.
Referenced by Img_LoadJPG(), and Img_LoadPNG().
|
static |
Definition at line 350 of file images.cpp.
Referenced by Img_LoadJPG().
|
static |
Definition at line 348 of file images.cpp.
Referenced by Img_LoadJPG().
|
static |
Definition at line 356 of file images.cpp.
Referenced by Img_LoadJPG().
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.
Image formats are tried in the order they appear in TYPES.
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().
|
static |
Definition at line 370 of file images.cpp.
References createSurface(), djpeg_fill_input_buffer(), djpeg_nop(), djpeg_skip_input_data(), FS_FreeFile(), len, and readFile().
Referenced by Img_LoadImage().
|
static |
Definition at line 298 of file images.cpp.
References createSurface(), FS_FreeFile(), len, readFile(), and readMem().
Referenced by Img_LoadImage().
Definition at line 101 of file images.cpp.
References FS_Write(), index, OBJZERO, TGA_CHANNELS, and TGA_UNMAP_COMP.
Referenced by R_ScreenShot().
Definition at line 224 of file images.cpp.
References qFILE_s::f.
Referenced by R_ScreenShot().
Definition at line 56 of file images.cpp.
References qFILE_s::f, and i.
Referenced by R_ScreenShot(), and SL_CreatePNGFile().
|
static |
Definition at line 261 of file images.cpp.
References FS_LoadFile(), and MAX_QPATH.
Referenced by Img_LoadJPG(), and Img_LoadPNG().
|
static |
Definition at line 287 of file images.cpp.
References bufState_t::end, and bufState_t::ptr.
Referenced by Img_LoadPNG().
|
static |
image formats, tried in this order
Definition at line 42 of file images.cpp.
Referenced by Img_GetImageTypes().