27 image =
new QImage(1, 1, QImage::Format_RGB16);
29 connect(camera, SIGNAL(
imageReceived(
const sensor_msgs::Image::ConstPtr&)),
this, SLOT(
imageReceived(
const sensor_msgs::Image::ConstPtr&)));
35 if (!
imageInit) {
image =
new QImage(msg->width, msg->height, QImage::Format_RGB16);}
38 for(
int i = 0; i <
image->width(); i++)
40 for(
int j = 0; j <
image->height(); j++)
42 image->setPixel(i, j, qRgb(msg->data[j * msg->width + i+2],msg->data[j * msg->width + i+1],msg->data[j * msg->width + i]));
51 QWidget::paintEvent(pe);
58 painter.drawImage(QRect(0,0, this->width(), this->height()), *
image);
63 QWidget::resizeEvent(event);