/*This file contains the patternlist class, to save the list of
  small icons, for pattern detection*/

/*Maybe i should be proud of this, this is a classical!
  I always said "Who needs C++?"
  >;>>> */

struct pattern {
   int* brightness;
   int width;
   int height;
};
/* Our List Data Structure*/

struct patternlist;
/*The structure patternlist, public for pointers, members are private*/

struct patternmatch {
   int patident;
   int differ;
};
/*The structure patternmatch, for giving back 2 values at once ;)*/

struct patternlist* patternlist_new();
/*A constructor NULL on failure*/

int patternlist_rempattern (struct patternlist* list,int patident);
/*Removes a pattern from the list
  0 on success, 1 on not found, -1 on error
*/

int patternlist_kill(struct patternlist* list);
/*A destructor, 0 : success, -1 : error*/

int patternlist_addpattern (struct patternlist* list,int patident,int width, int height,int* icon);
/*Sets a pattern on the list
  0 added, 1, changed, -1 error
*/

struct pattern* patternlist_pattern (struct patternlist* list, int patident);
/*Gives back a pattern
   NULL in case of error
*/

struct patternmatch patternlist_bestmatch (struct patternlist* list,struct pattern* pattern);
/*Gives back the pattern that matches icon best (and how good it matches)*/

int pattern_compare (struct pattern* pattern1, struct pattern* pattern2 );
/* gives back the ident value of 2 compared patterns */

