12#include <QApplication>
16#include <ksharedconfig.h>
41 KisCursor::loadWithSize(
"tool_similar_selection_cursor.svg", 32, 32, 6, 6),
42 i18n(
"Similar Color Selection"))
44 , m_opacitySpread(100)
72 !(currentNode()->projection()) ||
73 !selectionEditable()) {
90 KisStrokeId strokeId = image()->startStroke(strategy);
106 const int currentTime = image()->animationInterface()->currentTime();
114 newReferenceNodeList,
116 newReferencePaintDevice,
134 const QPoint pos = convertToImagePixelCoordFloored(event);
145 *referenceColor = sourceDevice->
pixel(pos);
157 QRect
bounds = currentImage()->bounds();
171 tmpSel, referenceColor, sourceDevice,
172 bounds,
nullptr, progressHelper
176 image()->addJob(strokeId, job);
195 image()->endStroke(strokeId);
233 sliderThreshold->setPrefix(i18nc(
234 "The 'threshold' spinbox prefix in similar selection tool options",
237 sliderThreshold->setSingleStep(1);
238 sliderThreshold->setToolTip(
239 i18n(
"Set the color similarity tolerance of the selection. "
240 "Increasing threshold increases the range of similar colors to be selected."));
245 i18nc(
"The 'spread' spinbox in similar color selection tool options; {n} is the "
246 "number value, % is the percent sign",
250 sliderThreshold->setToolTip(
251 i18n(
"Set the color similarity tolerance of the selection. "
252 "Increasing threshold increases the range of similar colors to be selected."));
253 sliderSpread->setToolTip(
254 i18n(
"Set the extent of the opaque portion of the selection. "
255 "Decreasing spread decreases opacity of selection areas depending on color similarity."));
260 i18nc(
"The 'selection extent' section label in similar selection "
262 "Selection extent"));
263 sectionSelectionExtent->
appendWidget(
"sliderThreshold", sliderThreshold);
264 sectionSelectionExtent->
appendWidget(
"sliderSpread", sliderSpread);
265 selectionWidget->
insertWidget(3,
"sectionSelectionExtent", sectionSelectionExtent);
279 connect(sliderThreshold,
280 SIGNAL(valueChanged(
int)),
283 connect(sliderSpread,
284 SIGNAL(valueChanged(
int)),
288 return selectionWidget;
302 KisToolSelect::resetCursorStyle();
static QCursor loadWithSize(const QString &cursorName, int width, int height, int hotspotX=-1, int hotspotY=-1)
static QCursor waitCursor()
void setSizemod(int sizemod)
void setFillThreshold(int threshold)
void setFeather(int feather)
QVector< KisStrokeJobData * > createSimilarColorsSelectionJobs(KisPixelSelectionSP outSelection, const QSharedPointer< KoColor > referenceColor, KisPaintDeviceSP referenceDevice, const QRect &rect, KisPixelSelectionSP mask, QSharedPointer< KisProcessingVisitor::ProgressHelper > progressHelper=nullptr)
void setAntiAlias(bool antiAlias)
void setStopGrowingAtDarkestPixel(bool stopGrowingAtDarkestPixel)
void setOpacitySpread(int opacitySpread)
static KisPaintDeviceSP createRefPaintDevice(KisImageSP originalImage, QString name="Merge Labeled Layers Reference Paint Device")
@ GroupSelectionPolicy_SelectIfColorLabeled
Groups will be taken into account only if they have set an explicit color label. This ignores groups ...
const KoColorSpace * colorSpace() const
bool pixel(qint32 x, qint32 y, QColor *c) const
void setStopGrowingAtDarkestPixelButtonVisible(bool visible)
This class is a spinbox in which you can click and drag to set the value. A slider like bar is displa...
void setValue(int newValue)
void setRange(int newMinimum, int newMaximum, bool computeNewFastSliderStep=true)
Set the minimum and the maximum values of the range, computing a new "fast slider step" based on the ...
void setSupportsWrapAroundMode(bool value)
#define KIS_SAFE_ASSERT_RECOVER_RETURN(cond)
QSharedPointer< KUndo2Command > KUndo2CommandSP
KUndo2MagicString kundo2_i18n(const char *text)
void setText(QSpinBox *spinBox, const QStringView textTemplate)
The LambdaCommand struct is a shorthand for creation of AggregateCommand commands using C++ lambda fe...
void invalidateOutlineCache()