aboutsummaryrefslogtreecommitdiff
path: root/src/libjin/Graphics/Bitmap.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/libjin/Graphics/Bitmap.h')
-rw-r--r--src/libjin/Graphics/Bitmap.h74
1 files changed, 37 insertions, 37 deletions
diff --git a/src/libjin/Graphics/Bitmap.h b/src/libjin/Graphics/Bitmap.h
index 6264c37..5599521 100644
--- a/src/libjin/Graphics/Bitmap.h
+++ b/src/libjin/Graphics/Bitmap.h
@@ -9,43 +9,43 @@
namespace jin
{
-namespace graphics
-{
-
- class Bitmap
- {
- public:
- static Bitmap* createBitmap(const void* pixel, unsigned width, unsigned height);
- static Bitmap* createBitmap(const void* imgData, size_t size);
- static Bitmap* createBitmap(int w, int h, Color color = Color::BLACK);
- static Bitmap* clone(const Bitmap* bitmap);
-
- virtual ~Bitmap();
- /* init pixels */
- void bind(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() const;
- /* get width and height */
- inline int getWidth() const { return width; }
- inline int getHeight() const { return height; }
- inline math::Vector2<int> getSize() const { return math::Vector2<int>(width, height); }
-
- protected:
- Bitmap();
- Bitmap(unsigned w, unsigned h);
-
- Color * pixels;
- unsigned width, height;
-
- };
-
-} // graphics
+ namespace graphics
+ {
+
+ class Bitmap
+ {
+ public:
+ static Bitmap* createBitmap(const void* pixel, unsigned width, unsigned height);
+ static Bitmap* createBitmap(const void* imgData, size_t size);
+ static Bitmap* createBitmap(int w, int h, Color color = Color::BLACK);
+ static Bitmap* clone(const Bitmap* bitmap);
+
+ virtual ~Bitmap();
+ /* init pixels */
+ void bind(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() const;
+ /* get width and height */
+ inline int getWidth() const { return width; }
+ inline int getHeight() const { return height; }
+ inline math::Vector2<int> getSize() const { return math::Vector2<int>(width, height); }
+
+ protected:
+ Bitmap();
+ Bitmap(unsigned w, unsigned h);
+
+ Color * pixels;
+ unsigned width, height;
+
+ };
+
+ } // graphics
} // jin
#endif