17 "implementation_id",
"ResizeImage",
18 "type_name",
"ResizeImage",
19 "description",
"resize image component",
20 "version", HRPSYS_PACKAGE_VERSION,
22 "category",
"example",
23 "activity_type",
"DataFlowComponent",
26 "lang_type",
"compile",
28 "conf.default.scale",
"1.0",
37 m_originalIn(
"original", m_original),
38 m_resizedOut(
"resized", m_resized),
40 m_scale(1.0), m_src(NULL), m_dst(NULL),
56 std::cout <<
m_profile.instance_name <<
": onInitialize()" << std::endl;
109 std::cout <<
m_profile.instance_name<<
": onActivated(" << ec_id <<
")" << std::endl;
115 std::cout <<
m_profile.instance_name<<
": onDeactivated(" << ec_id <<
")" << std::endl;
127 int nchannels = idat.format == Img::CF_GRAY ? 1 : 3;
131 ||
m_src->height != idat.height)){
132 cvReleaseImage(&
m_src);
133 cvReleaseImage(&
m_dst);
137 m_src = cvCreateImage(cvSize(idat.width, idat.height),
138 IPL_DEPTH_8U, nchannels);
139 m_dst = cvCreateImage(cvSize(w,h), IPL_DEPTH_8U, nchannels);
142 m_resized.data.image.format = idat.format;
143 m_resized.data.image.raw_data.length(w*h*nchannels);
146 memcpy(
m_src->imageData, idat.raw_data.get_buffer(),
147 idat.raw_data.length());
151 memcpy(
m_resized.data.image.raw_data.get_buffer(),
203 RTC::Create<ResizeImage>,
204 RTC::Delete<ResizeImage>);
ComponentProfile m_profile
png_infop png_charpp int png_charpp profile
Img::TimedCameraImage m_resized
void ResizeImageInit(RTC::Manager *manager)
ResizeImage(RTC::Manager *manager)
Constructor.
bool addOutPort(const char *name, OutPortBase &outport)
virtual RTC::ReturnCode_t onActivated(RTC::UniqueId ec_id)
virtual RTC::ReturnCode_t onDeactivated(RTC::UniqueId ec_id)
InPort< Img::TimedCameraImage > m_originalIn
ExecutionContextHandle_t UniqueId
bool bindParameter(const char *param_name, VarType &var, const char *def_val, bool(*trans)(VarType &, const char *)=coil::stringTo)
virtual ~ResizeImage()
Destructor.
OutPort< Img::TimedCameraImage > m_resizedOut
virtual RTC::ReturnCode_t onInitialize()
virtual bool write(DataType &value)
static const char * jpegdecoder_spec[]
virtual RTC::ReturnCode_t onExecute(RTC::UniqueId ec_id)
Img::TimedCameraImage m_original
bool addInPort(const char *name, InPortBase &inport)
bool registerFactory(coil::Properties &profile, RtcNewFunc new_func, RtcDeleteFunc delete_func)