X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/fda7962d029672a5f4c718a3c6b2559856f4cd95..0a7b481fee70afb6736a9a19edcadbc679bdfb2f:/include/wx/image.h diff --git a/include/wx/image.h b/include/wx/image.h index 0d8f947e3c..153065c764 100644 --- a/include/wx/image.h +++ b/include/wx/image.h @@ -10,7 +10,7 @@ #ifndef _WX_IMAGE_H_ #define _WX_IMAGE_H_ -#if defined(__GNUG__) && !defined(__APPLE__) +#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA) #pragma interface "image.h" #endif @@ -18,9 +18,6 @@ #include "wx/object.h" #include "wx/string.h" #include "wx/gdicmn.h" -#if WXWIN_COMPATIBILITY_2_2 -# include "wx/bitmap.h" -#endif #include "wx/hashmap.h" #if wxUSE_STREAMS @@ -188,7 +185,8 @@ public: void Replace( unsigned char r1, unsigned char g1, unsigned char b1, unsigned char r2, unsigned char g2, unsigned char b2 ); - // convert to monochrome image ( will be replaced by white, everything else by black) + // convert to monochrome image ( will be replaced by white, + // everything else by black) wxImage ConvertToMono( unsigned char r, unsigned char g, unsigned char b ) const; // these routines are slow but safe @@ -198,7 +196,7 @@ public: unsigned char GetBlue( int x, int y ) const; void SetAlpha(int x, int y, unsigned char alpha); - unsigned char GetAlpha(int x, int y); + unsigned char GetAlpha(int x, int y) const; // find first colour that is not used in the image and has higher // RGB values than @@ -209,6 +207,10 @@ public: bool SetMaskFromImage(const wxImage & mask, unsigned char mr, unsigned char mg, unsigned char mb); + // converts image's alpha channel to mask, if it has any, does nothing + // otherwise: + bool ConvertAlphaToMask(unsigned char threshold = 128); + static bool CanRead( const wxString& name ); static int GetImageCount( const wxString& name, long type = wxBITMAP_TYPE_ANY ); virtual bool LoadFile( const wxString& name, long type = wxBITMAP_TYPE_ANY, int index = -1 );