X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/01111366c9b4ea40eee7f4b13ddfe6f6b9f886db..d524867f4cd44178f8e6d22f37ade851918de628:/include/wx/image.h diff --git a/include/wx/image.h b/include/wx/image.h index dd8a5e9754..fe15103b2a 100644 --- a/include/wx/image.h +++ b/include/wx/image.h @@ -28,6 +28,8 @@ class WXDLLEXPORT wxPNGHandler; class WXDLLEXPORT wxBMPHandler; class WXDLLEXPORT wxImage; +class WXDLLEXPORT wxBitmap; + //----------------------------------------------------------------------------- // wxImageHandler //----------------------------------------------------------------------------- @@ -66,15 +68,15 @@ class WXDLLEXPORT wxPNGHandler: public wxImageHandler public: - inline wxPNGHandler() - { - m_name = "PNG file"; - m_extension = "png"; - m_type = wxBITMAP_TYPE_PNG; - }; + inline wxPNGHandler() + { + m_name = "PNG file"; + m_extension = "png"; + m_type = wxBITMAP_TYPE_PNG; + }; - virtual bool LoadFile( wxImage *image, const wxString& name ); - virtual bool SaveFile( wxImage *image, const wxString& name ); + virtual bool LoadFile( wxImage *image, const wxString& name ); + virtual bool SaveFile( wxImage *image, const wxString& name ); }; //----------------------------------------------------------------------------- @@ -87,15 +89,16 @@ class WXDLLEXPORT wxBMPHandler: public wxImageHandler public: - inline wxBMPHandler() - { - m_name = "BMP file"; - m_extension = "bmp"; - m_type = wxBITMAP_TYPE_BMP; - }; + inline wxBMPHandler() + { + m_name = "BMP file"; + m_extension = "bmp"; + m_type = wxBITMAP_TYPE_BMP; + }; - virtual bool LoadFile( wxImage *image, const wxString& name ); + virtual bool LoadFile( wxImage *image, const wxString& name ); }; + //----------------------------------------------------------------------------- // wxImage //----------------------------------------------------------------------------- @@ -114,10 +117,22 @@ public: wxImage( const wxImage& image ); wxImage( const wxImage* image ); + + // these functions get implemented in /src/(platform)/bitmap.cpp + wxImage( const wxBitmap &bitmap ); + wxBitmap ConvertToBitmap() const; void Create( int width, int height ); void Destroy(); + wxImage Scale( int width, int height ); + + // these routines are slow but safe + void SetRGB( int x, int y, unsigned char r, unsigned char g, unsigned char b ); + unsigned char GetRed( int x, int y ); + unsigned char GetGreen( int x, int y ); + unsigned char GetBlue( int x, int y ); + virtual bool LoadFile( const wxString& name, long type = wxBITMAP_TYPE_PNG ); virtual bool SaveFile( const wxString& name, int type ); @@ -151,6 +166,7 @@ public: static wxImageHandler *FindHandler( long imageType ); static void CleanUpHandlers(); + static void InitStandardHandlers(); protected: