Go to the documentation of this file.00001 #pragma once
00002
00003 #include <rtm/idl/BasicDataTypeSkel.h>
00004
00005 #include "std_hdr.h"
00006 #include "cv.h"
00007 #include "highgui.h"
00008
00009 #define MAX_BRIGHTNESS 255
00010
00011 using namespace RTC;
00012
00018 class ImageData
00019 {
00020 public:
00021 ImageData(void);
00022 ~ImageData(void);
00023 ImageData(const ImageData& src);
00024
00025
00026 public:
00027 void CreateImage(const unsigned long width, const unsigned long height);
00028 void Clear(unsigned char value = MAX_BRIGHTNESS);
00029 void DeleteImage();
00030 ImageData PyrDown();
00031 void SetData(TimedOctetSeq orgData);
00032 void SetData(IplImage *cvImage);
00033 int LoadImage(std::string fileName, int flags = CV_LOAD_IMAGE_ANYCOLOR);
00034
00039 unsigned long GetWidth() { return m_width; }
00040
00045 unsigned long GetHeight() { return m_height; }
00046
00047
00048 public:
00049 #ifdef WIN32
00050
00053 unsigned char &operator[](size_t index) { return m_image[index]; }
00054 #endif
00055
00059 unsigned char &operator[](int index) { return m_image[index]; }
00060
00066 unsigned char &operator()(size_t x, size_t y) { return m_image[x + y * m_width]; }
00067
00071 operator unsigned char*() { return m_image; }
00072
00076 ImageData& operator=(const ImageData& org);
00077
00078 private:
00079 unsigned long m_width;
00080 unsigned long m_height;
00081 unsigned char *m_image;
00082 IplImage *m_cvImage;
00083 IplImage *m_cvSimImage;
00084 };