17 #ifndef CANVASPAINTER_H
18 #define CANVASPAINTER_H
25 #include "pencildef.h"
35 bool bPrevOnionSkin =
false;
36 bool bNextOnionSkin =
false;
37 int nPrevOnionSkinCount = 3;
38 int nNextOnionSkinCount = 3;
39 float fOnionSkinMaxOpacity = 0.5f;
40 float fOnionSkinMinOpacity = 0.1f;
41 bool bColorizePrevOnion =
false;
42 bool bColorizeNextOnion =
false;
43 bool bAntiAlias =
false;
49 bool bGoldenRatio =
false;
50 bool bActionSafe =
true;
52 bool bSafeArea =
false;
53 bool bTitleSafe =
true;
55 bool bShowSafeAreaHelperText =
true;
57 bool bThinLines =
false;
58 bool bOutlines =
false;
59 bool bIsOnionAbsolute =
false;
60 LayerVisibility eLayerVisibility = LayerVisibility::RELATED;
61 float fLayerVisibilityThreshold = 0.f;
63 bool isPlaying =
false;
64 bool onionWhilePlayback =
false;
74 void setCanvas(
QPixmap* canvas);
78 void ignoreTransformedSelection();
79 QRect getCameraRect();
85 void renderOverlays(
QPainter& painter);
86 void resetLayerCache();
98 void renderPreLayers(
QPainter& painter);
99 void renderCurLayer(
QPainter& painter);
100 void renderPostLayers(
QPainter& painter);
102 void paintBackground();
103 void paintOnionSkin(
QPainter& painter);
105 void renderPostLayers(
QPixmap* pixmap);
106 void renderCurLayer(
QPixmap* pixmap);
107 void renderPreLayers(
QPixmap* pixmap);
111 void paintBitmapFrame(
QPainter&,
Layer* layer,
int nFrame,
bool colorize,
bool useLastKeyFrame,
bool isCurrentFrame);
112 void paintVectorFrame(
QPainter&,
Layer* layer,
int nFrame,
bool colorize,
bool useLastKeyFrame,
bool isCurrentFrame);
114 void paintTransformedSelection(
QPainter& painter);
116 void paintOverlayCenter(
QPainter& painter);
117 void paintOverlayThirds(
QPainter& painter);
118 void paintOverlayGolden(
QPainter& painter);
119 void paintOverlaySafeAreas(
QPainter& painter);
120 void paintCameraBorder(
QPainter& painter);
130 const Object* mObject =
nullptr;
137 int mCurrentLayerIndex = 0;
138 int mFrameNumber = 0;
143 bool bMultiLayerOnionSkin =
false;
146 bool mRenderTransform =
false;
151 std::unique_ptr<QPixmap> mPreLayersCache, mPostLayersCache;
153 const static int OVERLAY_SAFE_CENTER_CROSS_SIZE = 25;
156 #endif // CANVASRENDERER_H
void paintCurrentFrame(QPainter &painter, int startLayer, int endLayer)
Paints layers within the specified range for the current frame.
void initializePainter(QPainter &painter, QPixmap &pixmap)
CanvasPainter::initializePainter Enriches the painter with a context and sets it's initial matrix...
qreal calculateRelativeOpacityForLayer(int layerIndex) const
Calculate layer opacity based on current layer offset.