aboutsummaryrefslogtreecommitdiff
path: root/src/libjin/Graphics/Bitmap.h
diff options
context:
space:
mode:
authorchai <chaifix@163.com>2018-09-07 13:30:44 +0800
committerchai <chaifix@163.com>2018-09-07 13:30:44 +0800
commite72188433348c270a54879da9f086f1b527b580f (patch)
treeb2cb92b37579c6f9cff77f52fc591426eb2d8286 /src/libjin/Graphics/Bitmap.h
parent28ca1f570d417671904a25c2a9c589fdb1eb7a03 (diff)
*update
Diffstat (limited to 'src/libjin/Graphics/Bitmap.h')
-rw-r--r--src/libjin/Graphics/Bitmap.h19
1 files changed, 13 insertions, 6 deletions
diff --git a/src/libjin/Graphics/Bitmap.h b/src/libjin/Graphics/Bitmap.h
index 464ca7f..6333215 100644
--- a/src/libjin/Graphics/Bitmap.h
+++ b/src/libjin/Graphics/Bitmap.h
@@ -3,7 +3,7 @@
#include "../modules.h"
#if JIN_MODULES_RENDER
-#include "../Math/Vector2.h"
+#include "../Math/Vector2.hpp"
#include "../3rdparty/GLee/GLee.h"
#include "Color.h"
namespace jin
@@ -15,16 +15,23 @@ namespace graphics
{
public:
static Bitmap* createBitmap(const void* imgData, size_t size);
- static Bitmap* createBitmap(int w, int h);
+ static Bitmap* createBitmap(int w, int h, Color color = Color::BLACK);
+ static Bitmap* clone(const Bitmap* bitmap);
~Bitmap();
+ /* init pixels */
void bindPixels(Color* pixels, int w, int h);
- void setPixels(Color* pixels, int w, int h);
+ void resetPixels(const Color* pixels, int w, int h);
+ void resetPixels(const Color& pixels, int w, int h);
+ /* modify pixels */
void setPixel(const Color& pixel, int x, int y);
+ void setPixels(Color pixels);
+ void setPixels(Color* pixels);
Color getPixel(int x, int y);
- const Color* getPixels();
- inline int getWidth() { return width; }
- inline int getHeight() { return height; }
+ const Color* getPixels() const;
+ /* get width and height */
+ inline int getWidth() const { return width; }
+ inline int getHeight() const { return height; }
private:
Bitmap();