Make imageStats virtual method so it can be called from abstract class
This commit is contained in:
+6
-4
@@ -9,6 +9,8 @@
|
||||
|
||||
class RawImageAbs
|
||||
{
|
||||
public:
|
||||
virtual bool imageStats(uint64_t *mean, double *stdDev, uint64_t *median, uint64_t *min, uint64_t *max) const = 0;
|
||||
};
|
||||
|
||||
template<typename T>
|
||||
@@ -59,8 +61,8 @@ public:
|
||||
m_width = w;
|
||||
m_height = h;
|
||||
img.resize(w*h);
|
||||
img.clear();
|
||||
m_img = std::move(img);
|
||||
img.clear();
|
||||
}
|
||||
T* data()
|
||||
{
|
||||
@@ -70,14 +72,14 @@ public:
|
||||
{
|
||||
return m_img;
|
||||
}
|
||||
bool imageStats(T *mean, double *stdDev, T *median, T *min, T *max) const
|
||||
bool imageStats(uint64_t *mean, double *stdDev, uint64_t *median, uint64_t *min, uint64_t *max) const
|
||||
{
|
||||
if(m_img.size()==0)return false;
|
||||
|
||||
uint64_t sum = 0;
|
||||
uint64_t sqrSum = 0;
|
||||
T tMin = UINT64_MAX;
|
||||
T tMax = 0;
|
||||
uint64_t tMin = UINT64_MAX;
|
||||
uint64_t tMax = 0;
|
||||
|
||||
for(T i : m_img)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user