blob: 464ca7fce8b97acae8e3fa14cabb7c793cf9b5b6 (
plain)
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
|
#ifndef __JIN_BITMAP_H
#define __JIN_BITMAP_H
#include "../modules.h"
#if JIN_MODULES_RENDER
#include "../Math/Vector2.h"
#include "../3rdparty/GLee/GLee.h"
#include "Color.h"
namespace jin
{
namespace graphics
{
class Bitmap
{
public:
static Bitmap* createBitmap(const void* imgData, size_t size);
static Bitmap* createBitmap(int w, int h);
~Bitmap();
void bindPixels(Color* pixels, int w, int h);
void setPixels(Color* pixels, int w, int h);
void setPixel(const Color& pixel, int x, int y);
Color getPixel(int x, int y);
const Color* getPixels();
inline int getWidth() { return width; }
inline int getHeight() { return height; }
private:
Bitmap();
Bitmap(int w, int h);
Color * pixels;
int width, height;
};
}
}
#endif
#endif
|