16 "implementation_id",
"CameraImageViewer",
17 "type_name",
"CameraImageViewer",
18 "description",
"camera image viewer component",
19 "version", HRPSYS_PACKAGE_VERSION,
21 "category",
"example",
22 "activity_type",
"DataFlowComponent",
25 "lang_type",
"compile",
27 "conf.default.depthBits",
"11",
36 m_imageIn(
"imageIn", m_image),
37 m_imageOldIn(
"imageOldIn", m_imageOld),
52 std::cout <<
m_profile.instance_name <<
": onInitialize()" << std::endl;
105 std::cout <<
m_profile.instance_name<<
": onActivated(" << ec_id <<
")" << std::endl;
106 cvNamedWindow(
"Image",CV_WINDOW_AUTOSIZE);
112 std::cout <<
m_profile.instance_name<<
": onDeactivated(" << ec_id <<
")" << std::endl;
117 cvDestroyWindow(
"Image");
135 switch (
m_image.data.image.format){
148 std::cerr <<
"unsupported color format(" 149 <<
m_image.data.image.format <<
")" << std::endl;
150 return RTC::RTC_ERROR;
153 switch(
m_image.data.image.format){
157 unsigned char *src =
m_image.data.image.raw_data.get_buffer();
172 m_image.data.image.raw_data.get_buffer(),
173 m_image.data.image.raw_data.length());
179 Img::ImageData &
id =
m_image.data.image;
180 unsigned short *src = (
unsigned short *)
id.raw_data.get_buffer();
182 for (
unsigned int i=0;
i<
id.width*
id.height;
i++){
183 dst[
i] = 0xff - src[
i]>>shift;
208 IPL_DEPTH_8U, bytes);
279 RTC::Create<CameraImageViewer>,
280 RTC::Delete<CameraImageViewer>);
ComponentProfile m_profile
png_infop png_charpp int png_charpp profile
InPort< Img::TimedCameraImage > m_imageIn
virtual RTC::ReturnCode_t onActivated(RTC::UniqueId ec_id)
virtual RTC::ReturnCode_t onDeactivated(RTC::UniqueId ec_id)
virtual ~CameraImageViewer()
Destructor.
void CameraImageViewerInit(RTC::Manager *manager)
static const char * cameraimageviewercomponent_spec[]
virtual RTC::ReturnCode_t onExecute(RTC::UniqueId ec_id)
coil::Properties & getProperties()
Img::TimedCameraImage m_image
ExecutionContextHandle_t UniqueId
InPort< CameraImage > m_imageOldIn
bool bindParameter(const char *param_name, VarType &var, const char *def_val, bool(*trans)(VarType &, const char *)=coil::stringTo)
def j(str, encoding="cp932")
CameraImageViewer(RTC::Manager *manager)
Constructor.
virtual RTC::ReturnCode_t onInitialize()
bool addInPort(const char *name, InPortBase &inport)
bool registerFactory(coil::Properties &profile, RtcNewFunc new_func, RtcDeleteFunc delete_func)