// robert - programme du robot 2005 // // Copyright (C) 2005 Olivier Gaillard // // Robot APB Team/Efrei 2005. // Web: http://assos.efrei.fr/robot/ // Email: robot AT efrei DOT fr // // This program is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation; either version 2 of the License, or // (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #ifndef live_h #define live_h #include "adjust.hh" #include "ovision/see/convertImg.hh" #include "ovision/see/imgInterface.hh" #include "ovision/see/segmLearn.hh" #include "ovision/see/oconfig.hh" #include "ovision/see/group.hh" #include "ovision/see/magnifier.hh" #define NB_POINTS_UI 6 /// Traitement de l'image dans le but d'être visualisé sur une interface class Live { unsigned nbImg_; ImageReader *reader_; int colorToFind_; public: enum ImageInput {file, cam, socket}; /// Constructeur Live (const unsigned nbImg, const ImageInput imgInput = file); /// Destructeur ~Live (void); /// tableau des numeros de textures utilises par openGL unsigned *tex; /// tableau de donnees RGB stockant les images unsigned char **data; /// classe image ImgInterface *img; /// classe config OConfig *oconfig; /// classe segmentation SegmLearn *segm; /// classe group Group *group; /// classe magnifier Magnifier *mag; /// nom de l'image courante char fname[100]; /// Initialisation void init (const Image::PixelFormat pf = Image::rgb, const char *filename = 0, const unsigned width=360, const unsigned height=296); /// Recharge le fichier de config void reloadConfig (const char *filename); /// Segmentation et groupement des couleurs void segmAndGroup (const int numColorToShow = -1); /// Fixe une image ségmentée et une image de groupe dans la partie centrale void rootPics (); /// Mis à jour de l'image void updateImg (const Image::PixelFormat pf = Image::rgb, const char *filename = 0, const unsigned width=360, const unsigned height=296); /// Accessors void setColorToFind (const int color) {colorToFind_ = color;} private: ImageInput imgInput_; }; #endif // live_h