| #pragma once |
| |
| #ifndef RGBPICKERTOOL_H |
| #define RGBPICKERTOOL_H |
| |
| #include "tools/tool.h" |
| #include "tproperty.h" |
| #include "toonz/strokegenerator.h" |
| #include "tools/tooloptions.h" |
| |
| #include <QCoreApplication> |
| |
| class RGBPickerTool : public TTool |
| { |
| Q_DECLARE_TR_FUNCTIONS(RGBPickerTool) |
| |
| bool m_firstTime; |
| int m_currentStyleId; |
| TPixel32 m_oldValue, m_currentValue; |
| |
| TRectD m_selectingRect; |
| TRectD m_drawingRect; |
| TPropertyGroup m_prop; |
| TEnumProperty m_pickType; |
| |
| TBoolProperty m_passivePick; |
| std::vector<RGBPickerToolOptionsBox *> m_toolOptionsBox; |
| |
| |
| StrokeGenerator m_drawingTrack; |
| StrokeGenerator m_workingTrack; |
| TPointD m_firstDrawingPos, m_firstWorkingPos; |
| TPointD m_mousePosition; |
| double m_thick; |
| TStroke *m_stroke; |
| TStroke *m_firstStroke; |
| std::vector<TPointD> m_drawingPolyline; |
| std::vector<TPointD> m_workingPolyline; |
| bool m_makePick; |
| |
| public: |
| RGBPickerTool(); |
| |
| |
| void setToolOptionsBox(RGBPickerToolOptionsBox *toolOptionsBox); |
| |
| ToolType getToolType() const { return TTool::LevelReadTool; } |
| |
| void updateTranslation(); |
| |
| |
| |
| |
| |
| |
| void onImageChanged(); |
| |
| void draw(); |
| |
| void leftButtonDown(const TPointD &pos, const TMouseEvent &e); |
| |
| void leftButtonDrag(const TPointD &pos, const TMouseEvent &e); |
| |
| void leftButtonUp(const TPointD &pos, const TMouseEvent &); |
| |
| void leftButtonDoubleClick(const TPointD &pos, const TMouseEvent &e); |
| |
| void mouseMove(const TPointD &pos, const TMouseEvent &e); |
| |
| void pick(TPoint pos); |
| |
| void pickRect(); |
| |
| void pickStroke(); |
| |
| bool onPropertyChanged(std::string propertyName); |
| |
| void onActivate(); |
| |
| TPropertyGroup *getProperties(int targetType); |
| |
| int getCursorId() const; |
| |
| void doPolylinePick(); |
| |
| |
| void startFreehand(const TPointD &drawingPos, const TPointD &workingPos); |
| |
| |
| void freehandDrag(const TPointD &drawingPos, const TPointD &workingPos); |
| |
| |
| void closeFreehand(); |
| |
| |
| void addPointPolyline(const TPointD &drawingPos, const TPointD &workingPos); |
| |
| |
| void closePolyline(const TPointD &drawingPos, const TPointD &workingPos); |
| |
| |
| void showFlipPickedColor(const TPixel32 &pix); |
| }; |
| |
| #endif |