summaryrefslogtreecommitdiff
path: root/2003/i/buzz/src/vision/image.cc
diff options
context:
space:
mode:
Diffstat (limited to '2003/i/buzz/src/vision/image.cc')
-rw-r--r--2003/i/buzz/src/vision/image.cc10
1 files changed, 9 insertions, 1 deletions
diff --git a/2003/i/buzz/src/vision/image.cc b/2003/i/buzz/src/vision/image.cc
index 159d5ef..24c6140 100644
--- a/2003/i/buzz/src/vision/image.cc
+++ b/2003/i/buzz/src/vision/image.cc
@@ -74,8 +74,16 @@ Image::Image (const Camera &camera, const Thresholds *thresholds)
// Allocate memory...
camera.getSize (m_width, m_height);
m_image = new unsigned char [m_width * m_height * 3];
+ unsigned char *image = new unsigned char [m_width * m_height];
// Lit l'image.
- camera.read (m_image);
+ camera.read (image);
+ // Décode les couleurs.
+ for (int i = 0; i < m_width * m_height; ++i)
+ {
+ m_image[i * 3] = image[i];
+ m_image[i * 3 + 1] = image[i];
+ m_image[i * 3 + 2] = image[i];
+ }
// Alloue de la memoire pour les zones.
m_zones = new unsigned char [m_width * m_height];
// Initalisation