added BlendBitmap<>
This commit is contained in:
parent
d7f93c7526
commit
c19d0fffe7
@ -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);
|
||||
|
@ -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
|
Loading…
x
Reference in New Issue
Block a user