Sum all channels histograms
This commit is contained in:
+1
-2
@@ -13,7 +13,7 @@ void Histogram::imageLoaded(Image *img)
|
|||||||
{
|
{
|
||||||
if(img && img->rawImage())
|
if(img && img->rawImage())
|
||||||
{
|
{
|
||||||
m_histogram = img->rawImage()->imageStats().m_histogram[0];
|
m_histogram = img->rawImage()->imageStats().m_histogram;
|
||||||
m_points.clear();
|
m_points.clear();
|
||||||
update();
|
update();
|
||||||
}
|
}
|
||||||
@@ -29,7 +29,6 @@ void Histogram::paintEvent(QPaintEvent *)
|
|||||||
|
|
||||||
if(m_histogram.size())
|
if(m_histogram.size())
|
||||||
{
|
{
|
||||||
|
|
||||||
if(m_points.size() != w)
|
if(m_points.size() != w)
|
||||||
{
|
{
|
||||||
m_points.clear();
|
m_points.clear();
|
||||||
|
|||||||
+4
-2
@@ -198,8 +198,10 @@ void calcStats(const T *data, size_t n, RawImage::Stats &stats)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
for(size_t i = 0; i < ch; i++)
|
stats.m_histogram.resize(histSize, 0);
|
||||||
stats.m_histogram[i] = std::vector<uint32_t>(histogram[i], histogram[i] + histSize);
|
for(size_t i = 0; i < histSize; i++)
|
||||||
|
for(size_t o = 0; o < ch; o++)
|
||||||
|
stats.m_histogram[i] += histogram[o][i];
|
||||||
}
|
}
|
||||||
|
|
||||||
void RawImage::calcStats()
|
void RawImage::calcStats()
|
||||||
|
|||||||
+1
-1
@@ -57,7 +57,7 @@ public:
|
|||||||
double m_max[4] = {0.0};
|
double m_max[4] = {0.0};
|
||||||
double m_mad[4] = {0.0};
|
double m_mad[4] = {0.0};
|
||||||
uint32_t m_saturated[4] = {0};
|
uint32_t m_saturated[4] = {0};
|
||||||
std::vector<uint32_t> m_histogram[4];
|
std::vector<uint32_t> m_histogram;
|
||||||
};
|
};
|
||||||
protected:
|
protected:
|
||||||
std::unique_ptr<PixelType[]> m_pixels;
|
std::unique_ptr<PixelType[]> m_pixels;
|
||||||
|
|||||||
Reference in New Issue
Block a user