The Battle for Wesnoth  1.13.4+dev
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
Macros | Functions
savepng.cpp File Reference
#include <SDL.h>
#include <png.h>
#include "savepng.h"
#include <cstdlib>
Include dependency graph for savepng.cpp:

Go to the source code of this file.

Macros

#define SAVEPNG_SUCCESS   0
 
#define SAVEPNG_ERROR   -1
 
#define USE_ROW_POINTERS
 
#define rmask   0xFF000000
 
#define gmask   0x00FF0000
 
#define bmask   0x0000FF00
 
#define amask   0x000000FF
 

Functions

static void png_error_SDL (png_structp, png_const_charp str)
 
static void png_write_SDL (png_structp png_ptr, png_bytep data, png_size_t length)
 
SDL_Surface * SDL_PNGFormatAlpha (SDL_Surface *src)
 
int SDL_SavePNG_RW (SDL_Surface *surface, SDL_RWops *dst, int freedst)
 

Macro Definition Documentation

#define amask   0x000000FF

Definition at line 23 of file savepng.cpp.

#define bmask   0x0000FF00

Definition at line 22 of file savepng.cpp.

Referenced by SDL_SavePNG_RW().

#define gmask   0x00FF0000

Definition at line 21 of file savepng.cpp.

Referenced by SDL_SavePNG_RW().

#define rmask   0xFF000000

Definition at line 20 of file savepng.cpp.

Referenced by SDL_SavePNG_RW().

#define SAVEPNG_ERROR   -1

Definition at line 15 of file savepng.cpp.

Referenced by SDL_SavePNG_RW().

#define SAVEPNG_SUCCESS   0

Definition at line 14 of file savepng.cpp.

Referenced by SDL_SavePNG_RW().

#define USE_ROW_POINTERS

Definition at line 17 of file savepng.cpp.

Function Documentation

static void png_error_SDL ( png_structp  ,
png_const_charp  str 
)
static

Definition at line 34 of file savepng.cpp.

Referenced by SDL_SavePNG_RW().

static void png_write_SDL ( png_structp  png_ptr,
png_bytep  data,
png_size_t  length 
)
static

Definition at line 38 of file savepng.cpp.

Referenced by SDL_SavePNG_RW().

SDL_Surface* SDL_PNGFormatAlpha ( SDL_Surface *  src)

Definition at line 44 of file savepng.cpp.

References surf.

Referenced by image::save_image().

int SDL_SavePNG_RW ( SDL_Surface *  surface,
SDL_RWops *  dst,
int  freedst 
)

Definition at line 65 of file savepng.cpp.

References bmask, gmask, i, png_error_SDL(), png_write_SDL(), rmask, SAVEPNG_ERROR, and SAVEPNG_SUCCESS.