#ifndef CIS_H
#define CIS_H

#include <funkce.h>
#include <my_image.h>
#include <stdlib.h>


#include <iostream>
#include <cmath>
#include <vector>

class cis
{
    //metody
    public:
        //cis(my_image *img);//img je referencni obraz
        cis(my_image *img,int circle_cound=5,int circle_delta=3);//img je referencni obraz,nastavi pocet kruznic
        ~cis();
        bool find(my_image *img);//vraci true pokud vyhovuje alespon jeden bod

    private:
        class CI{//trida znaci jediny bod v CIS prostoru
               //promenne
                public:
                     int x;
                     int y;
                     double *sum;
                private:
                    int count_r;

                //metody
                public:
                    CI(int count);
                    ~CI();
                    int operator-(const cis::CI &t1) const;
                private:


        };
        cis::CI** img2CI(my_image *img, int *count);
        cis::CI * point2CI(int x,int y,my_image * img);
        double CI_r(my_image * image,int x0, int y0, int radius); //vypocita sumu bodu na jednom radiusu
        void del_img();
        int get_pixel(int x,int y,my_image *image);

//promenne
public:
        int delta_r;
        int min_r;
        int count_r;
        std::vector<BOD> body;

private:
     CI **ci_ref;
     CI **ci;//pole ma jeden prvek
     int count_ci_ref;
     int count_ci;
     my_image *img_ref;
     my_image * img;

};


#endif // CIS_H
