00001
00002
00003
00004
00005
00006
00007 #ifndef COLOR_FILTER_HISTOGRAM_H
00008 #define COLOR_FILTER_HISTOGRAM_H
00009
00010 #include <QRgb>
00011
00012 class ColorFilter;
00013 class QColor;
00014 class QImage;
00015
00017 class ColorFilterHistogram
00018 {
00019 public:
00021 ColorFilterHistogram();
00022
00024 int binFromPixel (const ColorFilter &filter,
00025 ColorFilterMode colorFilterMode,
00026 const QColor &pixel,
00027 const QRgb &rgbBackground) const;
00028
00032 void generate (const ColorFilter &filter,
00033 double histogramBins [],
00034 ColorFilterMode colorFilterMode,
00035 const QImage &image,
00036 int &maxBinCount) const;
00037
00039 static int HISTOGRAM_BINS () { return 100; }
00040
00042 int valueFromBin (const ColorFilter &filter,
00043 ColorFilterMode colorFilterMode,
00044 int bin);
00045
00046 private:
00047
00048 static int FIRST_NON_EMPTY_BIN_AT_START () { return 1; }
00049 static int LAST_NON_EMPTY_BIN_AT_END () { return ColorFilterHistogram::HISTOGRAM_BINS () - 2; }
00050 };
00051
00052 #endif // COLOR_FILTER_HISTOGRAM_H