MCPcopy Create free account
hub / github.com/cpvrlab/ImagePlay / updateImage

Method updateImage

ImagePlay/src/IPImageViewer.cpp:82–222  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

80}
81
82void IPImageViewer::updateImage()
83{
84 if(_processStep && _processStep->process() && _processStep->process()->isResultReady())
85 {
86 // delete last image
87 delete _image;
88 _image = NULL;
89
90 _rawData = NULL;
91 _rawImage = NULL;
92
93 // convert from IPLImage
94 _rawData = _processStep->process()->getResultData(_resultIndex);
95
96 // if the result is invalid, abort
97 if(!_rawData)
98 {
99 setVisible(false);
100 _imageViewerWindow->updateHistogram(NULL);
101 _imageViewerWindow->updateStatistics(NULL);
102 _imageViewerWindow->updateZoomwidget(NULL);
103 return;
104 }
105 else
106 {
107 setVisible(true);
108 }
109
110 if(_rawData->type() == IPL_IMAGE_COLOR
111 || _rawData->type() == IPL_IMAGE_GRAYSCALE
112 || _rawData->type() == IPL_IMAGE_BW
113 || _rawData->type() == IPL_IMAGE_ORIENTED
114 )
115 {
116 _rawImage = _rawData->toImage();
117
118 // show normal image
119 _image = new QImage(_rawImage->rgb32(), _rawImage->width(), _rawImage->height(), QImage::Format_RGB32);
120 }
121 else if(_rawData->type() == IPL_IMAGE_COMPLEX)
122 {
123 _rawComplexImage = _rawData->toComplexImage();
124
125 // show complex image
126 _image = new QImage(_rawComplexImage->rgb32(), _rawComplexImage->width(), _rawComplexImage->height(), QImage::Format_RGB32);
127 }
128 else if(_rawData->type() == IPL_POINT)
129 {
130 // show point
131 _rawData = _processStep->process()->getResultData(0);
132 _image = new QImage(_rawData->toImage()->rgb32(), _rawData->toImage()->width(), _rawData->toImage()->height(), QImage::Format_RGB32);
133
134 QPainter painter(_image);
135 painter.setRenderHint(QPainter::Antialiasing, true);
136
137 IPLPoint* p = _processStep->process()->getResultData(1)->toPoint();
138
139 QPoint point;

Callers 2

propagateResultReadyMethod · 0.45
executeMethod · 0.45

Calls 15

updateStatisticsMethod · 0.80
updateZoomwidgetMethod · 0.80
toImageMethod · 0.80
widthMethod · 0.80
heightMethod · 0.80
toComplexImageMethod · 0.80
toPointMethod · 0.80
toMatrixMethod · 0.80
processMethod · 0.45
getResultDataMethod · 0.45
updateHistogramMethod · 0.45
typeMethod · 0.45

Tested by

no test coverage detected