diff options
Diffstat (limited to 'src/libjin/Graphics/Bitmap.h')
-rw-r--r-- | src/libjin/Graphics/Bitmap.h | 46 |
1 files changed, 43 insertions, 3 deletions
diff --git a/src/libjin/Graphics/Bitmap.h b/src/libjin/Graphics/Bitmap.h index 9277cc8..c983676 100644 --- a/src/libjin/Graphics/Bitmap.h +++ b/src/libjin/Graphics/Bitmap.h @@ -11,15 +11,55 @@ namespace jin { namespace graphics { - + /// + /// A RGBA32 bitmap. + /// + /// A bitmap keeps pixels and can't render directly onto screen. To render bitmap, + /// a texture is required. A texture is create from specific bitmap. + /// class Bitmap { public: - static Bitmap* createBitmap(const void* pixel, unsigned width, unsigned height); + /// + /// Create bitmap by pixels data. + /// + /// @param pixels Pixels data. + /// @param width Width of bitmap. + /// @param height Height of bitmap. + /// @return Return bitmap pointer if created, otherwise return null. + /// + static Bitmap* createBitmap(const void* pixels, unsigned width, unsigned height); + + /// + /// Create bitmap from compressed image data. + /// + /// @param imgData Compressed image data. + /// @param size Size of image data. + /// @return Return bitmap pointer if created, otherwise return null. + /// static Bitmap* createBitmap(const void* imgData, size_t size); - static Bitmap* createBitmap(int w, int h, Color color = Color::BLACK); + + /// + /// Create bitmap with specific color and size. + /// + /// @param width Width of bitmap. + /// @param height Height of bitmap. + /// @param color Color of bitmap. + /// @return Return bitmap pointer if created, otherwise return null. + /// + static Bitmap* createBitmap(int width, int height, Color color = Color::BLACK); + + /// + /// Create bitmap with another one. + /// + /// @param bitmap Bitmap be cloned. + /// @return Return bitmap pointer if created, otherwise return null. + /// static Bitmap* clone(const Bitmap* bitmap); + /// + /// Destructor of bitmap + /// virtual ~Bitmap(); /* init pixels */ void bind(Color* pixels, int w, int h); |