imagpnm.h 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. /////////////////////////////////////////////////////////////////////////////
  2. // Name: wx/imagpnm.h
  3. // Purpose: wxImage PNM handler
  4. // Author: Sylvain Bougnoux
  5. // Copyright: (c) Sylvain Bougnoux
  6. // Licence: wxWindows licence
  7. /////////////////////////////////////////////////////////////////////////////
  8. #ifndef _WX_IMAGPNM_H_
  9. #define _WX_IMAGPNM_H_
  10. #include "wx/image.h"
  11. //-----------------------------------------------------------------------------
  12. // wxPNMHandler
  13. //-----------------------------------------------------------------------------
  14. #if wxUSE_PNM
  15. class WXDLLIMPEXP_CORE wxPNMHandler : public wxImageHandler
  16. {
  17. public:
  18. inline wxPNMHandler()
  19. {
  20. m_name = wxT("PNM file");
  21. m_extension = wxT("pnm");
  22. m_altExtensions.Add(wxT("ppm"));
  23. m_altExtensions.Add(wxT("pgm"));
  24. m_altExtensions.Add(wxT("pbm"));
  25. m_type = wxBITMAP_TYPE_PNM;
  26. m_mime = wxT("image/pnm");
  27. }
  28. #if wxUSE_STREAMS
  29. virtual bool LoadFile( wxImage *image, wxInputStream& stream, bool verbose=true, int index=-1 );
  30. virtual bool SaveFile( wxImage *image, wxOutputStream& stream, bool verbose=true );
  31. protected:
  32. virtual bool DoCanRead( wxInputStream& stream );
  33. #endif
  34. private:
  35. DECLARE_DYNAMIC_CLASS(wxPNMHandler)
  36. };
  37. #endif
  38. #endif
  39. // _WX_IMAGPNM_H_