00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
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
00056
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
00073
00074
00075 };
00076
00077
ComplexImage& operator*(
ComplexImage& a,
ComplexImage& b );
00078
00079 }
00080
#endif