summaryrefslogtreecommitdiff
path: root/2003/i/buzz/src/vision/image.h
blob: eae1d20e1351724b593e8447addbca234e260505 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
#ifndef image_h
#define image_h
// image.h - Image class
// buzz - Programme du robot Efrei Robotique I1-I2 2003
// Copyright (C) 2003 Nicolas Schodet
#include "thresholds.h"
#include "size_thresholds.h"

struct ImageGroup
{
    ImageGroup *next;
    int x, y, w, h;
    int zone, type;
};

class Image
{
    int m_width, m_height;
    unsigned char *m_image;
    unsigned char *m_zones;
    ImageGroup *m_groups;
    Thresholds *m_thresholds;
    SizeThresholds *m_sizeThresholds;
  public:
    // Constructeur.
    Image (const char *filename, Thresholds *thresholds,
	   SizeThresholds *sizeThresholds);
    // Destructeur.
    ~Image (void);
    void filter (void);
    // Fait des packets de pixels.
    void group (void);
    // Affiche les groupes qui on �t� trouv�s.
    void dumpGroups (void);
    // Enregistre les infos trouv�es.
    void dump (const char *filename);
    // Filtre les packets de pixels.
    void groupFilter (void);
  protected:
    // Fait des packets de pixels sur les lignes.
    void groupLine (void);
};

#endif // image_h