#pragma hdrstop
#endif
+#ifndef WX_PRECOMP
+# include "wx/setup.h"
+#endif
+
+#if wxUSE_PNM
+
#include "wx/image.h"
#include "wx/log.h"
#include "wx/txtstrm.h"
-#ifdef __WXMSW__
-#include <windows.h>
-#endif
-
//-----------------------------------------------------------------------------
// wxBMPHandler
//-----------------------------------------------------------------------------
#if wxUSE_STREAMS
-//#include <stream.h> // for cout
-
void Skip_Comment(wxInputStream &stream)
{
wxString line;
* Read the PNM header
*/
- wxTextInputStream text_stream(stream);
+ wxBufferedInputStream buf_stream(stream);
+ wxTextInputStream text_stream(buf_stream);
- Skip_Comment(stream);
- if (stream.GetC()==_T('P')) c=stream.GetC();
+ Skip_Comment(buf_stream);
+ if (buf_stream.GetC()==_T('P')) c=buf_stream.GetC();
switch (c)
{
}
text_stream >> line; // for the \n
- Skip_Comment(stream);
+ Skip_Comment(buf_stream);
text_stream >> width >> height ;
- Skip_Comment(stream);
+ Skip_Comment(buf_stream);
text_stream >> maxval;
//cout << line << " " << width << " " << height << " " << maxval << endl;
return FALSE;
}
- wxBufferedInputStream buf_stream(stream);
-
if (c=='3') // Ascii RBG
{
wxUint32 value, size=3*width*height;
#endif // wxUSE_STREAMS
-
+#endif // wxUSE_PNM