added BlendBitmap<>

This commit is contained in:
HuYingzhuo(hugo/hyzboy) 2023-07-11 20:19:51 +08:00
parent d7f93c7526
commit c19d0fffe7
2 changed files with 19 additions and 2 deletions

View File

@ -48,6 +48,12 @@ namespace hgl
return (x<0||x>=width||y<0||y>=height)?nullptr:data+(y*width+x);
}
const T *GetData()const{return data;}
const T *GetData(int x,int y)const
{
return (x<0||x>=width||y<0||y>=height)?nullptr:data+(y*width+x);
}
bool Create(uint w,uint h)
{
if(!w||!h)return(false);

View File

@ -1,6 +1,7 @@
#pragma once
#pragma once
#include<hgl/type/DataType.h>
#include<hgl/2d/Bitmap.h>
namespace hgl
{
@ -18,5 +19,15 @@ namespace hgl
return src;
}
};//template<typename T> struct BlendColor
/**
*
*/
template<typename ST,typename DT> class BlendBitmap
{
public:
void operator ()(const Bitmap<ST> *src,Bitmap<DT> *dst,const float alpha)const;
};//template<typename ST,typename DT> class BlendBitmap
}//namespace bitmap
}//namespace hgl