29 lines
787 B
C++
29 lines
787 B
C++
#ifndef MAIN_COLOUR_EXTRACTOR_H_
|
|
#define MAIN_COLOUR_EXTRACTOR_H_
|
|
|
|
#include "colour_extractor.h"
|
|
|
|
class MainColourExtractor : public ColourExtractor
|
|
{
|
|
private:
|
|
// The minimum lightness a colour needs to have to be considered for
|
|
// evaluation
|
|
double m_lightness_threshold;
|
|
|
|
// Calculates the lightness of a colour
|
|
double calculate_lightness(struct ColourHSV hsv) const;
|
|
|
|
protected:
|
|
// Implemented - Evaluates the given colour based on its weight
|
|
virtual size_t evaluate_colour(struct ColourHSV hsv, double weight) const;
|
|
|
|
public:
|
|
MainColourExtractor(double lightness_threshold = 0.2, size_t h_levels = 36,
|
|
size_t s_levels = 10, size_t v_levels = 10);
|
|
|
|
double get_lightness_threshold() const;
|
|
void set_lightness_threshold(double value);
|
|
};
|
|
|
|
#endif // MAIN_COLOUR_EXTRACTOR_H_
|