Krita Source Code Documentation
Loading...
Searching...
No Matches
KisPresetLivePreviewView Class Reference

#include <kis_preset_live_preview_view.h>

+ Inheritance diagram for KisPresetLivePreviewView:

Public Member Functions

 KisPresetLivePreviewView (QWidget *parent)
 
void requestUpdateStroke ()
 
void setCurrentPreset (KisPaintOpPresetSP preset)
 set the current preset from resource manager for the live preview to use. Good to call this every stroke update in case the preset has changed
 
void setup (KoCanvasResourceProvider *resourceManager)
 one time setup for initialization of many variables. This live preview might be in a UI file, so make sure to call this before starting to use it
 
 ~KisPresetLivePreviewView ()
 

Private Slots

void slotPreviewGenerationCompleted ()
 
void updateStroke ()
 

Private Member Functions

void changeEvent (QEvent *) override
 
void paintBackground ()
 works as both clearing the previous stroke, providing striped backgrounds for smudging brushes, and text if there is no preview
 
void setupAndPaintStroke ()
 creates and performs the actual stroke that goes on top of the background this is internally and should always be called after the paintBackground()
 

Private Attributes

QGraphicsScene * m_brushPreviewScene {nullptr}
 the scene that can add items like text and the brush stroke image
 
QPointF m_canvasCenterPoint
 
QRect m_canvasSize
 
const KoColorSpacem_colorSpace {nullptr}
 internally sets the color space for brush preview
 
float m_currentBrushSize {1.0}
 
KisDistanceInformation m_currentDistance
 
KisPaintOpPresetSP m_currentPreset
 
QPainterPath m_curvedLine
 
KisPaintInformation m_curvePointPI1
 
KisPaintInformation m_curvePointPI2
 
KisImageSP m_image
 internally sets the image area for brush preview
 
KisLayerSP m_layer
 internally sets the layer area for brush preview
 
const float m_maxBrushVal {100.0}
 
const qreal m_maxScale {0.3}
 
const float m_maxStrokeScale {1.0}
 
const float m_minBrushVal {10.0}
 the range of brush sizes that will control zooming in/out
 
const qreal m_minScale {1.0}
 range of scale values. 1.0 == 100%
 
const float m_minStrokeScale {0.4}
 multiplier that is used for lengthening the brush stroke points
 
QGraphicsTextItem * m_noPreviewText {nullptr}
 holds the 'no preview available' text object
 
KoColor m_paintColor
 the color which is used for rendering the stroke
 
bool m_previewGenerationInProgress {false}
 
KoCanvasResourceProviderm_resourceManager {nullptr}
 internally sets the Resource Provider for brush preview (allowing gradients in preview)
 
QGraphicsPixmapItem * m_sceneImageItem {nullptr}
 holds the preview brush stroke data
 
KisSignalCompressor m_updateCompressor
 

Detailed Description

Widget for displaying a live brush preview of your selected brush. It listens for signalsetting changes that the brush preset outputs and updates the preview accordingly. This class can be added to a UI file similar to how a QGraphicsView is added

Definition at line 35 of file kis_preset_live_preview_view.h.

Constructor & Destructor Documentation

◆ KisPresetLivePreviewView()

KisPresetLivePreviewView::KisPresetLivePreviewView ( QWidget * parent)

Definition at line 22 of file kis_preset_live_preview_view.cpp.

23 : QGraphicsView(parent),
25{
26 connect(&m_updateCompressor, SIGNAL(timeout()), SLOT(updateStroke()));
27}
connect(this, SIGNAL(optionsChanged()), this, SLOT(saveOptions()))

References connect(), m_updateCompressor, and updateStroke().

◆ ~KisPresetLivePreviewView()

KisPresetLivePreviewView::~KisPresetLivePreviewView ( )

Definition at line 29 of file kis_preset_live_preview_view.cpp.

30{
31 delete m_noPreviewText;
33}
QGraphicsScene * m_brushPreviewScene
the scene that can add items like text and the brush stroke image
QGraphicsTextItem * m_noPreviewText
holds the 'no preview available' text object

References m_brushPreviewScene, and m_noPreviewText.

Member Function Documentation

◆ changeEvent()

void KisPresetLivePreviewView::changeEvent ( QEvent * event)
overrideprivate

Definition at line 389 of file kis_preset_live_preview_view.cpp.

390{
391 QWidget::changeEvent(event);
392 if (event->type() == QEvent::PaletteChange) {
393 if (m_currentPreset) {
395 }
396 }
397}

References m_currentPreset, and requestUpdateStroke().

◆ paintBackground()

void KisPresetLivePreviewView::paintBackground ( )
private

works as both clearing the previous stroke, providing striped backgrounds for smudging brushes, and text if there is no preview

Definition at line 111 of file kis_preset_live_preview_view.cpp.

112{
113 // clean up "no preview" text object if it exists. we will add it later if we need it
114 if (m_noPreviewText) {
115 this->scene()->removeItem(m_noPreviewText);
116 m_noPreviewText = 0;
117 }
118
119
120 if (m_currentPreset->paintOp().id() == "colorsmudge" ||
121 m_currentPreset->paintOp().id() == "deformbrush" ||
122 m_currentPreset->paintOp().id() == "filter") {
123
124 // easier to see deformations and smudging with alternating stripes in the background
125 // paint the whole background with alternating stripes
126 // filter engine may or may not show things depending on the filter...but it is better than nothing
127
128 int grayStrips = 20;
129 for (int i=0; i < grayStrips; i++ ) {
130
131 float sectionPercent = 1.0 / (float)grayStrips;
132 bool isAlternating = i % 2;
133 KoColor fillColor(m_layer->paintDevice()->colorSpace());
134
135 if (isAlternating) {
136 fillColor.fromQColor(QColor(80,80,80));
137 } else {
138 fillColor.fromQColor(QColor(140,140,140));
139 }
140
141
142 const QRect fillRect(m_layer->image()->width()*sectionPercent*i,
143 0,
144 m_layer->image()->width()*(sectionPercent*i +sectionPercent),
145 m_layer->image()->height());
146
148 m_layer->paintDevice()->fill(fillRect, fillColor);
149 t.end();
150 }
151
152 m_paintColor = KoColor(Qt::white, m_colorSpace);
153
154 }
155 else if (m_currentPreset->paintOp().id() == "roundmarker" ||
156 m_currentPreset->paintOp().id() == "experimentbrush" ||
157 m_currentPreset->paintOp().id() == "duplicate" ) {
158
159 // cases where we will not show a preview for now
160 // roundbrush (quick) -- this isn't showing anything, disable showing preview
161 // experimentbrush -- this creates artifacts that carry over to other previews and messes up their display
162 // duplicate (clone) brush doesn't have a preview as it doesn't show anything)
163
164 // fill with gray first to clear out what existed from previous preview
166 m_layer->paintDevice()->fill(m_image->bounds(), KoColor(palette().color(QPalette::Window) , m_colorSpace));
167 t.end();
168
169 m_paintColor = KoColor(palette().color(QPalette::Text), m_colorSpace);
170
171 QFont font;
172 font.setPixelSize(14);
173 font.setBold(false);
174
175 m_noPreviewText = this->scene()->addText(i18n("No Preview for this engine"),font);
176 m_noPreviewText->setPos(50, this->height()/4);
177
178 return;
179
180 }
181 else {
182
183 // fill with gray first to clear out what existed from previous preview
185 m_layer->paintDevice()->fill(m_image->bounds(), KoColor(palette().color(QPalette::Window) , m_colorSpace));
186 t.end();
187
188 m_paintColor = KoColor(palette().color(QPalette::Text), m_colorSpace);
189 }
190}
qint32 width() const
qint32 height() const
QRect bounds() const override
void fill(const QRect &rc, const KoColor &color)
const KoColorSpace * colorSpace() const
const KoColorSpace * m_colorSpace
internally sets the color space for brush preview
KisImageSP m_image
internally sets the image area for brush preview
KisLayerSP m_layer
internally sets the layer area for brush preview
KoColor m_paintColor
the color which is used for rendering the stroke
rgba palette[MAX_PALETTE]
Definition palette.c:35
KisImageWSP image
virtual KisPaintDeviceSP paintDevice() const =0

References KisImage::bounds(), KisPaintDevice::colorSpace(), KisTransaction::end(), KisPaintDevice::fill(), KoColor::fromQColor(), KisImage::height(), KisBaseNode::image, m_colorSpace, m_currentPreset, m_image, m_layer, m_noPreviewText, m_paintColor, KisBaseNode::paintDevice(), palette, and KisImage::width().

◆ requestUpdateStroke()

void KisPresetLivePreviewView::requestUpdateStroke ( )

◆ setCurrentPreset()

void KisPresetLivePreviewView::setCurrentPreset ( KisPaintOpPresetSP preset)

set the current preset from resource manager for the live preview to use. Good to call this every stroke update in case the preset has changed

Parameters
presetthe current preset from the resource manager

Definition at line 66 of file kis_preset_live_preview_view.cpp.

67{
68 m_currentPreset = preset;
69}

References m_currentPreset.

◆ setup()

void KisPresetLivePreviewView::setup ( KoCanvasResourceProvider * resourceManager)

one time setup for initialization of many variables. This live preview might be in a UI file, so make sure to call this before starting to use it

Definition at line 35 of file kis_preset_live_preview_view.cpp.

36{
37 m_resourceManager = resourceManager;
38
39 // initializing to 0 helps check later if they actually have something in them
42
43 setHorizontalScrollBarPolicy ( Qt::ScrollBarAlwaysOff );
44 setVerticalScrollBarPolicy ( Qt::ScrollBarAlwaysOff );
45
46
47 // layer image needs to be big enough to get an entire stroke of data
48 m_canvasSize.setWidth(this->width());
49 m_canvasSize.setHeight(this->height());
50
51 m_canvasCenterPoint.setX(m_canvasSize.width()*0.5);
52 m_canvasCenterPoint.setY(m_canvasSize.height()*0.5);
53
55 m_image = new KisImage(0, m_canvasSize.width(), m_canvasSize.height(), m_colorSpace, "stroke sample image");
56
57
58 m_layer = new KisPaintLayer(m_image, "livePreviewStrokeSample", OPACITY_OPAQUE_U8, m_colorSpace);
59
60 // set scene for the view
61 m_brushPreviewScene = new QGraphicsScene();
62 setScene(m_brushPreviewScene);
63
64}
const quint8 OPACITY_OPAQUE_U8
KoCanvasResourceProvider * m_resourceManager
internally sets the Resource Provider for brush preview (allowing gradients in preview)
QGraphicsPixmapItem * m_sceneImageItem
holds the preview brush stroke data
static KoColorSpaceRegistry * instance()
const KoColorSpace * rgb8(const QString &profileName=QString())

References KoColorSpaceRegistry::instance(), m_brushPreviewScene, m_canvasCenterPoint, m_canvasSize, m_colorSpace, m_image, m_layer, m_noPreviewText, m_resourceManager, m_sceneImageItem, OPACITY_OPAQUE_U8, and KoColorSpaceRegistry::rgb8().

◆ setupAndPaintStroke()

void KisPresetLivePreviewView::setupAndPaintStroke ( )
private

creates and performs the actual stroke that goes on top of the background this is internally and should always be called after the paintBackground()

Definition at line 217 of file kis_preset_live_preview_view.cpp.

218{
219 // limit the brush stroke size. larger brush strokes just don't look good and are CPU intensive
220 // we are making a proxy preset and setting it to the painter...otherwise setting the brush size of the original preset
221 // will fire off signals that make this run in an infinite loop
222 qreal previewSize = qBound(3.0, m_currentPreset->settings()->paintOpSize(), 25.0 ); // constrain live preview brush size
223 //Except for the sketchbrush where it determines the history.
224 if (m_currentPreset->paintOp().id() == "sketchbrush" ||
225 m_currentPreset->paintOp().id() == "spraybrush") {
226 previewSize = qMax(3.0, m_currentPreset->settings()->paintOpSize());
227 }
228
229
230 KisPaintOpPresetSP proxy_preset = m_currentPreset->clone().dynamicCast<KisPaintOpPreset>();
231 KisPaintOpSettingsSP settings = proxy_preset->settings();
232 settings->setPaintOpSize(previewSize);
233
234 int maxTextureSize = 200;
235 int textureOffsetX = settings->getInt("Texture/Pattern/MaximumOffsetX")*2;
236 int textureOffsetY = settings->getInt("Texture/Pattern/MaximumOffsetY")*2;
237 double textureScale = settings->getDouble("Texture/Pattern/Scale");
238 if ( textureOffsetX*textureScale> maxTextureSize || textureOffsetY*textureScale > maxTextureSize) {
239 int maxSize = qMax(textureOffsetX, textureOffsetY);
240 double result = qreal(maxTextureSize) / maxSize;
241 settings->setProperty("Texture/Pattern/Scale", result);
242 }
243 if (proxy_preset->paintOp().id() == "spraybrush") {
244
245 QDomElement element;
246 QDomDocument d;
247 QString brushDefinition = settings->getString("brush_definition");
248 if (!brushDefinition.isEmpty()) {
249 d.setContent(brushDefinition, false);
250 element = d.firstChildElement("Brush");
251
253
254 qreal width = brush->image().width();
255 qreal scale = brush->scale();
256 qreal diameterToBrushRatio = 1.0;
257 qreal diameter = settings->getInt("Spray/diameter");
258 //hack, 1000 being the maximum possible brushsize.
259 if (brush->filename().endsWith(".svg", Qt::CaseInsensitive)) {
260 diameterToBrushRatio = diameter/(1000.0*scale);
261 scale = 25.0 / 1000.0;
262 } else {
263 if (width * scale > 25.0) {
264 diameterToBrushRatio = diameter / (width * scale);
265 scale = 25.0 / width;
266
267 if (!settings->getBool("SprayShape/proportional")) {
268 settings->setProperty("SprayShape/width", qRound(scale * settings->getInt("SprayShape/width")));
269 settings->setProperty("SprayShape/height", qRound(scale * settings->getInt("SprayShape/height")));
270 }
271 }
272 }
273 settings->setProperty("Spray/diameter", int(25.0 * diameterToBrushRatio));
274
275 brush->setScale(scale);
276 d.clear();
277 element = d.createElement("Brush");
278 brush->toXML(d, element);
279 d.appendChild(element);
280 settings->setProperty("brush_definition", d.toString());
281 }
282 }
283
284 proxy_preset->setSettings(settings);
285
286 KisResourcesSnapshotSP resources =
289 0, {},
290 proxy_preset);
291 resources->setOpacity(settings->paintOpOpacity());
292 resources->setMirroring(false, false); // ignore mirroring in toolbar
293
296
297 KisStrokeStrategy *stroke =
298 new FreehandStrokeStrategy(resources, strokeInfo, kundo2_noi18n("temp_stroke"));
299
300 KisStrokeId strokeId = m_image->startStroke(stroke);
301
302 if (proxy_preset->paintOp().id() == "mypaintbrush") {
303
306 }
307
308 // paint the stroke. The sketchbrush gets a different shape than the others to show how it works
309 if (proxy_preset->paintOp().id() == "sketchbrush"
310 || proxy_preset->paintOp().id() == "curvebrush"
311 || proxy_preset->paintOp().id() == "particlebrush") {
312 qreal startX = m_canvasCenterPoint.x() - (this->width()*0.4);
313 qreal endX = m_canvasCenterPoint.x() + (this->width()*0.4);
314 qreal middle = m_canvasCenterPoint.y();
315 KisPaintInformation pointOne;
316 pointOne.setPressure(0.0);
317 pointOne.setPos(QPointF(startX, middle));
318 KisPaintInformation pointTwo;
319 pointTwo.setPressure(0.0);
320 pointTwo.setPos(QPointF(startX, middle));
321 int repeats = 8;
322
323 for (int i = 0; i < repeats; i++) {
324 pointOne.setPos(pointTwo.pos());
325 pointOne.setPressure(pointTwo.pressure());
326
327 pointTwo.setPressure((1.0/repeats)*(i+1));
328 qreal xPos = ((1.0/repeats) * (i+1) * (endX-startX) )+startX;
329 pointTwo.setPos(QPointF(xPos, middle));
330
331 qreal offset = (this->height()/(repeats*1.5))*(i+1);
332 qreal handleY = middle + offset;
333 if (i%2 == 0) {
334 handleY = middle - offset;
335 }
336
337 m_image->addJob(strokeId,
339 pointOne,
340 QPointF(pointOne.pos().x(),
341 handleY),
342 QPointF(pointTwo.pos().x(),
343 handleY),
344 pointTwo));
346 }
347
348 } else {
349
350 // paint an S curve
351 m_curvePointPI1.setPos(QPointF(m_canvasCenterPoint.x() - (this->width()*0.45),
352 m_canvasCenterPoint.y() + (this->height()*0.2)));
354
355
356 m_curvePointPI2.setPos(QPointF(m_canvasCenterPoint.x() + (this->width()*0.4),
357 m_canvasCenterPoint.y() - (this->height()*0.2) ));
358
360
361 m_image->addJob(strokeId,
364 QPointF(m_canvasCenterPoint.x(),
365 m_canvasCenterPoint.y()-this->height()),
366 QPointF(m_canvasCenterPoint.x(),
367 m_canvasCenterPoint.y()+this->height()),
370 }
371 m_image->endStroke(strokeId);
372
374
375 NotificationStroke *notificationStroke = new NotificationStroke();
376 connect(notificationStroke, SIGNAL(timeout()), SLOT(slotPreviewGenerationCompleted()));
377 KisStrokeId notificationId = m_image->startStroke(notificationStroke);
378 m_image->endStroke(notificationId);
379
380
381 // TODO: if we don't have any regressions because of it until 4.2.8, then
382 // just remove this code.
383 // even though the brush is cloned, the proxy_preset still has some connection to the original preset which will mess brush sizing
384 // we need to return brush size to normal.The normal brush sends out a lot of extra signals, so keeping the proxy for now
385 //proxy_preset->settings()->setPaintOpSize(originalPresetSize);
386
387}
static KisBrushSP fromXML(const QDomElement &element, KisResourcesInterfaceSP resourcesInterface)
static KisResourcesInterfaceSP instance()
void addJob(KisStrokeId id, KisStrokeJobData *data) override
KisStrokeId startStroke(KisStrokeStrategy *strokeStrategy) override
void endStroke(KisStrokeId id) override
void setPos(const QPointF &p)
const QPointF & pos() const
void setCurrentTime(qreal time) const
void setPressure(qreal p)
Set the pressure.
qreal pressure() const
The pressure of the value (from 0.0 to 1.0)
The KisResourcesSnapshot class takes a snapshot of the various resources like colors and settings use...
void setFGColorOverride(const KoColor &color)
void setMirroring(bool horizontal, bool vertical)
KUndo2MagicString kundo2_noi18n(const QString &text)

References KisImage::addJob(), connect(), KisImage::endStroke(), KisBrush::fromXML(), KisGlobalResourcesInterface::instance(), kundo2_noi18n(), m_canvasCenterPoint, m_currentPreset, m_curvePointPI1, m_curvePointPI2, m_image, m_layer, m_paintColor, m_previewGenerationInProgress, m_resourceManager, KisPaintInformation::pos(), KisPaintInformation::pressure(), KisPaintInformation::setCurrentTime(), KisResourcesSnapshot::setFGColorOverride(), KisResourcesSnapshot::setMirroring(), KisResourcesSnapshot::setOpacity(), KisPaintInformation::setPos(), KisPaintInformation::setPressure(), slotPreviewGenerationCompleted(), and KisImage::startStroke().

◆ slotPreviewGenerationCompleted

void KisPresetLivePreviewView::slotPreviewGenerationCompleted ( )
privateslot

Definition at line 96 of file kis_preset_live_preview_view.cpp.

97{
99
100 QImage m_temp_image;
101 m_temp_image = m_layer->paintDevice()->convertToQImage(0, m_image->bounds());
102
103 // only add the object once...then just update the pixmap so we can move the preview around
104 if (!m_sceneImageItem) {
105 m_sceneImageItem = m_brushPreviewScene->addPixmap(QPixmap::fromImage(m_temp_image));
106 } else {
107 m_sceneImageItem->setPixmap(QPixmap::fromImage(m_temp_image));
108 }
109}
QImage convertToQImage(const KoColorProfile *dstProfile, qint32 x, qint32 y, qint32 w, qint32 h, KoColorConversionTransformation::Intent renderingIntent=KoColorConversionTransformation::internalRenderingIntent(), KoColorConversionTransformation::ConversionFlags conversionFlags=KoColorConversionTransformation::internalConversionFlags()) const

References KisImage::bounds(), KisPaintDevice::convertToQImage(), m_brushPreviewScene, m_image, m_layer, m_previewGenerationInProgress, m_sceneImageItem, and KisBaseNode::paintDevice().

◆ updateStroke

void KisPresetLivePreviewView::updateStroke ( )
privateslot

Definition at line 76 of file kis_preset_live_preview_view.cpp.

77{
78 // do not paint a stroke if we are any of these engines (they have some issue currently)
79 if (m_currentPreset->paintOp().id() == "roundmarker" ||
80 m_currentPreset->paintOp().id() == "experimentbrush" ||
81 m_currentPreset->paintOp().id() == "duplicate") {
82
85 return;
86 }
87
91 } else {
93 }
94}
void setupAndPaintStroke()
creates and performs the actual stroke that goes on top of the background this is internally and shou...
void paintBackground()
works as both clearing the previous stroke, providing striped backgrounds for smudging brushes,...

References m_currentPreset, m_previewGenerationInProgress, m_updateCompressor, paintBackground(), setupAndPaintStroke(), slotPreviewGenerationCompleted(), and KisSignalCompressor::start().

Member Data Documentation

◆ m_brushPreviewScene

QGraphicsScene* KisPresetLivePreviewView::m_brushPreviewScene {nullptr}
private

the scene that can add items like text and the brush stroke image

Definition at line 82 of file kis_preset_live_preview_view.h.

82{nullptr};

◆ m_canvasCenterPoint

QPointF KisPresetLivePreviewView::m_canvasCenterPoint
private

convenience variable used internally when positioning the objects and points in the scene

Definition at line 97 of file kis_preset_live_preview_view.h.

◆ m_canvasSize

QRect KisPresetLivePreviewView::m_canvasSize
private

holds the width and height of the image of the brush preview Probably can later add set functions to make this customizable It is hard-coded to 1200 x 400 for right now for image size

Definition at line 93 of file kis_preset_live_preview_view.h.

◆ m_colorSpace

const KoColorSpace* KisPresetLivePreviewView::m_colorSpace {nullptr}
private

internally sets the color space for brush preview

Definition at line 76 of file kis_preset_live_preview_view.h.

76{nullptr};

◆ m_currentBrushSize

float KisPresetLivePreviewView::m_currentBrushSize {1.0}
private

internal reference for internal brush size used to check if our brush size has changed do zooming and other things internally if it has changed

Definition at line 114 of file kis_preset_live_preview_view.h.

114{1.0};

◆ m_currentDistance

KisDistanceInformation KisPresetLivePreviewView::m_currentDistance
private

internal variables for constructing the stroke start and end shape there are two points that construct the "S" curve with this

Definition at line 101 of file kis_preset_live_preview_view.h.

◆ m_currentPreset

KisPaintOpPresetSP KisPresetLivePreviewView::m_currentPreset
private

internally stores the current preset. See setCurrentPreset(KisPaintOpPresetSP preset) for setting this externally

Definition at line 109 of file kis_preset_live_preview_view.h.

◆ m_curvedLine

QPainterPath KisPresetLivePreviewView::m_curvedLine
private

Definition at line 102 of file kis_preset_live_preview_view.h.

◆ m_curvePointPI1

KisPaintInformation KisPresetLivePreviewView::m_curvePointPI1
private

Definition at line 103 of file kis_preset_live_preview_view.h.

◆ m_curvePointPI2

KisPaintInformation KisPresetLivePreviewView::m_curvePointPI2
private

Definition at line 104 of file kis_preset_live_preview_view.h.

◆ m_image

KisImageSP KisPresetLivePreviewView::m_image
private

internally sets the image area for brush preview

Definition at line 70 of file kis_preset_live_preview_view.h.

◆ m_layer

KisLayerSP KisPresetLivePreviewView::m_layer
private

internally sets the layer area for brush preview

Definition at line 73 of file kis_preset_live_preview_view.h.

◆ m_maxBrushVal

const float KisPresetLivePreviewView::m_maxBrushVal {100.0}
private

Definition at line 121 of file kis_preset_live_preview_view.h.

121{100.0};

◆ m_maxScale

const qreal KisPresetLivePreviewView::m_maxScale {0.3}
private

Definition at line 125 of file kis_preset_live_preview_view.h.

125{0.3};

◆ m_maxStrokeScale

const float KisPresetLivePreviewView::m_maxStrokeScale {1.0}
private

Definition at line 129 of file kis_preset_live_preview_view.h.

129{1.0}; // for larger brush stroke

◆ m_minBrushVal

const float KisPresetLivePreviewView::m_minBrushVal {10.0}
private

the range of brush sizes that will control zooming in/out

Definition at line 120 of file kis_preset_live_preview_view.h.

120{10.0};

◆ m_minScale

const qreal KisPresetLivePreviewView::m_minScale {1.0}
private

range of scale values. 1.0 == 100%

Definition at line 124 of file kis_preset_live_preview_view.h.

124{1.0};

◆ m_minStrokeScale

const float KisPresetLivePreviewView::m_minStrokeScale {0.4}
private

multiplier that is used for lengthening the brush stroke points

Definition at line 128 of file kis_preset_live_preview_view.h.

128{0.4}; // for smaller brush stroke

◆ m_noPreviewText

QGraphicsTextItem* KisPresetLivePreviewView::m_noPreviewText {nullptr}
private

holds the 'no preview available' text object

Definition at line 88 of file kis_preset_live_preview_view.h.

88{nullptr};

◆ m_paintColor

KoColor KisPresetLivePreviewView::m_paintColor
private

the color which is used for rendering the stroke

Definition at line 79 of file kis_preset_live_preview_view.h.

◆ m_previewGenerationInProgress

bool KisPresetLivePreviewView::m_previewGenerationInProgress {false}
private

Definition at line 116 of file kis_preset_live_preview_view.h.

116{false};

◆ m_resourceManager

KoCanvasResourceProvider* KisPresetLivePreviewView::m_resourceManager {nullptr}
private

internally sets the Resource Provider for brush preview (allowing gradients in preview)

Definition at line 67 of file kis_preset_live_preview_view.h.

67{nullptr};

◆ m_sceneImageItem

QGraphicsPixmapItem* KisPresetLivePreviewView::m_sceneImageItem {nullptr}
private

holds the preview brush stroke data

Definition at line 85 of file kis_preset_live_preview_view.h.

85{nullptr};

◆ m_updateCompressor

KisSignalCompressor KisPresetLivePreviewView::m_updateCompressor
private

Definition at line 117 of file kis_preset_live_preview_view.h.


The documentation for this class was generated from the following files: