From 82cdaa44c96120a53a838cf63ceb1b93bb8bf641 Mon Sep 17 00:00:00 2001 From: "HuYingzhuo(hugo/hyzboy)" Date: Tue, 11 Jul 2023 16:04:44 +0800 Subject: [PATCH] added GetWidth/GetHeight .... functions at Bitmap<> --- inc/hgl/2d/Bitmap.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/inc/hgl/2d/Bitmap.h b/inc/hgl/2d/Bitmap.h index 0dae33b..39a6989 100644 --- a/inc/hgl/2d/Bitmap.h +++ b/inc/hgl/2d/Bitmap.h @@ -27,6 +27,14 @@ namespace hgl delete[] data; } + const uint GetWidth()const{return width;} + const uint GetHeight()const{return height;} + const uint GetTotalPixels()const{return width*height;} + const uint GetLineBytea()const{return width*CHANNELS*sizeof(T);} + const uint GetTotalBytes()const{return width*height*CHANNELS*sizeof(T);} + + T *GetData(){return data;} + bool Create(uint w,uint h) { if(!w||!h)return(false);