Newer
Older
#include <iostream>
using namespace std;
class Image
{
private:
Pixel & getPix(unsigned int x, unsigned int y) const;
Pixel getPix2(unsigned int x, unsigned int y) const;
void setPix(unsigned int x, unsigned int y, Pixel couleur);
void dessinerRectangle(unsigned int Xmin, unsigned int Ymin, unsigned int Xmax, unsigned int Ymax, Pixel couleur);
void sauver(const string &filename) const;
void ouvrir(const string &filename);
p = im.getPix(20,26);
cout<<"expecting 0 : "<<int(p.r)<<endl;
cout<<endl;
Image im2;
cout<<"dim im2 : "<<im2.dimx<<" , "<<im2.dimy<<endl;
cout<<"expecting 10 20 30: "<<int(p3.r)<<","<<int(p3.g)<<","<<int(p3.b)<<endl;
im.dessinerRectangle(10,10,30,30,Pixel(78,36,108));
Pixel p4 = im.getPix2(15,20);
cout<<"expecting 78 36 108: "<<int(p4.r)<<","<<int(p4.g)<<","<<int(p4.b)<<endl;
cout<<endl;
im.effacer(Pixel(0,0,0));
p4 = im.getPix2(18,25);
cout<<"expecting 0 0 0: "<<int(p4.r)<<","<<int(p4.g)<<","<<int(p4.b)<<endl;
//im.~Image();
}