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

Method mouseMoveEvent

ImagePlay/src/IPHistogramWidget.cpp:185–216  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

183
184
185void IPHistogramWidget::mouseMoveEvent(QMouseEvent* event)
186{
187 _hightlightPosition = event->pos().x();
188 update();
189
190 if(_type == IPL_IMAGE_COLOR)
191 {
192 int valueR = _histogramR->rawValueAt(_hightlightPosition);
193 int valueG = _histogramG->rawValueAt(_hightlightPosition);
194 int valueB = _histogramB->rawValueAt(_hightlightPosition);
195 float percentageR = _histogramR->percentageAt(_hightlightPosition);
196 float percentageG = _histogramG->percentageAt(_hightlightPosition);
197 float percentageB = _histogramB->percentageAt(_hightlightPosition);
198
199 emit highlightChangedColor(_hightlightPosition, valueR, valueG, valueB, percentageR, percentageG, percentageB);
200 }
201 else if(_type == IPL_IMAGE_GRAYSCALE || _type == IPL_IMAGE_ORIENTED )
202 {
203 int value = _histogram->rawValueAt(_hightlightPosition);
204 float percentage = _histogram->percentageAt(_hightlightPosition);
205
206 emit highlightChangedGrayscale(_hightlightPosition, value, percentage);
207 }
208 else if(_type == IPL_IMAGE_BW)
209 {
210 int pos = _hightlightPosition < width()/2 ? 0 : 1;
211 int value = _histogram->rawValueAt(pos);
212 int percentage = _histogram->percentageAt(pos);
213
214 emit highlightChangedGrayscale(pos, value, percentage);
215 }
216}
217
218void IPHistogramWidget::leaveEvent(QEvent *)
219{

Callers

nothing calls this directly

Calls 4

rawValueAtMethod · 0.80
percentageAtMethod · 0.80
widthFunction · 0.50
posMethod · 0.45

Tested by

no test coverage detected