representation d'une image.
More...
#include <image.h>
|
| Image (const int w, const int h, const Color &color=Black()) |
|
Color & | operator() (const int x, const int y) |
|
Color | operator() (const int x, const int y) const |
| renvoie la couleur d'un pixel de l'image (image non modifiable). More...
|
|
const void * | buffer () const |
| renvoie un pointeur sur le stockage des couleurs des pixels. More...
|
|
int | width () const |
| renvoie la largeur de l'image. More...
|
|
int | height () const |
| renvoie la hauteur de l'image. More...
|
|
std::size_t | size () const |
| renvoie le nombre de pixels de l'image. More...
|
|
bool | operator== (const Image &im) const |
| comparaison avec la sentinelle. More...
|
|
|
std::vector< Color > | m_data |
|
int | m_width |
|
int | m_height |
|
representation d'une image.
Definition at line 18 of file image.h.
Color& Image::operator() |
( |
const int |
x, |
|
|
const int |
y |
|
) |
| |
|
inline |
renvoie une reference sur la couleur d'un pixel de l'image. permet de modifier et/ou de connaitre la couleur d'un pixel :
image(10, 10)= make_red();
image(0, 0)= image(10, 10);
Definition at line 38 of file image.h.
40 std::size_t offset= y * m_width + x;
41 assert(offset < m_data.size());
42 return m_data[offset];
Color Image::operator() |
( |
const int |
x, |
|
|
const int |
y |
|
) |
| const |
|
inline |
renvoie la couleur d'un pixel de l'image (image non modifiable).
Definition at line 46 of file image.h.
48 std::size_t offset= y * m_width + x;
49 assert(offset < m_data.size());
50 return m_data[offset];
const void* Image::buffer |
( |
| ) |
const |
|
inline |
renvoie un pointeur sur le stockage des couleurs des pixels.
Definition at line 54 of file image.h.
56 assert(!m_data.empty());
57 return &m_data.front();
int Image::width |
( |
| ) |
const |
|
inline |
renvoie la largeur de l'image.
Definition at line 61 of file image.h.
int Image::height |
( |
| ) |
const |
|
inline |
renvoie la hauteur de l'image.
Definition at line 63 of file image.h.
std::size_t Image::size |
( |
| ) |
const |
|
inline |
renvoie le nombre de pixels de l'image.
Definition at line 65 of file image.h.
65 {
return m_width * m_height; }
static Image& Image::error |
( |
| ) |
|
|
inlinestatic |
sentinelle pour la gestion d'erreur lors du chargement d'un fichier. exemple :
return "erreur de chargement";
Definition at line 75 of file image.h.
representation d'une image.
bool Image::operator== |
( |
const Image & |
im | ) |
const |
|
inline |
comparaison avec la sentinelle.
Definition at line 82 of file image.h.
The documentation for this class was generated from the following file: