1 // Copyright (C) 2007-2012 Christian Stehno
2 // This file is part of the "Irrlicht Engine".
3 // For conditions of distribution and use, see copyright notice in irrlicht.h
4 
5 #ifndef __C_IMAGE_LOADER_PPM_H_INCLUDED__
6 #define __C_IMAGE_LOADER_PPM_H_INCLUDED__
7 
8 #include "IrrCompileConfig.h"
9 
10 #ifdef _IRR_COMPILE_WITH_PPM_LOADER_
11 
12 #include "IImageLoader.h"
13 #include "irrString.h"
14 
15 
16 namespace irr
17 {
18 namespace video
19 {
20 
21 
22 /*!
23 	Surface Loader for SUN Pixmaps
24 */
25 class CImageLoaderPPM : public IImageLoader
26 {
27 public:
28 
29 	//! constructor
30 	CImageLoaderPPM();
31 
32 	//! returns true if the file maybe is able to be loaded by this class
33 	//! based on the file extension (e.g. ".tga")
34 	virtual bool isALoadableFileExtension(const io::path& filename) const;
35 
36 	//! returns true if the file maybe is able to be loaded by this class
37 	virtual bool isALoadableFileFormat(io::IReadFile* file) const;
38 
39 	//! creates a surface from the file
40 	virtual IImage* loadImage(io::IReadFile* file) const;
41 
42 private:
43 	//! read the next token from file
44 	void getNextToken(io::IReadFile* file, core::stringc& token) const;
45 	//! skip to next token (skip whitespace)
46 	void skipToNextToken(io::IReadFile* file) const;
47 };
48 
49 } // end namespace video
50 } // end namespace irr
51 
52 
53 #endif
54 #endif
55 
56