SDL
2.0
|
#include "../SDL_internal.h"
#include "SDL_hints.h"
#include "SDL_video.h"
#include "SDL_assert.h"
#include "SDL_endian.h"
#include "SDL_pixels_c.h"
Go to the source code of this file.
Macros | |
#define | SAVE_32BIT_BMP |
#define | BI_RGB 0 |
#define | BI_RLE8 1 |
#define | BI_RLE4 2 |
#define | BI_BITFIELDS 3 |
#define | LCS_WINDOWS_COLOR_SPACE 0x57696E20 |
Functions | |
static void | CorrectAlphaChannel (SDL_Surface *surface) |
SDL_Surface * | SDL_LoadBMP_RW (SDL_RWops *src, int freesrc) |
int | SDL_SaveBMP_RW (SDL_Surface *saveme, SDL_RWops *dst, int freedst) |
#define BI_BITFIELDS 3 |
Definition at line 48 of file SDL_bmp.c.
Referenced by SDL_LoadBMP_RW(), and SDL_SaveBMP_RW().
#define BI_RGB 0 |
Definition at line 45 of file SDL_bmp.c.
Referenced by SDL_LoadBMP_RW(), and SDL_SaveBMP_RW().
#define LCS_WINDOWS_COLOR_SPACE 0x57696E20 |
Definition at line 54 of file SDL_bmp.c.
Referenced by SDL_SaveBMP_RW().
|
static |
Definition at line 57 of file SDL_bmp.c.
References SDL_Surface::h, SDL_Surface::pitch, SDL_Surface::pixels, SDL_ALPHA_OPAQUE, SDL_FALSE, and SDL_TRUE.
Referenced by SDL_LoadBMP_RW().
SDL_Surface* SDL_LoadBMP_RW | ( | SDL_RWops * | src, |
int | freesrc | ||
) |
Load a surface from a seekable SDL data stream (memory or file).
If freesrc
is non-zero, the stream will be closed after being read.
The new surface should be freed with SDL_FreeSurface().
Definition at line 87 of file SDL_bmp.c.
References SDL_Color::a, SDL_Color::b, BI_BITFIELDS, BI_RGB, colors, SDL_Palette::colors, CorrectAlphaChannel(), done, SDL_Surface::format, SDL_Color::g, SDL_Surface::h, i, SDL_Palette::ncolors, NULL, SDL_Surface::pitch, SDL_Surface::pixels, SDL_Color::r, RW_SEEK_CUR, RW_SEEK_SET, SDL_ALPHA_OPAQUE, SDL_assert, SDL_ClearError, SDL_CreateRGBSurface, SDL_EFREAD, SDL_EFSEEK, SDL_Error, SDL_FALSE, SDL_FreeSurface, SDL_GetError, SDL_OutOfMemory, SDL_ReadLE16, SDL_ReadLE32, SDL_realloc, SDL_RWclose, SDL_RWread, SDL_RWseek, SDL_RWtell, SDL_SetError, SDL_strcmp, SDL_strncmp, SDL_Swap16(), SDL_Swap32(), SDL_TRUE, void, and SDL_Surface::w.
int SDL_SaveBMP_RW | ( | SDL_Surface * | surface, |
SDL_RWops * | dst, | ||
int | freedst | ||
) |
Save a surface to a seekable SDL data stream (memory or file).
Surfaces with a 24-bit, 32-bit and paletted 8-bit format get saved in the BMP directly. Other RGB formats with 8-bit or higher get converted to a 24-bit surface or, if they have an alpha mask or a colorkey, to a 32-bit surface before they are saved. YUV and paletted 1-bit and 4-bit formats are not supported.
If freedst
is non-zero, the stream will be closed after being written.
Definition at line 463 of file SDL_bmp.c.
References SDL_PixelFormat::Amask, BI_BITFIELDS, BI_RGB, SDL_PixelFormat::BitsPerPixel, SDL_PixelFormat::Bmask, SDL_PixelFormat::BytesPerPixel, colors, SDL_Palette::colors, SDL_BlitInfo::flags, SDL_Surface::format, SDL_PixelFormat::Gmask, SDL_Surface::h, i, SDL_BlitMap::info, LCS_WINDOWS_COLOR_SPACE, SDL_Surface::map, SDL_Palette::ncolors, NULL, SDL_PixelFormat::palette, SDL_Surface::pitch, SDL_Surface::pixels, SDL_PixelFormat::Rmask, RW_SEEK_SET, SDL_BYTEORDER, SDL_ClearError, SDL_ConvertSurface, SDL_COPY_COLORKEY, SDL_EFSEEK, SDL_EFWRITE, SDL_Error, SDL_FALSE, SDL_FreeSurface, SDL_GetError, SDL_GetHintBoolean, SDL_HINT_BMP_SAVE_LEGACY_FORMAT, SDL_InitFormat(), SDL_LIL_ENDIAN, SDL_LockSurface, SDL_PIXELFORMAT_BGR24, SDL_PIXELFORMAT_BGRA32, SDL_RWclose, SDL_RWseek, SDL_RWtell, SDL_RWwrite, SDL_SetError, SDL_strcmp, SDL_TRUE, SDL_UnlockSurface, SDL_WriteLE16, SDL_WriteLE32, and SDL_Surface::w.