]> git.sesse.net Git - kdenlive/blobdiff - src/colorpickerwidget.h
Make jog shuttle buttons work, based on patch from P. Fleury,
[kdenlive] / src / colorpickerwidget.h
index ffdda863dbe98e33e8ce3e48bdde49d0c7f694c9..7a6e874300927e302f5b70fdabe123c99756c110 100644 (file)
@@ -24,7 +24,9 @@
 #include <QtCore>
 #include <QWidget>
 
+class QSpinBox;
 #ifdef Q_WS_X11
+#include <X11/Xlib.h>
 class KCDPickerFilter;
 #endif
 
@@ -33,7 +35,7 @@ class KCDPickerFilter;
  * @brief A widget to pick a color anywhere on the screen.
  * @author Till Theato
  *
- * The code is based on the color picker in KColorDialog. 
+ * The code is partially based on the color picker in KColorDialog. 
  */
 
 class ColorPickerWidget : public QWidget
@@ -54,9 +56,23 @@ protected:
 private:
     /** @brief Closes the event filter and makes mouse and keyboard work again on other widgets/windows. */
     void closeEventFilter();
+
+    /** @brief Calculates the average color for a rect around @param pos with m_size->value() as width. */
+    QColor averagePickedColor(const QPoint pos);
+
+    /** @brief Color of the screen at point @param p.
+    * @param p Position of color requested
+    * @param destroyImage (optional) Whether or not to keep the XImage in m_image
+                          (needed for fast processing of rects) */
+    QColor grabColor(const QPoint &p, bool destroyImage = true);
+
     bool m_filterActive;
+    QSpinBox *m_size;
 #ifdef Q_WS_X11
+    XImage *m_image;
     KCDPickerFilter *m_filter;
+#else
+    QImage m_image;
 #endif 
 
 private slots:
@@ -65,6 +81,7 @@ private slots:
 
 signals:
     void colorPicked(QColor);
+    void displayMessage(const QString&, int);
 };
 
 #endif