1 /*-----------------------------------------------------------------------------
2 Code written by Francois Fleuret, using GCC & Emacs
4 Contact <francois.fleuret@inria.fr>
5 -----------------------------------------------------------------------------*/
7 // A class to manipulate pictures. June 1995.
9 // francois.fleuret@inria.fr
10 // Thanxxxxx to Emacs & gcc
12 /*---------------------------------------------------------------------------*/
17 #define BUFFER_SIZE 256
19 /*---------------------------------------------------------------------------*/
23 #include <sys/types.h>
29 extern "C" int read(int, char *, int);
30 extern "C" int write(int, char *, int);
31 //extern "C" int open(char *, int);
32 extern "C" int close(int);
35 extern "C" image *image_(char *, char *, char *, nf_fmt *);
36 extern "C" c_lecflt(image *, int, unsigned char *);
37 extern "C" c_ecrflt(image *, int, unsigned char *);
38 extern "C" fermnf_(image **);
41 /*---------------------------------------------------------------------------*/
50 #define LARGEUR_TRUC 9
51 #define HAUTEUR_TRUC (MAX_TAGIFICATION/LARGEUR_TRUC)
53 /*---------------------------------------------------------------------------*/
67 Picture(int SX, int SY);
70 float GetComponent(int x, int y, int n);
71 void SetComponent(int x, int y, int n, float v);
79 void Reformat(int x, int y);
83 void AddBorders(int w, float r, float g, float b);
85 void LoadPpm(char *file_name);
86 void SavePpm(char *file_name);
88 void ReSize(int nx, int ny);
89 void Cut(int x, int y, int w, int h, Picture &src);
90 void Copy(int xd, int yd, int xs, int ys, int w, int h, Picture &src);
91 int operator == (Picture &src);
92 void operator = (Picture &src);
94 float Picture::DistanceL2(Picture *p);
97 /*---------------------------------------------------------------------------*/