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

Method updateHistogram

ImagePlay/src/IPHistogramWidget.cpp:41–75  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

39}
40
41void IPHistogramWidget::updateHistogram(IPLImage *image)
42{
43 if(!image)
44 {
45 _type = IPL_UNDEFINED;
46 update();
47 return;
48 }
49
50 // only update if the panel is not hidden
51 if(isVisible())
52 {
53 _type = image->type();
54
55 QElapsedTimer timer;
56 timer.start();
57 if(_type == IPL_IMAGE_BW)
58 {
59 _histogram.reset(new IPLHistogram(image->plane(0), 2, 100));
60 }
61 else if(_type == IPL_IMAGE_GRAYSCALE || _type == IPL_IMAGE_ORIENTED )
62 {
63 _histogram.reset(new IPLHistogram(image->plane(0), 256, 100));
64 }
65 else if(_type == IPL_IMAGE_COLOR)
66 {
67 _histogramR.reset(new IPLHistogram(image->plane(0), 256, 100));
68 _histogramG.reset(new IPLHistogram(image->plane(1), 256, 100));
69 _histogramB.reset(new IPLHistogram(image->plane(2), 256, 100));
70 }
71
72 // repaint
73 update();
74 }
75}
76
77void IPHistogramWidget::setLogarithmic(bool logarithmic)
78{

Callers 1

updateImageMethod · 0.45

Calls 4

startMethod · 0.80
planeMethod · 0.80
typeMethod · 0.45
resetMethod · 0.45

Tested by

no test coverage detected