The Lesser wxMask Refactoring: merged wxMGL and wxDFB version, added wxMaskBase which could/should be used by other ports later

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@41495 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin
2006-09-28 23:02:39 +00:00
parent 4353a8df6e
commit 87f83ac867
12 changed files with 338 additions and 332 deletions

View File

@@ -125,3 +125,38 @@ IMPLEMENT_DYNAMIC_CLASS(wxBitmapBaseModule, wxModule)
#endif // wxUSE_BITMAP_BASE
// ----------------------------------------------------------------------------
// wxMaskBase
// ----------------------------------------------------------------------------
bool wxMaskBase::Create(const wxBitmap& bitmap, const wxColour& colour)
{
FreeData();
return InitFromColour(bitmap, colour);
}
#if wxUSE_PALETTE
bool wxMaskBase::Create(const wxBitmap& bitmap, int paletteIndex)
{
wxPalette *pal = bitmap.GetPalette();
wxCHECK_MSG( pal, false,
wxT("Cannot create mask from palette index of a bitmap without palette") );
unsigned char r,g,b;
pal->GetRGB(paletteIndex, &r, &g, &b);
return Create(bitmap, wxColour(r, g, b));
}
#endif // wxUSE_PALETTE
bool wxMaskBase::Create(const wxBitmap& bitmap)
{
FreeData();
return InitFromMonoBitmap(bitmap);
}