| #pragma once |
| |
| #ifndef STYLE_PICKER_H |
| #define STYLE_PICKER_H |
| |
| |
| #include "tcommon.h" |
| #include "tpalette.h" |
| |
| class TStroke; |
| class QWidget; |
| |
| #undef DVAPI |
| #undef DVVAR |
| #ifdef TNZTOOLS_EXPORTS |
| #define DVAPI DV_EXPORT_API |
| #define DVVAR DV_EXPORT_VAR |
| #else |
| #define DVAPI DV_IMPORT_API |
| #define DVVAR DV_IMPORT_VAR |
| #endif |
| |
| class DVAPI StylePicker { |
| TImageP m_image; |
| TPaletteP m_palette; |
| const QWidget *m_widget; |
| |
| public: |
| StylePicker(const QWidget *parent) : m_widget(parent) {} |
| |
| |
| StylePicker(const QWidget *parent, const TImageP &image); |
| |
| |
| StylePicker(const QWidget *parent, const TImageP &image, |
| const TPaletteP &palette); |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| int pickStyleId(const TPointD &point, double radius, double scale2, |
| int mode = 2) const; |
| |
| |
| int pickTone(const TPointD &pos) const; |
| |
| |
| |
| TPixel32 pickColor(const TPointD &point, double radius, double scale2) const; |
| TPixel64 pickColor16(const TPointD &point, double radius, |
| double scale2) const; |
| TPixelF pickColor32F(const TPointD &point, double radius, |
| double scale2) const; |
| TPixel32 pickAverageColor(const TRectD &rect) const; |
| TPixel64 pickAverageColor16(const TRectD &rect) const; |
| TPixelF pickAverageColor32F(const TRectD &rect) const; |
| |
| |
| TPixel32 pickColor(const TRectD &area) const; |
| |
| |
| |
| TPixel32 pickColor(TStroke *stroke) const; |
| |
| |
| |
| |
| TPoint getRasterPoint(const TPointD &p) const; |
| }; |
| #endif |