Main Page | Class Hierarchy | Class List | File List | Class Members

compleximage.h

00001 /* 00002 * This file is part of libCP 00003 * FILE: compleximage.h 00004 * AUTHOR: Harald Studer <hs@lexip.ch> 00005 * 00006 * 00007 * Copyright (c) 2004, The libCP project 00008 * 00009 * This program is free software; you can redistribute it and/or modify 00010 * it under the terms of the GNU Public License as published by 00011 * the Free Software Foundation; either version 2 of the License, or 00012 * (at your opinion) any later version. 00013 * 00014 * This program is distributed in the hope that it will be useful, 00015 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00016 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00017 * General Public License for more details. 00018 * 00019 * You should have received a copy of the GNU General Public License 00020 * along with this program; see the file LICENSE. If not, write to 00021 * the Free Software Foundation, Inc., 59 Temple Place - Suite 330, 00022 * Boston, MA 02111-1307, USA. 00023 */ 00024 00025 #ifndef _LIBCP_COMPLEXIMAGE_H_ 00026 #define _LIBCP_COMPLEXIMAGE_H_ 00027 00028 #include <complex> 00029 #include "image.h" 00030 00031 using std::complex; 00032 typedef std::complex<double> Complex; 00033 00034 namespace LIBCP{ 00035 00041 class ComplexImage: public BaseImage 00042 { 00043 public: 00044 ~ComplexImage(); 00045 static ComplexImage* createComplexImage( Image* src ); 00046 static ComplexImage* createComplexImage( int width, int height, int type ); 00047 int convertToImage( Image* dst ); 00048 bool in( int x, int y ) { return ( x >= 0 && x < width() 00049 && y >= 0 && y < height() ); }; 00050 Complex& number( int x, int y ) { if( in( x, y ) ) 00051 return ( m_numbers[y] )[x]; }; 00052 void flip(); 00053 void lock() {}; 00054 void unlock() {}; 00055 //int width() { return m_width; }; 00056 //int height() { return m_height; }; 00057 Complex* getRow( int y ) { return m_numbers[y]; }; 00058 ComplexImage& operator=( ComplexImage& i ); 00059 ComplexImage& operator*=( ComplexImage& i ); 00060 bool isShifted() { return m_shifted; }; 00061 void shifted( bool shift ) { m_shifted = shift; }; 00062 00063 private: 00064 ComplexImage( Complex** numbers, int widht, int height, int type ); 00065 ComplexImage( int widht, int height, int type ); 00066 00067 void newNumbers(); 00068 void deleteNumbers(); 00069 00070 Complex** m_numbers; 00071 bool m_shifted; 00072 //int m_width; 00073 //int m_height; 00074 00075 };//end of class ComplexImage definition 00076 00077 ComplexImage& operator*( ComplexImage& a, ComplexImage& b ); 00078 00079 } //end of namespace LIBCP 00080 #endif /* _LIBCP_COMPLEXIMAGE_H_ */

Generated on Wed May 26 16:43:52 2004 for libcp by doxygen 1.3.7