1 /***************************************************************************
2 * Copyright (C) 2010 by Simon Andreas Eugster (simon.eu@gmail.com) *
3 * This file is part of kdenlive. See www.kdenlive.org. *
5 * This program is free software; you can redistribute it and/or modify *
6 * it under the terms of the GNU General Public License as published by *
7 * the Free Software Foundation; either version 2 of the License, or *
8 * (at your option) any later version. *
9 ***************************************************************************/
11 #ifndef HISTOGRAMGENERATOR_H
12 #define HISTOGRAMGENERATOR_H
22 class HistogramGenerator : public QObject
28 Calculates a histogram display from the input image.
29 components are OR-ed HistogramGenerator::Components flags and decide with components (Y, R, G, B) to paint.
30 unscaled = true leaves the width at 256 if the widget is wider (to avoid scaling). */
31 QImage calculateHistogram(const QSize ¶deSize, const QImage &image, const int &components, const bool &unscaled,
32 const uint &accelFactor = 1) const;
34 QImage drawComponent(const int *y, const QSize &size, const float &scaling, const QColor &color, const bool &unscaled) const;
36 void drawComponentFull(QPainter *davinci, const int *y, const float &scaling, const QRect &rect,
37 const QColor &color, const int &textSpace, const bool &unscaled) const;
39 enum Components { ComponentY = 1<<0, ComponentR = 1<<1, ComponentG = 1<<2, ComponentB = 1<<3 };
43 #endif // HISTOGRAMGENERATOR_H