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

push 2

parent eaa0bd52
No related branches found
No related tags found
No related merge requests found
Pipeline #189515 failed
No preview for this file type
No preview for this file type
No preview for this file type
No preview for this file type
No preview for this file type
......@@ -8,7 +8,7 @@ using namespace std;
class Image
{
private:
unsigned dimx,dimy;
unsigned int dimx,dimy;
Pixel * tab;
......
......@@ -107,7 +107,7 @@ void ImageViewer::setSurfText()
m_texture = SDL_CreateTextureFromSurface(renderer,m_surface);
}
void ImageViewer::afficher(const Image & im)
void ImageViewer::afficher(const Image & im)const
{
SDL_Event events;
bool quit = false;
......@@ -140,4 +140,6 @@ void ImageViewer::afficher(const Image & im)
// on permute les deux buffers (cette fonction ne doit se faire qu'une seule fois dans la boucle)
SDL_RenderPresent(renderer);
}
im.~Image();
}
......@@ -19,7 +19,7 @@ class ImageViewer
ImageViewer(); // Constructeur qui initialise tout SDL2 et crée la fenêtre et le renderer
~ImageViewer(); // Détruit et ferme SDL2
void setSurfText();
void afficher(const Image & im);
void afficher(const Image & im)const;
};
......
......@@ -9,7 +9,7 @@ Pixel::Pixel()
b = 0;
}
Pixel::Pixel(unsigned int x,unsigned int y, unsigned int z)
Pixel::Pixel(unsigned char x,unsigned char y, unsigned char z)
{
assert(x>=0 && x<=255);
assert(y>=0 && y<=255);
......
......@@ -9,7 +9,7 @@ class Pixel
unsigned char b;
Pixel();
Pixel(unsigned int ro, unsigned int ve, unsigned int bl);
Pixel(unsigned char ro, unsigned char ve, unsigned char bl);
Pixel operator=(Pixel p);
};
......
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