aboutsummaryrefslogtreecommitdiff
path: root/src/libjin/Graphics/Bitmap.h
diff options
context:
space:
mode:
authorchai <chaifix@163.com>2018-10-18 07:58:07 +0800
committerchai <chaifix@163.com>2018-10-18 07:58:07 +0800
commitb27581c3d9657a4a05191e47eed78d00ec0a46cd (patch)
tree1d461a5642645f98fe37517884d02c6c53434cd5 /src/libjin/Graphics/Bitmap.h
parentdce7b78db8a7071217b1439c4b7f6a341ce37cf1 (diff)
*注释
Diffstat (limited to 'src/libjin/Graphics/Bitmap.h')
-rw-r--r--src/libjin/Graphics/Bitmap.h46
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);