#ifndef MY_IMAGE_H
#define MY_IMAGE_H


#include<highgui.h>

#include <cv.h>

#include <iostream>
#include <cmath>

#include <lib.h>

class my_image
{

public:
        //metody
    my_image(IplImage *img);
    my_image(my_image *img);
    my_image(uchar *data,int width,int height,int Channels=1);
    ~my_image();
    uchar get(int x,int y);
    uchar get(BOD bod);
    void set(int x, int y,uchar color);
    void clean_all();//vymaze obraz = nastavi ho na cernou barvu
    void white_all();//nastavi obraz na bilou barvu
    void norm_gradiend();
    void invert_color();
    void prahuj(uchar prah,bool blackNwhite=true);//blackNwhite=true -> vystupni obraz je cernobily;;; blackNwhite=false -> vse pod prahem je 0 jinak se zachova puvodni hodnota


    IplImage * get_cv_image();
    int Width();
    int Height();
protected:
    int width;
    int height;
    int  depth;
    int  nChannels;
public://!!!!!!!!
    uchar **data;

    //metody
    uchar ** alocate_mem();
    void delete_memory(uchar ** memory);

};

#endif // MY_IMAGE_H
