#include "SDL/SDL.h"
#include "SDL/SDL_image.h"

#include <string>
#include <math.h>


#ifndef SURFACES_HPP_
#define SURFACES_HPP_

const int FLIP_HORIZONTAL = 1;
const int FLIP_VERTICAL = 2;

const int ROTATE_RIGHT = 1;
const int ROTATE_LEFT = 2;

struct pix32
{
	unsigned char r, g, b, a;
};

//##############################################################

SDL_Surface* load_image( std::string filename );

void apply_surface( int x, int y, SDL_Surface* src, SDL_Surface* dest, SDL_Rect* clip = NULL );

Uint32 get_pixel32( SDL_Surface* surface, int x, int y );

void put_pixel32( SDL_Surface* surface, int x, int y, Uint32 pixel );

SDL_Surface* flip_surface( SDL_Surface* surface, int flags );

SDL_Surface* rotate_surface90( SDL_Surface* surface, int flags );

SDL_Surface* rotate_surface180( SDL_Surface* surface );

SDL_Surface* resize_surface( SDL_Surface* surface, int xp, int yp );

SDL_Surface* resize_surface( SDL_Surface* surface, int degree );

SDL_Surface* smooth_surface( SDL_Surface* surface, int level );

void flip_surface_self( SDL_Surface* &surface, int flags );

void rotate_surface90_self( SDL_Surface* &surface, int flags );

void rotate_surface180_self( SDL_Surface* &surface );

void resize_surface_self( SDL_Surface* &surface, int xp, int yp );

void resize_surface_self( SDL_Surface* &surface, int degree );

void smooth_surface_self( SDL_Surface* &surface, int level );


#endif /* SURFACES_HPP_ */
