forked from szymor/pv2x
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathscaledimage.h
43 lines (34 loc) · 885 Bytes
/
scaledimage.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
#ifndef SCALEDIMAGE_H
#define SCALEDIMAGE_H
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#include <SDL.h>
#include <SDL_image.h>
#include <string>
#include <iostream>
#include <math.h>
#include "sdltools.h"
#define ROTATEMODE_NONE 0
#define ROTATEMODE_ROTATE 1
#define ROTATEMODE_BEST 2
#define ROTATEMODE_FLIPH 3
#define ROTATEMODE_FLIPV 4
class ScaledImage {
private:
void init();
public:
SDL_Surface *image;
SDL_Surface *scaledImage;
int isScaled;
int loadError;
ScaledImage(std::string filename, int rotateMode=0);
~ScaledImage();
void blit(SDL_Surface *target);
void blit(SDL_Surface *target, int x, int y);
void blit(SDL_Surface *target, SDL_Rect *rect);
void blit(SDL_Surface *target, SDL_Rect *rect, SDL_Rect *destrect);
void scale(double factor, double angle=0.0);
};
#endif