Index: trunk/lib/FlairCore/src/Image.cpp
===================================================================
--- trunk/lib/FlairCore/src/Image.cpp	(revision 338)
+++ trunk/lib/FlairCore/src/Image.cpp	(revision 338)
@@ -0,0 +1,83 @@
+// %flair:license{
+// This file is part of the Flair framework distributed under the
+// CECILL-C License, Version 1.0.
+// %flair:license}
+//  created:    2012/03/20
+//  filename:   Image.cpp
+//
+//  author:     Guillaume Sanahuja
+//              Copyright Heudiasyc UMR UTC/CNRS 7253
+//
+//  version:    $Id: $
+//
+//  purpose:    Class defining an image
+//
+/*********************************************************************/
+
+#include "Image.h"
+
+using std::string;
+
+namespace flair {
+namespace core {
+
+char* (*Image::allocFunction)(ssize_t)=Image::DefaultAllocFunction;
+void (*Image::freeFunction)(char*)=Image::DefaultFreeFunction;
+   
+Image::Image(const Object *parent, uint16_t width, uint16_t height,
+                 Type::Format format, string name, bool allocate_data, int n)
+    : io_data(parent, name, n), dataType(width, height, format) {
+  this->allocate_data = allocate_data;
+
+  if (allocate_data) {
+    switch (format) {
+    case Type::Format::YUYV:
+    case Type::Format::UYVY:
+      buffer=allocFunction(width*height*2);
+      break;
+    case Type::Format::BGR:
+      buffer=allocFunction(width*height*3);
+      break;
+    case Type::Format::Gray:
+      buffer=allocFunction(width*height*1);
+      break;
+    default:
+      Err("format not supported");
+      break;
+    }
+  } else {
+    if (n > 1)
+      Err("number of samples!=1 not possible when not allocating data\n");
+    n = 1;
+  }
+
+  SetPtrToCircle((void **)&buffer);
+
+  if (n > 1)
+    prev = new Image(this, width, height, format, name, n - 1);
+}
+
+Image::~Image() {
+  if(allocate_data) freeFunction(buffer);
+}
+
+void Image::RawRead(char *dst) const { Warn("non implementé\n"); }
+
+void Image::RegisterAllocFunction(char*(*func)(ssize_t size)) {
+  if(allocFunction==DefaultAllocFunction) allocFunction=func;
+}
+
+void Image::RegisterFreeFunction(void(*func)(char* buffer)) {
+  if(freeFunction==DefaultFreeFunction) freeFunction=func;
+}
+
+char* Image::DefaultAllocFunction(ssize_t size){
+  return (char*)malloc(size);
+}
+
+void Image::DefaultFreeFunction(char* buffer){
+  free(buffer);
+}
+
+} // end namespace core
+} // end namespace flair
Index: trunk/lib/FlairCore/src/Image.h
===================================================================
--- trunk/lib/FlairCore/src/Image.h	(revision 338)
+++ trunk/lib/FlairCore/src/Image.h	(revision 338)
@@ -0,0 +1,137 @@
+// %flair:license{
+// This file is part of the Flair framework distributed under the
+// CECILL-C License, Version 1.0.
+// %flair:license}
+/*!
+ * \file Image.h
+ * \brief Class defining an image
+ * \author Guillaume Sanahuja, Copyright Heudiasyc UMR UTC/CNRS 7253
+ * \date 2012/03/20
+ * \version 4.0
+ */
+
+#ifndef IMAGE_H
+#define IMAGE_H
+
+#include <io_data.h>
+#include <stdint.h>
+
+
+namespace flair {
+namespace sensor {
+class V4LCamera;
+}
+}
+
+
+namespace flair {
+namespace core {
+/*! \class Image
+*
+* \brief Class defining an image
+*
+*
+*/
+class Image : public io_data {
+    public:
+  friend class flair::sensor::V4LCamera;
+  class Type : public DataType {
+  public:
+    /*!
+    \enum Format_t
+    \brief Picture formats
+    */
+    enum class Format {
+      YUYV, /*!< YUYV 16 bits */
+      UYVY, /*!< UYVY 16 bits */
+      BGR,  /*!< BGR 24 bits */
+      Gray, /*!< gray 8 bits */
+    };
+    Type(uint16_t _width, uint16_t _height, Format _format)
+        : width(_width), height(_height), format(_format) {}
+
+    size_t GetSize() const {
+      size_t pixelSize;
+      switch (format) {
+      case Format::Gray:
+        pixelSize = 1;
+        break;
+      case Format::YUYV:
+      case Format::UYVY:
+        pixelSize = 2;
+        break;
+      case Format::BGR:
+        pixelSize = 3;
+        break;
+      default:
+        pixelSize = 0; // TODO should throw an exception instead
+      }
+      return pixelSize * width * height;
+    }
+    std::string GetDescription() const { return "cv image"; };
+
+    Format GetFormat() const { return format; };
+    uint16_t GetWidth() const { return width; };
+    uint16_t GetHeight() const { return height; };
+
+  private:
+    uint16_t width;
+    uint16_t height;
+    Format format;
+  };
+
+  /*!
+  * \brief Constructor
+  *
+  * Construct an io_data representing an image.
+  *
+  * \param parent parent
+  * \param width image width
+  * \param height image height
+  * \param name name
+  * \param allocate_data if true, image data is allocated; otherwise
+  *img->imagedata must be changed
+  * \param n number of samples
+  */
+  Image(const Object *parent, uint16_t width, uint16_t height,
+          Type::Format format, std::string name = "", bool allocate_data = true,
+          int n = 1);
+
+  /*!
+  * \brief Destructor
+  *
+  */
+  ~Image();
+
+  
+  char *buffer;
+
+  Type const &GetDataType() const { return dataType; };
+  
+  static void RegisterAllocFunction(char*(*func)(ssize_t size));
+  static void RegisterFreeFunction(void(*func)(char* buffer));
+
+private:
+  /*!
+  * \brief Raw read datas
+  *
+  * Reimplemented from io_data. \n
+  * See io_data::RawRead.
+  *
+  * \param dst destination buffer
+  */
+  void RawRead(char *dst) const;
+
+  bool allocate_data;
+  Type dataType;
+  static char* (*allocFunction)(ssize_t);
+  static void (*freeFunction)(char*);
+  static char* DefaultAllocFunction(ssize_t size);
+  static void DefaultFreeFunction(char* buffer);
+  
+};
+
+} // end namespace core
+} // end namespace flair
+
+#endif // IMAGE_H
Index: trunk/lib/FlairCore/src/Picture.cpp
===================================================================
--- trunk/lib/FlairCore/src/Picture.cpp	(revision 336)
+++ trunk/lib/FlairCore/src/Picture.cpp	(revision 338)
@@ -17,5 +17,5 @@
 
 #include "Picture.h"
-#include "cvimage.h"
+#include "Image.h"
 #include "Layout.h"
 #include "LayoutPosition.h"
@@ -30,5 +30,5 @@
 
 Picture::Picture(const LayoutPosition *position, string name,
-                 const cvimage *image)
+                 const Image *image)
     : SendData(position, name, "Picture", 200) {
   this->image = image;
Index: trunk/lib/FlairCore/src/Picture.h
===================================================================
--- trunk/lib/FlairCore/src/Picture.h	(revision 336)
+++ trunk/lib/FlairCore/src/Picture.h	(revision 338)
@@ -18,5 +18,5 @@
 namespace flair {
 namespace core {
-class cvimage;
+class Image;
 }
 
@@ -45,5 +45,5 @@
   */
   Picture(const LayoutPosition *position, std::string name,
-          const core::cvimage *image);
+          const core::Image *image);
 
   /*!
@@ -70,5 +70,5 @@
   void ExtraXmlEvent(void){};
 
-  const core::cvimage *image;
+  const core::Image *image;
 };
 
Index: trunk/lib/FlairCore/src/cvimage.cpp
===================================================================
--- trunk/lib/FlairCore/src/cvimage.cpp	(revision 336)
+++ 	(revision )
@@ -1,86 +1,0 @@
-// %flair:license{
-// This file is part of the Flair framework distributed under the
-// CECILL-C License, Version 1.0.
-// %flair:license}
-//  created:    2012/03/20
-//  filename:   cvimage.cpp
-//
-//  author:     Guillaume Sanahuja
-//              Copyright Heudiasyc UMR UTC/CNRS 7253
-//
-//  version:    $Id: $
-//
-//  purpose:    Class defining an image of kind IplImage
-//
-/*********************************************************************/
-
-#include "cvimage.h"
-
-using std::string;
-
-namespace flair {
-namespace core {
-
-char* (*cvimage::allocFunction)(ssize_t)=cvimage::DefaultAllocFunction;
-void (*cvimage::freeFunction)(char*)=cvimage::DefaultFreeFunction;
-   
-cvimage::cvimage(const Object *parent, uint16_t width, uint16_t height,
-                 Type::Format format, string name, bool allocate_data, int n)
-    : io_data(parent, name, n), dataType(width, height, format) {
-  this->allocate_data = allocate_data;
-//Printf("cvimage %s\n",ObjectName().c_str());
-  if (allocate_data) {
-    switch (format) {
-    case Type::Format::YUYV:
-    case Type::Format::UYVY:
-      buffer=allocFunction(width*height*2);
-      break;
-    case Type::Format::BGR:
-      buffer=allocFunction(width*height*3);
-      break;
-    case Type::Format::Gray:
-      buffer=allocFunction(width*height*1);
-      break;
-    default:
-      Err("format not supported");
-      break;
-    }
-  } else {
-    if (n > 1)
-      Err("number of samples!=1 not possible when not allocating data\n");
-    n = 1;
-  }
-
-  SetPtrToCircle((void **)&buffer);
-
-  if (n > 1)
-    prev = new cvimage(this, width, height, format, name, n - 1);
-}
-
-cvimage::~cvimage() {
-  // printf("destructeur cvimage\n");
-  if(allocate_data) freeFunction(buffer);
-}
-
-void cvimage::RawRead(char *dst) const { Warn("non implementé\n"); }
-
-void cvimage::RegisterAllocFunction(char*(*func)(ssize_t size)) {
-  if(allocFunction==DefaultAllocFunction) allocFunction=func;
-}
-
-void cvimage::RegisterFreeFunction(void(*func)(char* buffer)) {
-  if(freeFunction==DefaultFreeFunction) freeFunction=func;
-}
-
-char* cvimage::DefaultAllocFunction(ssize_t size){
-  Printf("default alloc %i\n",size);
-  return (char*)malloc(size);
-}
-
-void cvimage::DefaultFreeFunction(char* buffer){
-  Printf("default free\n");
-  free(buffer);
-}
-
-} // end namespace core
-} // end namespace flair
Index: trunk/lib/FlairCore/src/cvimage.h
===================================================================
--- trunk/lib/FlairCore/src/cvimage.h	(revision 336)
+++ 	(revision )
@@ -1,138 +1,0 @@
-// %flair:license{
-// This file is part of the Flair framework distributed under the
-// CECILL-C License, Version 1.0.
-// %flair:license}
-/*!
- * \file cvimage.h
- * \brief Class defining an image of kind IplImage
- * \author Guillaume Sanahuja, Copyright Heudiasyc UMR UTC/CNRS 7253
- * \date 2012/03/20
- * \version 4.0
- */
-
-#ifndef CVIMAGE_H
-#define CVIMAGE_H
-
-#include <io_data.h>
-#include <stdint.h>
-
-
-namespace flair {
-namespace sensor {
-class V4LCamera;
-}
-}
-
-
-namespace flair {
-namespace core {
-/*! \class cvimage
-*
-* \brief Class defining an image of kind IplImage
-*
-* IplImage is an image struct defined in OpenCV.
-*
-*/
-class cvimage : public io_data {
-    public:
-  friend class flair::sensor::V4LCamera;
-  class Type : public DataType {
-  public:
-    /*!
-    \enum Format_t
-    \brief Picture formats
-    */
-    enum class Format {
-      YUYV, /*!< YUYV 16 bits */
-      UYVY, /*!< UYVY 16 bits */
-      BGR,  /*!< BGR 24 bits */
-      Gray, /*!< gray 8 bits */
-    };
-    Type(uint16_t _width, uint16_t _height, Format _format)
-        : width(_width), height(_height), format(_format) {}
-
-    size_t GetSize() const {
-      size_t pixelSize;
-      switch (format) {
-      case Format::Gray:
-        pixelSize = 1;
-        break;
-      case Format::YUYV:
-      case Format::UYVY:
-        pixelSize = 2;
-        break;
-      case Format::BGR:
-        pixelSize = 3;
-        break;
-      default:
-        pixelSize = 0; // TODO should throw an exception instead
-      }
-      return pixelSize * width * height;
-    }
-    std::string GetDescription() const { return "cv image"; };
-
-    Format GetFormat() const { return format; };
-    uint16_t GetWidth() const { return width; };
-    uint16_t GetHeight() const { return height; };
-
-  private:
-    uint16_t width;
-    uint16_t height;
-    Format format;
-  };
-
-  /*!
-  * \brief Constructor
-  *
-  * Construct an io_data representing an IplImage.
-  *
-  * \param parent parent
-  * \param width image width
-  * \param height image height
-  * \param name name
-  * \param allocate_data if true, IplImage image data is allocated; otherwise
-  *img->imagedata must be changed
-  * \param n number of samples
-  */
-  cvimage(const Object *parent, uint16_t width, uint16_t height,
-          Type::Format format, std::string name = "", bool allocate_data = true,
-          int n = 1);
-
-  /*!
-  * \brief Destructor
-  *
-  */
-  ~cvimage();
-
-  
-  char *buffer;
-
-  Type const &GetDataType() const { return dataType; };
-  
-  static void RegisterAllocFunction(char*(*func)(ssize_t size));
-  static void RegisterFreeFunction(void(*func)(char* buffer));
-
-private:
-  /*!
-  * \brief Raw read datas
-  *
-  * Reimplemented from io_data. \n
-  * See io_data::RawRead.
-  *
-  * \param dst destination buffer
-  */
-  void RawRead(char *dst) const;
-
-  bool allocate_data;
-  Type dataType;
-  static char* (*allocFunction)(ssize_t);
-  static void (*freeFunction)(char*);
-  static char* DefaultAllocFunction(ssize_t size);
-  static void DefaultFreeFunction(char* buffer);
-  
-};
-
-} // end namespace core
-} // end namespace flair
-
-#endif // CVIMAGE_H
