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_DOUBLEIMAGE_H_
00026
#define _LIBCP_DOUBLEIMAGE_H_
00027
00028
#include <cstdlib>
00029
#include <iostream>
00030
00031
using namespace std;
00032
00033
#include "globals.h"
00034
#include "image.h"
00035
00036
namespace LIBCP{
00037
00043 class DoubleImage :
public BaseImage
00044 {
00045
public:
00046
~DoubleImage();
00047
static DoubleImage*
createDoubleImage(
Image* img );
00048
static DoubleImage* createDoubleImage(
int width,
int height,
int type );
00049
int convertToImage(
Image* dst );
00050
bool in(
int x,
int y ) {
return ( x >= 0 && x < width()
00051 && y >= 0 && y < height() ); };
00052
double& number(
int x,
int y ) {
if( in( x, y ) )
00053
return ( m_numbers[y] )[x]; };
00054
00055
void lock() {};
00056
void unlock() {};
00057
00058
bool isValidPixel(
int x,
int y);
00059
DoubleImage&
operator=(
DoubleImage& i );
00060
DoubleImage& operator*=(
DoubleImage& i );
00061
00062
private:
00063
DoubleImage(
double** numbers,
int widht,
int height,
int type );
00064
DoubleImage(
int widht,
int height,
int type );
00065
00066
void newNumbers();
00067
void deleteNumbers();
00068
double** m_numbers;
00069
00070 };
00071
00072
DoubleImage& operator*(
DoubleImage& a,
DoubleImage& b );
00073
00074 }
00075
#endif