libcoyotl - A Library of C++ Tools

Created by Scott Robert Ladd at Coyote Gulch Productions.


maze_renderer.h
1 //---------------------------------------------------------------------
2 // Algorithmic Conjurings @ http://www.coyotegulch.com
3 //
4 // maze_renderer.h (libcoyotl)
5 //
6 // Maze generation and exploration tools
7 //-----------------------------------------------------------------------
8 //
9 // Copyright 1990-2005 Scott Robert Ladd
10 //
11 // This program is free software; you can redistribute it and/or modify
12 // it under the terms of the GNU General Public License as published by
13 // the Free Software Foundation; either version 2 of the License, or
14 // (at your option) any later version.
15 //
16 // This program is distributed in the hope that it will be useful,
17 // but WITHOUT ANY WARRANTY; without even the implied warranty of
18 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 // GNU General Public License for more details.
20 //
21 // You should have received a copy of the GNU General Public License
22 // along with this program; if not, write to the
23 // Free Software Foundation, Inc.
24 // 59 Temple Place - Suite 330
25 // Boston, MA 02111-1307, USA.
26 //
27 //-----------------------------------------------------------------------
28 //
29 // For more information on this software package, please visit
30 // Scott's web site, Coyote Gulch Productions, at:
31 //
32 // http://www.coyotegulch.com
33 //
34 //-----------------------------------------------------------------------
35 
36 #if !defined(LIBCOYOTL_MAZERENDERER_H)
37 #define LIBCOYOTL_MAZERENDERER_H
38 
39 #include "maze.h"
40 
41 namespace libcoyotl
42 {
44 
49  {
50  public:
52 
58  static void render(const libcoyotl::maze & a_source, const std::string & a_filename, size_t a_grid_size);
59 
60  private:
61  // A type for handling mage images
62  class image
63  {
64  public:
65  // constructor
66  image(const maze & source, size_t grid_size);
67 
68  // destructor
69  ~image();
70 
71  // properties
72  unsigned char ** get_bits() const
73  {
74  return m_bits;
75  }
76 
77  int get_width() const
78  {
79  return m_width;
80  }
81 
82  int get_height() const
83  {
84  return m_height;
85  }
86 
87  private:
88  // maze width
89  int m_width;
90 
91  // naze height
92  int m_height;
93 
94  // bits representing the maze
95  unsigned char ** m_bits;
96  };
97  };
98 }
99 
100 #endif
Renders a maze object.
Definition: maze_renderer.h:48
Defines the data structure of a maze.
Definition: maze.h:55
Definition: array.h:61
static void render(const libcoyotl::maze &a_source, const std::string &a_filename, size_t a_grid_size)
Renders a maze to a PNG file with a specific cell size.

© 1996-2005 Scott Robert Ladd. All rights reserved.
HTML documentation generated by Dimitri van Heesch's excellent Doxygen tool.