#ifndef OF_CV_GRAYSCALE_IMAGE_H
#define OF_CV_GRAYSCALE_IMAGE_H

#include "ofCvImage.h"


// for all the things ofCvGrayscaleImage can do, check:
// ofCvImage.h


class ofCvGrayscaleImage : public ofCvImage {


  public:

    ofCvGrayscaleImage() {};
    ofCvGrayscaleImage( const ofCvGrayscaleImage& mom );
    void allocate( int w, int h );

    // Set Pixel Data - Arrays
    void setFromPixels( unsigned char* _pixels, int w, int h );
    void set(int value);
	void invert( );
    
    
    void operator = ( unsigned char* _pixels );
    void operator = ( ofCvGrayscaleImage& mom );
    void operator = ( ofCvColorImage& mom );
    void operator = ( ofCvFloatImage& mom );     
    void operator -= ( ofCvGrayscaleImage& mom );
    void operator += ( ofCvGrayscaleImage& mom );
    void operator *= ( ofCvGrayscaleImage& mom );    
    void operator &= ( ofCvGrayscaleImage& mom );
    void operator -=	( float scalar );
	void operator +=	( float scalar );
    
    void absDiff( ofCvGrayscaleImage& mom );
    void absDiff( ofCvGrayscaleImage& mom, ofCvGrayscaleImage& dad );
        
    // Get Pixel Data
    unsigned char*  getPixels();
    
    // Draw Image
    void draw( float x, float y );
    void draw( float x, float y, float w, float h );
    
    void drawBlobIntoMe( ofCvBlob & blob, int color );
        
    // Image Filter Operations
    void contrastStretch();
    void threshold( int value, bool invert = false);

    // Image Transformation Operations
    void resize( int w, int h );
    void scaleIntoMe( ofCvGrayscaleImage& mom, int interpolationMethod = CV_INTER_NN);
    
   //---------------------------------------------
    //---------------- legacy ---------------------
	// this code is kept here to allow older ofCv code to work 
    // you should use the newer functions (ie, blur(33) instead of blurHeavily)
    // since we might not always keep old code around
    
    void blurHeavily() { blur(33); };   // for legacy code
	void erode_3x3() { erode(); };
	void dilate_3x3() { dilate(); };
	void setFromColorImage(ofCvColorImage& mom) { *this = mom; };
	void setFromFloatImage(ofCvFloatImage& mom) { *this = mom; }; 
    
    
    //--------------------------------------------
    //---------------- in ofImage ----------------
    // the code below is inside of ofImage, meaning we can call it 
    // on this object (since it inherits ofImage)
    // kept here as a reference....
    
    /* 
    virtual void draw( float x, float y ) = 0;
    virtual void draw( float x, float y, float w, float h ) = 0;
    virtual void erode( );  // based on 3x3 shape
    virtual void dilate( );  // based on 3x3 shape
    virtual void blur( int value=3 );  // value = x*2+1, where x is an integer
    virtual void blurGaussian( int value=3 );  // value = x*2+1, where x is an integer
    virtual void mirror( bool bFlipVertically, bool bFlipHorizontally );
    
    virtual void translate( float x, float y );
    virtual void rotate( float angle, float centerX, float centerY );
    virtual void scale( float scaleX, float sclaeY );
    virtual void transform( float angle, float centerX, float centerY, 
                            float scaleX, float scaleY,
                            float moveX, float moveY ); 
    virtual void undistort( float radialDistX, float radialDistY,
                            float tangentDistX, float tangentDistY,
                            float focalX, float focalY,
                            float centerX, float centerY );
                            
    virtual void remap( IplImage* mapX, IplImage* mapY );
    virtual void warpPerspective( const ofPoint& A,
                                  const ofPoint& B,
                                  const ofPoint& C,
                                  const ofPoint& D );
    virtual void warpIntoMe( const ofCvGrayscaleImage& mom, 
                             ofPoint src[4], ofPoint dst[4] );
    virtual int countNonZeroInRegion( int x, int y, int w, int h ) const;
    */
           
};



#endif

