#ifndef _Img_h_ #define _Img_h_ #include // Classe image #define SIZEHISTO 4096 /* Differents type coding for images and buffers. */ #define MAXBLOB 8191 // ! On utilise parfois MAXBLOB + 1 typedef enum ImageType { TYPE_UNKNOWN, TYPE_UCHAR, TYPE_SCHAR, TYPE_USHORT, TYPE_SSHORT, TYPE_INT, TYPE_ULINT, TYPE_FLOAT, TYPE_DOUBLE }; typedef char s8; typedef unsigned char u8; typedef short int s16; typedef unsigned short int u16; typedef int i32; typedef int s32; typedef unsigned long int u64; typedef float r32; typedef double r64; struct blob { // Utilise pour le blob coloring int bind; // Indice du blob int used; long size; unsigned int *first; // Image des blobs en int }; class img { public: void *data; // Data of the image which contain the pixels data int init; // Image initialized int itype; // Type of the pixel date int dimh; // Dimension Horizontal int dimv; // Dimension Vertical unsigned long nbpix; // Nb of pixels of the image img(); ~img(); void Del(); int Create(int it, int dh, int dv); void CopyTo(img *img2); void Fill(int value); int GetValue(int x, int y); void SetValue(int x, int y, int value); void Equalize(int ngray); // Mathematical morphology void BinaryErosion(img *res); void BinaryDilatation(img *res); void BinaryOpening(img *tamp); void BinaryClosing(img *tamp); void RemplaceCouleur(int a, int b); int BlobColoring(blob tblob[MAXBLOB], img *img1); long GetBlobSize(int nblob); void SaveImgAsRaw(); }; #endif