image.cpp File Reference

Routines for images: load, scale, re-color, etc. More...

#include "global.hpp"
#include "color_range.hpp"
#include "config.hpp"
#include "filesystem.hpp"
#include "game_config.hpp"
#include "image.hpp"
#include "log.hpp"
#include "sdl_utils.hpp"
#include "util.hpp"
#include "serialization/string_utils.hpp"
#include "SDL_image.h"
#include <cassert>
#include <iostream>
#include <map>
#include <string>

Include dependency graph for image.cpp:

Go to the source code of this file.

Namespaces

namespace  image

Defines

#define ERR_DP   LOG_STREAM(err, display)

Typedefs

typedef std::map
< image::locator::value, int > 
locator_finder_t
typedef std::pair
< image::locator::value, int > 
locator_finder_pair

Functions

template<typename T>
void reset_cache (std::vector< image::cache_item< T > > &cache)
void image::flush_cache ()
void image::set_wm_icon ()
 function to set the program's icon to the window manager.
void image::set_pixel_format (SDL_PixelFormat *format)
 sets the pixel format used by the images.
void image::set_colour_adjustment (int r, int g, int b)
 will make all scaled images have these rgb values added to all their pixels.
void image::set_team_colors (const std::vector< std::string > *colors=NULL)
 set the team colors used by the TC image modification use a vector with one string for each team using NULL will reset to default TC
void image::set_image_mask (const std::string &image_name)
 function which sets a certain image as a 'mask' for all scaled images.
void image::set_zoom (int zoom)
 sets the amount scaled images should be scaled.
static surface image::get_hexed (const locator i_locator)
static surface image::get_unmasked (const locator i_locator)
static surface image::get_scaled_to_hex (const locator i_locator)
static surface image::get_scaled_to_zoom (const locator i_locator)
static surface image::get_brightened (const locator i_locator)
static surface image::get_semi_brightened (const locator i_locator)
surface image::get_image (const locator &i_locator, TYPE type=UNSCALED, bool add_to_cache=true)
 function to get the surface corresponding to an image.
surface image::reverse_image (const surface &surf)
 function to reverse an image.
bool image::exists (const image::locator &i_locator)

Variables

locator_finder_t locator_finder
image::image_cache images_
 Definition of all image maps.
image::image_cache hexed_images_
image::image_cache scaled_to_hex_images_
image::image_cache scaled_to_zoom_
image::image_cache unmasked_images_
image::image_cache brightened_images_
image::image_cache semi_brightened_images_
std::map< image::locator, bool > image_existance_map
std::map< surface, surfacereversed_images_
int red_adjust = 0
int green_adjust = 0
int blue_adjust = 0
std::vector< std::string > team_colors
 List of colors used by the TC image modification.
std::string image_mask
int zoom = image::tile_size
int cached_zoom = 0
mini_terrain_cache_map image::mini_terrain_cache
mini_terrain_cache_map image::mini_fogged_terrain_cache
SDL_PixelFormat * image::pixel_format = NULL


Detailed Description

Routines for images: load, scale, re-color, etc.

Definition in file image.cpp.


Define Documentation

#define ERR_DP   LOG_STREAM(err, display)

Definition at line 37 of file image.cpp.


Typedef Documentation

typedef std::pair<image::locator::value, int> locator_finder_pair [static]

Definition at line 42 of file image.cpp.

Definition at line 41 of file image.cpp.


Function Documentation

template<typename T>
void @96::reset_cache ( std::vector< image::cache_item< T > > &  cache  )  [inline, static]


Variable Documentation

int blue_adjust = 0 [static]

Definition at line 55 of file image.cpp.

Referenced by image::get_scaled_to_hex(), and image::set_colour_adjustment().

int cached_zoom = 0 [static]

Definition at line 63 of file image.cpp.

Referenced by image::set_zoom().

int green_adjust = 0 [static]

Definition at line 55 of file image.cpp.

Referenced by image::get_scaled_to_hex(), and image::set_colour_adjustment().

Definition at line 46 of file image.cpp.

Referenced by image::flush_cache(), image::get_image(), and image::locator::init_index().

Definition at line 51 of file image.cpp.

Referenced by image::exists(), and image::flush_cache().

std::string image_mask [static]

Definition at line 60 of file image.cpp.

Definition of all image maps.

Definition at line 46 of file image.cpp.

Definition at line 43 of file image.cpp.

Referenced by image::locator::init_index().

int red_adjust = 0 [static]

Definition at line 55 of file image.cpp.

Referenced by image::get_scaled_to_hex(), and image::set_colour_adjustment().

std::vector<std::string> team_colors [static]

List of colors used by the TC image modification.

Definition at line 58 of file image.cpp.

Referenced by game_config::add_color_info(), image::locator::load_image_sub_file(), and image::set_team_colors().

int zoom = image::tile_size [static]


Generated by doxygen 1.5.5 on 23 May 2008 for The Battle for Wesnoth
Gna! | Forum | Wiki | CIA | devdocs