Skip to content
Snippets Groups Projects
Commit 07e682e5 authored by Jean-Marc's avatar Jean-Marc
Browse files

ajout des .o

parent 156bd2f1
No related branches found
No related tags found
No related merge requests found
Pipeline #185453 failed
File added
File added
File added
#include "pixel.h"
#include <iostream>
using namespace std;
class Image
{
private:
int dimx,dimy;
Pixel * tab;
public:
Image();
Image(int x, int y);
~Image();
Pixel & getPix(int x, int y) const;
Pixel getPix2(int x, int y) const;
void setPix(int x, int y, Pixel couleur);
void dessinerRectangle(int Xmin, int Ymin, int Xmax, int Ymax, Pixel couleur);
void effacer (Pixel couleur);
static void testRegression()
{
Pixel p;
Pixel p2(10,20,30);
Image im(50,50);
p = im.getPix2(20,26);
cout<<p.r<<endl;
im.setPix(27,12,p2);
Pixel p3 = im.getPix2(27,12);
cout<<p3.r<<endl;
im.dessinerRectangle(10,10,30,30,p3);
};
};
#include "Image.h"
#include <iostream>
using namespace std;
int main (void)
{
Image::testRegression();
return 0;
}
\ No newline at end of file
#include "pixel.h"
#include <iostream>
Pixel::Pixel()
{
r = 0;
g = 0;
b = 0;
}
Pixel::Pixel(int x,int y, int z)
{
r = x;
g = y;
b = z;
}
Pixel Pixel::operator=(Pixel p)
{
r = p.r;
g = p.g;
b = p.b;
return *this;
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment