00001 #ifndef FractalImage_H 00002 #define FractalImage_H 00003 /*######################################################################## 00004 File: FractalImage.h 00005 Creation date: 25th May 2002 00006 00007 Copyright 2002 Mark Williams, all rights reserved. 00008 Contact: mark@extrabit.com 00009 http://www.extrabit.com 00010 00011 This program is free software; you can redistribute it and/or 00012 modify it under the terms of the GNU General Public License 00013 as published by the Free Software Foundation; either version 2 00014 of the License, or (at your option) any later version. 00015 00016 This program is distributed in the hope that it will be useful, 00017 but WITHOUT ANY WARRANTY; without even the implied warranty of 00018 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00019 GNU General Public License for more details. 00020 00021 ########################################################################*/ 00022 00023 /*######################################################################## 00024 Headers 00025 ########################################################################*/ 00026 00027 #include "rgbcolour.h" 00028 #include "Vector2.h" 00029 #include "ComplexNumber.h" 00030 #include "Matrix33.h" 00031 00032 /*######################################################################## 00033 Declarations 00034 ########################################################################*/ 00035 00036 class Processor ; 00037 class Palette ; 00038 00039 /*######################################################################## 00040 Class Definition 00041 ########################################################################*/ 00042 00053 class FractalImage 00054 { 00055 public: 00056 FractalImage (void) ; 00057 FractalImage (const FractalImage&) ; 00058 ~FractalImage (void) ; 00059 00060 const Processor* inq_processor (void) const { return m_processor ; } 00061 void set_processor (const Processor*) ; 00062 const ComplexNumber& inq_initial_z (void) const { return m_initial_z ; } 00063 void set_initial_z (const ComplexNumber& z) { m_initial_z = z ; } 00064 void set_invert_u (bool invert_u) { m_invert_u = invert_u ; } 00065 bool inq_invert_u (void) const { return m_invert_u ; } 00066 00067 void set_palette (const Palette*) ; 00068 const Palette* inq_palette (void) const { return m_palette ; } 00069 void resize (int width, int height, rgbcolour_t* rgb_pixels) ; 00070 00071 void set_view (const Vector2& centre, double width, double angle) ; 00072 const Matrix33& inq_view_transform (void) const { return m_view_transform ; } 00073 const Vector2& inq_view_centre (void) const { return m_view_centre ; } 00074 double inq_view_width (void) const { return m_view_width ; } 00075 double inq_view_angle (void) const { return m_view_angle ; } 00076 00077 int inq_width (void) const { return m_width ; } 00078 int inq_height (void) const { return m_height ; } 00079 int inq_npixels (void) const { return m_width*m_height ; } 00080 unsigned short* inq_pixel_itns (void) const { return m_pixel_itns ; } 00081 const unsigned short* inq_pixel_itns (int x, int y) const { return m_pixel_itns + x + y*m_width ; } 00082 rgbcolour_t* inq_rgb_pixels (void) const { return m_rgb_pixels ; } 00083 00084 void restart (void) ; 00085 void update_all_rgb_pixels (void) ; 00086 00087 ComplexNumber convert_point_to_z (const Vector2&) const ; 00088 00089 private: 00090 void update_view_transform (void) ; 00091 00092 private: 00094 const Processor* m_processor ; 00095 00099 bool m_invert_u ; 00100 00102 ComplexNumber m_initial_z ; 00103 00105 const Palette* m_palette ; 00106 00108 int m_width ; 00109 00111 int m_height ; 00112 00121 unsigned short* m_pixel_itns ; 00122 00131 rgbcolour_t* m_rgb_pixels ; 00132 00134 Vector2 m_view_centre ; 00135 00137 double m_view_width ; 00138 00140 double m_view_angle ; 00141 00146 Matrix33 m_view_transform ; 00147 } ; 00148 00149 00150 /*######################################################################## 00151 End 00152 ########################################################################*/ 00153 #endif
1.2.16