30#include <QPixmapCache>
34#include "bitmapimage.h"
35#include "canvaspainter.h"
36#include "overlaypainter.h"
37#include "preferencemanager.h"
38#include "selectionpainter.h"
39#include "camerapainter.h"
40#include "tiledbuffer.h"
63 void setEditor(
Editor* e) { mEditor = e; }
64 Editor* editor()
const {
return mEditor; }
66 void deleteSelection();
68 void applyTransformedSelection();
69 void cancelTransformedSelection();
71 void setEffect(SETTING e,
bool isOn);
73 LayerVisibility getLayerVisibility()
const {
return mLayerVisibility; }
74 qreal getCurveSmoothing()
const {
return mCurveSmoothingLevel; }
75 bool makeInvisible()
const {
return mMakeInvisible; }
116 void flipSelection(
bool flipVertical);
120 bool isMouseInUse()
const {
return mMouseInUse; }
121 bool isTabletInUse()
const {
return mTabletInUse; }
122 bool isPointerInUse()
const {
return mMouseInUse || mTabletInUse; }
125 void keyEventForSelection(
QKeyEvent* event);
128 void multiLayerOnionSkinChanged(
bool);
129 void selectionUpdated();
133 void setCurveSmoothing(
int);
134 void toggleThinLines();
135 void increaseLayerVisibilityIndex();
136 void decreaseLayerVisibilityIndex();
137 void setLayerVisibility(LayerVisibility visibility);
139 void updateToolCursor();
140 void paletteColorChanged(
QColor);
142 void showLayerNotVisibleWarning();
147 bool event(
QEvent *event)
override;
155 void keyReleaseEvent(
QKeyEvent*)
override;
162 void drawPen(
QPointF thePoint, qreal brushWidth,
QColor fillColor,
bool useAA =
true);
163 void drawPencil(
QPointF thePoint, qreal brushWidth, qreal fixedBrushFeather,
QColor fillColor, qreal opacity);
165 void blurBrush(
BitmapImage *bmiSource_,
QPointF srcPoint_,
QPointF thePoint_, qreal brushWidth_, qreal offset_, qreal opacity_);
166 void liquifyBrush(
BitmapImage *bmiSource_,
QPointF srcPoint_,
QPointF thePoint_, qreal brushWidth_, qreal offset_, qreal opacity_);
168 void paintBitmapBuffer();
169 void clearDrawingBuffer();
170 void setGaussianGradient(
QGradient &gradient,
QColor color, qreal opacity, qreal offset);
202 void prepOverlays(
int frame);
203 void prepCameraPainter(
int frame);
204 void prepCanvas(
int frame);
206 void settingUpdated(SETTING setting);
207 void paintSelectionVisuals(
QPainter &painter);
212 Editor* mEditor =
nullptr;
214 LayerVisibility mLayerVisibility = LayerVisibility::ALL;
215 bool mMakeInvisible =
false;
216 qreal mCurveSmoothingLevel = 0.0;
217 int mDeltaFactor = 1;
226 void tabletReleaseEventFired();
227 bool mMouseInUse =
false;
228 bool mTabletInUse =
false;
229 qreal mDevicePixelRatio = 1.;
232 void handleDoubleClick();
233 bool mIsFirstClick =
true;
234 int mDoubleClickMillis = 0;
236 const int DOUBLE_CLICK_THRESHOLD = 500;
237 QTimer* mDoubleClickTimer =
nullptr;
239 int mTabletReleaseMillisAgo;
240 const int MOUSE_FILTER_THRESHOLD = 200;
242 QTimer* mMouseFilterTimer =
nullptr;
void onScrubbed(int frameNumber)
Frame scrubbed, invalidate relevant cache.
void onViewChanged()
View updated, invalidate relevant cache.
void onObjectLoaded()
Object updated, invalidate all cache.
void invalidateCacheForDirtyFrames()
invalidate cache for dirty keyframes.
void updateFrame()
Update frame.
void handleDrawingOnEmptyFrame()
Call this when starting to use a paint tool.
void invalidatePainterCaches()
Invalidate the layer pixmap and camera painter caches.
void invalidateOnionSkinsCacheAround(int frame)
invalidate onion skin cache around frame
void onSelectionChanged()
Selection was changed, keep cache.
void onOnionSkinTypeChanged()
Onion skin type changed, all frames will be affected.
void onFramesModified()
Multiple frames modified, invalidate cache for affected frames.
void onToolChanged(ToolType)
Tool changed, invalidate cache and frame if needed.
void onPlayStateChanged()
Playstate changed, invalidate relevant cache.
void invalidateAllCache()
Invalidate all cache.
void invalidateCacheForFrame(int frameNumber)
Invalidate cache for the given frame.
void onLayerChanged()
Layer changed, invalidate relevant cache.
void onFrameModified(int frameNumber)
Frame modified, invalidate cache for frame if any.
QObject * parent() const const