
#ifndef OF_CV_FLOAT_IMAGE_H
#define OF_CV_FLOAT_IMAGE_H


#include "ofCvImage.h"


class ofCvFloatImage : public ofCvImage {


    public:

        ofCvFloatImage() {};
        ofCvFloatImage( const ofCvFloatImage& mom );
        void allocate( int w, int h );
        void setFromPixels( float * _pixels, int w, int h );
    
        // Set Pixel Data - Arrays
        void operator = ( ofCvGrayscaleImage& mom );
        void operator = ( ofCvColorImage& mom );
        void operator = ( ofCvFloatImage& mom );     
        void operator -= ( ofCvFloatImage& mom );
        void operator += ( ofCvFloatImage& mom );
        void operator *= ( ofCvFloatImage& mom );
        
        void operator -=	( float scalar );
    	void operator +=	( float scalar );
        void operator *=	( float scalar );
    	void operator /=    ( float scalar );
        
        void addWeighted( ofCvGrayscaleImage& mom, float f );    
        
        //------------------------------------------------------
        // scale min and scale max are used to convert from float to unsigned char...
        // are needed, since we need to convert floating point values into pixel values (0-255)
        // default values convert from 0-255, but if you has floating point data between 0 and 1, 
        // you could pass in 0, 1, etc...
        void draw(float x, float y) { drawScaled (x,y,0.0f,255.0f); }
        void draw (float x, float y, float w, float h) { drawScaled (x,y,w,h,0.0f,255.0f);    }
        void drawScaled( float x, float y, float scaleMin, float scaleMax);  
        void drawScaled( float x, float y, float w, float h, float scaleMin, float scaleMax);
        unsigned char*  getPixels(float scaleMin = 0, float scaleMax = 255); 
        float * getPixelsAsFloats();  
        //------------------------------------------------------
        
        void resize( int w, int h );
        void scaleIntoMe( ofCvFloatImage& mom, int interpolationMethod = CV_INTER_NN);
        
        
    private :
        
        float * pixelsAsFloats; // not width stepped.
        IplImage*  cvGrayscaleImage;     // internal IPL grayscale;    
};



#endif


