Fractal.h

Go to the documentation of this file.
00001 //**********************************************************************
00002 //
00003 //  REGCOM: Regimental Command
00004 //  Copyright (C) 2008 Randi J. Relander
00005 //    <rjrelander@users.sourceforge.net>
00006 //
00007 //  This program is free software; you can redistribute it and/or
00008 //  modify it under the terms of the GNU General Public License
00009 //  as published by the Free Software Foundation; either version 3
00010 //  of the License, or (at your option) any later version.
00011 //  
00012 //  This program is distributed in the hope that it will be useful,
00013 //  but WITHOUT ANY WARRANTY; without even the implied warranty of
00014 //  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00015 //  GNU General Public License for more details.
00016 //  
00017 //  You should have received a copy of the GNU General Public
00018 //  License along with this program.  If not, see 
00019 //  <http://www.gnu.org/licenses/>.
00020 //  
00021 //**********************************************************************
00022 
00023 #ifndef REGCOM_COMMON_FRACTAL_H
00024 #define REGCOM_COMMON_FRACTAL_H
00025 
00026 // PROJECT INCLUDES
00027 #include "regcom/common/ErrorCode.h"
00028 
00029 // NAMESPACES
00030 namespace regcom {
00031 namespace common {
00032 
00034 //  CLASS: Fractal
00041 class Fractal
00042 {
00043 public:
00044 
00045     // PUBLIC METHODS
00046 
00048     Fractal();
00049 
00051     virtual ~Fractal();
00052 
00054     common::ErrorCodeType Allocate(int width, int height);
00055 
00057     common::ErrorCodeType Generate(int scale);
00058 
00060     common::ErrorCodeType GetData(int x, int y, int& rData) const;
00061 
00062 private:
00063 
00064     // PRIVATE METHODS
00065 
00067     common::ErrorCodeType SetData(int x, int y, int data);
00068 
00070     common::ErrorCodeType Pass(
00071         int xstep, int ystep, int step, int scale);
00072 
00073     // MEMBER VARIABLES
00074 
00076     unsigned char* m_pData;
00077 
00079     int m_Size;
00080 };
00081 
00082 } // namespace common
00083 } // namespace regcom
00084 
00085 #endif