Removed LastError() from wxFilterStream
Added a better Peek() to wxBufferedInputStream Fixed wxPNMHandler (it is a lot faster on text PNM now) Image sample loads a PNM git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@3525 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -64,10 +64,11 @@ bool wxPNMHandler::LoadFile( wxImage *image, wxInputStream& stream, bool WXUNUSE
|
||||
* 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)
|
||||
{
|
||||
@@ -84,9 +85,9 @@ bool wxPNMHandler::LoadFile( wxImage *image, wxInputStream& stream, bool WXUNUSE
|
||||
}
|
||||
|
||||
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;
|
||||
@@ -98,8 +99,6 @@ bool wxPNMHandler::LoadFile( wxImage *image, wxInputStream& stream, bool WXUNUSE
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
wxBufferedInputStream buf_stream(stream);
|
||||
|
||||
if (c=='3') // Ascii RBG
|
||||
{
|
||||
wxUint32 value, size=3*width*height;
|
||||
|
||||
Reference in New Issue
Block a user