forked from joelburget/slimlock
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathimage.h
54 lines (42 loc) · 1.29 KB
/
image.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
44
45
46
47
48
49
50
51
52
53
54
/* SLiM - Simple Login Manager
Copyright (C) 2004-06 Simone Rota <[email protected]>
Copyright (C) 2004-06 Johannes Winkelmann <[email protected]>
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
The following code has been adapted and extended from
xplanet 1.0.1, Copyright (C) 2002-04 Hari Nair <[email protected]>
*/
#ifndef _IMAGE_H_
#define _IMAGE_H_
#include <X11/Xlib.h>
#include <X11/Xutil.h>
extern "C" {
#include <Imlib2.h>
}
class Image {
public:
Image();
~Image();
int Width() const {
return(width);
}
int Height() const {
return(height);
}
Imlib_Image GetImage() {
return(image);
}
bool Read(const char *filename);
void Resize(const int w, const int h);
void Merge(Image* background, const int x, const int y);
void Crop(const int x, const int y, const int w, const int h);
void Tile(const int w, const int h);
void Center(const int w, const int h, const char *hex);
Pixmap createPixmap(Display* dpy, int scr, Window win);
private:
int width, height;
Imlib_Image image;
};
#endif