|
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) |
| Loads a PNG image into an SDL_Surface. | |
| 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) |
| Loads a Jpeg image into an SDL_Surface. | |
| SDL_Surface * | Img_LoadImage (char const *name) |
| Loads the specified image from the game filesystem into an SDL_Surface. | |
Variables | |
| static char const *const | IMAGE_TYPES [] |
Image loading and saving functions.
Definition in file images.cpp.
| #define TGA_CHANNELS 3 |
Definition at line 105 of file images.cpp.
Referenced by R_WriteCompressedTGA().
| #define TGA_UNMAP_COMP 10 |
Definition at line 54 of file images.cpp.
Referenced by R_WriteCompressedTGA().
Definition at line 280 of file images.cpp.
Referenced by Img_LoadJPG(), and Img_LoadPNG().
|
static |
Definition at line 365 of file images.cpp.
Referenced by Img_LoadJPG().
|
static |
Definition at line 363 of file images.cpp.
Referenced by Img_LoadJPG().
Definition at line 371 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 into an SDL_Surface.
Image formats are tried in the order they appear in TYPES.
SDL_Surface after you are done with it. Definition at line 488 of file images.cpp.
References Img_LoadJPG(), Img_LoadPNG(), and name.
Referenced by CalcTextureReflectivity(), R_FindImage(), R_LoadImage(), R_ReloadImageData(), and TEST_F().
|
static |
Loads a Jpeg image into an SDL_Surface.
| [in] | name | Path to the imagefile, relative from gameDir and without extension |
nullptr on failure Definition at line 390 of file images.cpp.
References createSurface(), djpeg_fill_input_buffer(), djpeg_nop(), djpeg_skip_input_data(), FS_FreeFile(), len, name, and readFile().
Referenced by Img_LoadImage().
|
static |
Loads a PNG image into an SDL_Surface.
| [in] | name | Path to the imagefile, relative from gameDir and without extension |
nullptr on failure Definition at line 313 of file images.cpp.
References createSurface(), FS_FreeFile(), len, name, readFile(), and readMem().
Referenced by Img_LoadImage().
Definition at line 111 of file images.cpp.
References f, FS_Write(), index, OBJZERO, TGA_CHANNELS, and TGA_UNMAP_COMP.
Referenced by R_ScreenShot().
Definition at line 234 of file images.cpp.
References f.
Referenced by R_ScreenShot().
Definition at line 66 of file images.cpp.
Referenced by R_ScreenShot().
|
static |
Definition at line 271 of file images.cpp.
References FS_LoadFile(), len, MAX_QPATH, and name.
Referenced by Img_LoadJPG(), and Img_LoadPNG().
|
static |
Definition at line 297 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 45 of file images.cpp.
Referenced by Img_GetImageTypes().