| 183 | |
| 184 | |
| 185 | void 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 | |
| 218 | void IPHistogramWidget::leaveEvent(QEvent *) |
| 219 | { |
nothing calls this directly
no test coverage detected