Put the readers and writers in charles namespace
This commit is contained in:
		
							parent
							
								
									84cb27fa6f
								
							
						
					
					
						commit
						3a8c955796
					
				
					 4 changed files with 29 additions and 20 deletions
				
			
		| 
						 | 
				
			
			@ -2,18 +2,18 @@
 | 
			
		|||
 * vim: set tw=80:
 | 
			
		||||
 * Eryn Wells <eryn@erynwells.me>
 | 
			
		||||
 */
 | 
			
		||||
 | 
			
		||||
#ifndef __READERYAML_HH__
 | 
			
		||||
#define __READERYAML_HH__
 | 
			
		||||
 | 
			
		||||
#include "reader.hh"
 | 
			
		||||
#include "scene.hh"
 | 
			
		||||
 | 
			
		||||
namespace charles {
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * An input file reader for YAML files.
 | 
			
		||||
 */
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
#ifndef __READER_YAML_HH__
 | 
			
		||||
#define __READER_YAML_HH__
 | 
			
		||||
 | 
			
		||||
#include "reader.hh"
 | 
			
		||||
#include "scene.h"
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
struct YAMLReader
 | 
			
		||||
    : public Reader
 | 
			
		||||
{
 | 
			
		||||
| 
						 | 
				
			
			@ -21,9 +21,9 @@ struct YAMLReader
 | 
			
		|||
        : Reader(scene)
 | 
			
		||||
    { }
 | 
			
		||||
 | 
			
		||||
    ~YAMLReader() { }
 | 
			
		||||
 | 
			
		||||
    ssize_t read_file(const std::string& filename);
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
} /* namespace charles */
 | 
			
		||||
 | 
			
		||||
#endif /* __READER_YAML_HH__ */
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -1,4 +1,4 @@
 | 
			
		|||
/* scene.h
 | 
			
		||||
/* scene.hh
 | 
			
		||||
 * vim: tw=80:
 | 
			
		||||
 * Eryn Wells <eryn@erynwells.me>
 | 
			
		||||
 */
 | 
			
		||||
| 
						 | 
				
			
			@ -17,11 +17,11 @@
 | 
			
		|||
#include "basics/basics.hh"
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
namespace charles {
 | 
			
		||||
 | 
			
		||||
class Writer;
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
namespace charles {
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * Scenes are the top level object in charles. Scenes contain objects, lights, a
 | 
			
		||||
 * camera, etc. and can be rendered to pixel data and written to a file.
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -11,7 +11,9 @@
 | 
			
		|||
#include <string>
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
class Scene;
 | 
			
		||||
namespace charles {
 | 
			
		||||
 | 
			
		||||
struct Scene;
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
class Writer
 | 
			
		||||
| 
						 | 
				
			
			@ -24,4 +26,6 @@ public:
 | 
			
		|||
    virtual int write_scene(const Scene &scene, const std::string &filename) = 0;
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
} /* namespace charles */
 | 
			
		||||
 | 
			
		||||
#endif
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -1,16 +1,19 @@
 | 
			
		|||
/* writer_png.h
 | 
			
		||||
 *
 | 
			
		||||
 * Declaration of the PNG writer.
 | 
			
		||||
 *
 | 
			
		||||
 * vim: set tw=80:
 | 
			
		||||
 * Eryn Wells <eryn@erynwells.me>
 | 
			
		||||
 */
 | 
			
		||||
 | 
			
		||||
#ifndef __WRITER_PNG_H__
 | 
			
		||||
#define __WRITER_PNG_H__
 | 
			
		||||
#ifndef __WRITERPNG_HH__
 | 
			
		||||
#define __WRITERPNG_HH__
 | 
			
		||||
 | 
			
		||||
#include "writer.h"
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
namespace charles {
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * Write for producing PNG files.
 | 
			
		||||
 */
 | 
			
		||||
class PNGWriter
 | 
			
		||||
    : public Writer
 | 
			
		||||
{
 | 
			
		||||
| 
						 | 
				
			
			@ -18,4 +21,6 @@ public:
 | 
			
		|||
    int write_scene(const Scene &scene, const std::string &filename);
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
} /* namespace charles */
 | 
			
		||||
 | 
			
		||||
#endif
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue