Krita Source Code Documentation
Loading...
Searching...
No Matches
detail Namespace Reference

Classes

struct  all_support_prefix
 
struct  ArchToString
 
struct  ArchToString< xsimd::generic >
 
struct  ArchToStringBase
 
struct  ArchToStringFactory
 
struct  CompositeFunctionWrapper
 
struct  CompositeFunctionWrapperHSL
 
struct  has_create_interstroke_data_factory
 
struct  has_create_interstroke_data_factory< T, std::void_t< decltype(std::declval< T >().createInterstrokeDataFactory(KisPaintOpSettingsSP(), KisResourcesInterfaceSP()))> >
 
struct  has_prepare_embedded_resources
 
struct  has_prepare_embedded_resources< T, std::void_t< decltype(std::declval< T >().prepareEmbeddedResources(KisPaintOpSettingsSP(), KisResourcesInterfaceSP()))> >
 
struct  has_prepare_linked_resources
 
struct  has_prepare_linked_resources< T, std::void_t< decltype(std::declval< T >().prepareLinkedResources(KisPaintOpSettingsSP(), KisResourcesInterfaceSP()))> >
 
struct  HorizontalMergePolicy
 
struct  HorizontalSplitPolicy
 
struct  KisDatabaseTransactionLockAdapter
 
struct  KisOptionTupleImpl
 
struct  KisOptionTupleImpl< false, true, Data... >
 
struct  KisOptionTupleImpl< true, false, FirstData, RestData... >
 
struct  MergeRectsOp
 
struct  none_support_prefix
 
struct  supports_extended_initilization
 
struct  supports_extended_initilization< T, std::void_t< decltype(T(std::declval< QWidget * >(), std::declval< KisResourcesInterfaceSP >(), std::declval< KoCanvasResourcesInterfaceSP >()))> >
 
struct  supports_prefix
 
struct  supports_prefix< T, false >
 
struct  supports_prefix< T, true >
 
struct  value_of_spin_box
 
struct  value_of_spin_box< QDoubleSpinBox >
 
struct  value_of_spin_box< QSpinBox >
 
struct  VerticalMergePolicy
 
struct  VerticalSplitPolicy
 
struct  VoidNoOp
 

Typedefs

template<typename SpinBox >
using value_of_spin_box_t = typename value_of_spin_box<SpinBox>::type
 

Functions

 addFactory (MyPaintAscensionId, -180, 180, "", "", i18n("%"))
 
 addFactory (MyPaintCustomId, -20, 20, "", "", i18n("%"))
 
 addFactory (MyPaintDeclinationId, 0, 90, "", "", i18n("%"))
 
 addFactory (MyPaintDirectionId, 0, 180, "", "", "")
 
 addFactory (MyPaintFineSpeedId, -20, 20, "", "", "")
 
 addFactory (MyPaintGrossSpeedId, -20, 20, "", "", "")
 
 addFactory (MyPaintPressureId, 0, 20, "", "", "")
 
 addFactory (MyPaintRandomId, 0, 1, "", "", "")
 
 addFactory (MyPaintStrokeId, 0, 1, "", "", "")
 
template<typename T , int(*)(T *) P>
void checkCStyleResultWrapper (T *ptr)
 
template<typename T >
KisPaintOpConfigWidgetcreateConfigWidget (QWidget *parent, KisResourcesInterfaceSP resourcesInterface, KoCanvasResourcesInterfaceSP canvasResourcesInterface, std::enable_if_t< supports_extended_initilization< T >::value > *=0)
 
template<typename T >
KisPaintOpConfigWidgetcreateConfigWidget (QWidget *parent, KisResourcesInterfaceSP resourcesInterface, KoCanvasResourcesInterfaceSP canvasResourcesInterface, std::enable_if_t<!supports_extended_initilization< T >::value > *=0)
 
template<typename T >
KisInterstrokeDataFactorycreateInterstrokeDataFactory (const KisPaintOpSettingsSP settings, KisResourcesInterfaceSP resourcesInterface, std::enable_if_t< has_create_interstroke_data_factory< T >::value > *=0)
 
template<typename T >
KisInterstrokeDataFactorycreateInterstrokeDataFactory (const KisPaintOpSettingsSP settings, KisResourcesInterfaceSP resourcesInterface, std::enable_if_t<!has_create_interstroke_data_factory< T >::value > *=0)
 
qreal io2sp (int x, int min, int max)
 
qreal io2sp (qreal x, qreal min, qreal max)
 
template<typename MergePolicy >
QVector< QRect >::iterator mergeRects (QVector< QRect >::iterator beginIt, QVector< QRect >::iterator endIt, MergePolicy policy)
 
KisOptimizedBrushOutlineoutlineFactory (const KisBrush *brush)
 
template<typename T >
QList< KoResourceLoadResultprepareEmbeddedResources (const KisPaintOpSettingsSP settings, KisResourcesInterfaceSP resourcesInterface, std::enable_if_t< has_prepare_embedded_resources< T >::value > *=0)
 
template<typename T >
QList< KoResourceLoadResultprepareEmbeddedResources (const KisPaintOpSettingsSP settings, KisResourcesInterfaceSP resourcesInterface, std::enable_if_t<!has_prepare_embedded_resources< T >::value > *=0)
 
template<typename T >
QList< KoResourceLoadResultprepareLinkedResources (const KisPaintOpSettingsSP settings, KisResourcesInterfaceSP resourcesInterface, std::enable_if_t< has_prepare_linked_resources< T >::value > *=0)
 
template<typename T >
QList< KoResourceLoadResultprepareLinkedResources (const KisPaintOpSettingsSP settings, KisResourcesInterfaceSP resourcesInterface, std::enable_if_t<!has_prepare_linked_resources< T >::value > *=0)
 
template<typename Data , typename SensorData = std::copy_const_t<Data, KisSensorData>>
std::vector< SensorData * > sensors (Data *data)
 
void setupStep (QDoubleSpinBox *spinBox, qreal min, qreal max)
 
void setupStep (QSpinBox *spinBox, int min, int max)
 
int sp2io (qreal x, int min, int max)
 
qreal sp2io (qreal x, qreal min, qreal max)
 
template<typename Policy , typename RowMergeOp , typename OutIt >
void splitRects (QVector< QRect >::iterator beginIt, QVector< QRect >::iterator endIt, OutIt resultIt, QVector< QRect > tempBuf[2], int gridSize, RowMergeOp rowMergeOp)
 
QString warningLabelText (qreal realBrushSize, qreal theoreticalMaskingBrushSize)
 
bool warningLabelVisible (qreal theoreticalBrushSize)
 
bool willChangeSpinBox (const QDoubleSpinBox *spinBox, qreal newValue)
 
bool willChangeSpinBox (const QSpinBox *spinBox, int newValue)
 

Variables

 KIS_DECLARE_STATIC_INITIALIZER
 

Typedef Documentation

◆ value_of_spin_box_t

template<typename SpinBox >
using detail::value_of_spin_box_t = typename value_of_spin_box<SpinBox>::type

Definition at line 36 of file KisCurveWidgetControlsManager.h.

Function Documentation

◆ addFactory() [1/9]

detail::addFactory ( MyPaintAscensionId ,
- 180,
180 ,
"" ,
"" ,
i18n("%")  )

◆ addFactory() [2/9]

detail::addFactory ( MyPaintCustomId ,
- 20,
20 ,
"" ,
"" ,
i18n("%")  )

◆ addFactory() [3/9]

detail::addFactory ( MyPaintDeclinationId ,
0 ,
90 ,
"" ,
"" ,
i18n("%")  )

◆ addFactory() [4/9]

detail::addFactory ( MyPaintDirectionId ,
0 ,
180 ,
"" ,
"" ,
""  )

◆ addFactory() [5/9]

detail::addFactory ( MyPaintFineSpeedId ,
- 20,
20 ,
"" ,
"" ,
""  )

◆ addFactory() [6/9]

detail::addFactory ( MyPaintGrossSpeedId ,
- 20,
20 ,
"" ,
"" ,
""  )

◆ addFactory() [7/9]

detail::addFactory ( MyPaintPressureId ,
0 ,
20 ,
"" ,
"" ,
""  )

◆ addFactory() [8/9]

detail::addFactory ( MyPaintRandomId ,
0 ,
1 ,
"" ,
"" ,
""  )

◆ addFactory() [9/9]

detail::addFactory ( MyPaintStrokeId ,
0 ,
1 ,
"" ,
"" ,
""  )

◆ checkCStyleResultWrapper()

template<typename T , int(*)(T *) P>
void detail::checkCStyleResultWrapper ( T * ptr)

Definition at line 26 of file KoFontLibraryResourceUtils.h.

27{
28 const int result = P(ptr);
29 if (result != 0) {
30 qWarning() << "WARNING: failed to release a library resource";
31#ifdef __GNUC__
32 qWarning() << " source:" << __PRETTY_FUNCTION__;
33#endif
34 }
35}
#define P(i, j, k)

References P.

◆ createConfigWidget() [1/2]

template<typename T >
KisPaintOpConfigWidget * detail::createConfigWidget ( QWidget * parent,
KisResourcesInterfaceSP resourcesInterface,
KoCanvasResourcesInterfaceSP canvasResourcesInterface,
std::enable_if_t< supports_extended_initilization< T >::value > * = 0 )

Definition at line 132 of file kis_simple_paintop_factory.h.

134{
135 T* widget = new T(parent, resourcesInterface, canvasResourcesInterface);
136 widget->setResourcesInterface(resourcesInterface);
137 widget->setCanvasResourcesInterface(canvasResourcesInterface);
138 return widget;
139}

◆ createConfigWidget() [2/2]

template<typename T >
KisPaintOpConfigWidget * detail::createConfigWidget ( QWidget * parent,
KisResourcesInterfaceSP resourcesInterface,
KoCanvasResourcesInterfaceSP canvasResourcesInterface,
std::enable_if_t<!supports_extended_initilization< T >::value > * = 0 )

Definition at line 142 of file kis_simple_paintop_factory.h.

144{
145 // TODO: remove this constructor and pass everything into the constructor
146 T* widget = new T(parent);
147 widget->setResourcesInterface(resourcesInterface);
148 widget->setCanvasResourcesInterface(canvasResourcesInterface);
149 return widget;
150}

◆ createInterstrokeDataFactory() [1/2]

template<typename T >
KisInterstrokeDataFactory * detail::createInterstrokeDataFactory ( const KisPaintOpSettingsSP settings,
KisResourcesInterfaceSP resourcesInterface,
std::enable_if_t< has_create_interstroke_data_factory< T >::value > * = 0 )

Definition at line 106 of file kis_simple_paintop_factory.h.

108{
109 return T::createInterstrokeDataFactory(settings, resourcesInterface);
110}

◆ createInterstrokeDataFactory() [2/2]

template<typename T >
KisInterstrokeDataFactory * detail::createInterstrokeDataFactory ( const KisPaintOpSettingsSP settings,
KisResourcesInterfaceSP resourcesInterface,
std::enable_if_t<!has_create_interstroke_data_factory< T >::value > * = 0 )

Definition at line 113 of file kis_simple_paintop_factory.h.

115{
116 Q_UNUSED(settings);
117 Q_UNUSED(resourcesInterface);
118 // noop
119 return 0;
120}

◆ io2sp() [1/2]

qreal detail::io2sp ( int x,
int min,
int max )

Definition at line 18 of file KisCurveWidgetControlsManager.cpp.

19{
21 return unitConverter.io2sp(x, min, max);
22}
double io2sp(int x, int min, int max)

References KisSpinBoxSplineUnitConverter::io2sp().

◆ io2sp() [2/2]

qreal detail::io2sp ( qreal x,
qreal min,
qreal max )

Definition at line 30 of file KisCurveWidgetControlsManager.cpp.

31{
32 const qreal rangeLen = max - min;
33 return !qFuzzyIsNull(rangeLen) ? (x - min) / rangeLen : 0.0;
34}
static bool qFuzzyIsNull(half h)

References qFuzzyIsNull().

◆ mergeRects()

template<typename MergePolicy >
QVector< QRect >::iterator detail::mergeRects ( QVector< QRect >::iterator beginIt,
QVector< QRect >::iterator endIt,
MergePolicy policy )

Definition at line 52 of file KisRegion.cpp.

55{
56 if (beginIt == endIt) return endIt;
57
58 std::sort(beginIt, endIt, MergePolicy::elementIsLess);
59
60 auto resultIt = beginIt;
61 auto it = std::next(beginIt);
62
63 while (it != endIt) {
64 auto rowEnd = std::upper_bound(it, endIt, *it, MergePolicy::rowIsLess);
65 for (auto rowIt = it; rowIt != rowEnd; ++rowIt) {
66 if (policy.rowHeight(*resultIt) == policy.rowHeight(*rowIt) &&
67 policy.nextCol(*resultIt) == policy.col(*rowIt)) {
68 *resultIt |= *rowIt;
69 } else {
70 resultIt++;
71 *resultIt = *rowIt;
72 }
73 }
74
75 it = rowEnd;
76 }
77
78 return std::next(resultIt);
79}

◆ outlineFactory()

KisOptimizedBrushOutline * detail::outlineFactory ( const KisBrush * brush)

Definition at line 106 of file kis_brush.cpp.

106 {
108
109 KisBoundary boundary(dev);
110 boundary.generateBoundary();
111 return new KisOptimizedBrushOutline(boundary.path(), dev->bounds());
112}
virtual KisFixedPaintDeviceSP outlineSourceImage() const

References KisFixedPaintDevice::bounds(), KisBoundary::generateBoundary(), outlineFactory(), KisBrush::outlineSourceImage(), and KisBoundary::path().

◆ prepareEmbeddedResources() [1/2]

template<typename T >
QList< KoResourceLoadResult > detail::prepareEmbeddedResources ( const KisPaintOpSettingsSP settings,
KisResourcesInterfaceSP resourcesInterface,
std::enable_if_t< has_prepare_embedded_resources< T >::value > * = 0 )

Definition at line 81 of file kis_simple_paintop_factory.h.

84{
85 return T::prepareEmbeddedResources(settings, resourcesInterface);
86}

◆ prepareEmbeddedResources() [2/2]

template<typename T >
QList< KoResourceLoadResult > detail::prepareEmbeddedResources ( const KisPaintOpSettingsSP settings,
KisResourcesInterfaceSP resourcesInterface,
std::enable_if_t<!has_prepare_embedded_resources< T >::value > * = 0 )

Definition at line 89 of file kis_simple_paintop_factory.h.

92{
93 Q_UNUSED(settings);
94 Q_UNUSED(resourcesInterface);
95 // noop
96 return {};
97}

◆ prepareLinkedResources() [1/2]

template<typename T >
QList< KoResourceLoadResult > detail::prepareLinkedResources ( const KisPaintOpSettingsSP settings,
KisResourcesInterfaceSP resourcesInterface,
std::enable_if_t< has_prepare_linked_resources< T >::value > * = 0 )

Definition at line 55 of file kis_simple_paintop_factory.h.

58{
59 return T::prepareLinkedResources(settings, resourcesInterface);
60}

◆ prepareLinkedResources() [2/2]

template<typename T >
QList< KoResourceLoadResult > detail::prepareLinkedResources ( const KisPaintOpSettingsSP settings,
KisResourcesInterfaceSP resourcesInterface,
std::enable_if_t<!has_prepare_linked_resources< T >::value > * = 0 )

Definition at line 63 of file kis_simple_paintop_factory.h.

66{
67 Q_UNUSED(settings);
68 Q_UNUSED(resourcesInterface);
69 // noop
70 return {};
71}

◆ sensors()

template<typename Data , typename SensorData = std::copy_const_t<Data, KisSensorData>>
std::vector< SensorData * > detail::sensors ( Data * data)
inline

Definition at line 21 of file KisKritaSensorPack.cpp.

22{
23 std::vector<SensorData*> result;
24
25 result.reserve(16);
26
27 result.push_back(&data->sensorPressure);
28 result.push_back(&data->sensorPressureIn);
29 result.push_back(&data->sensorTangentialPressure);
30
31 result.push_back(&data->sensorDrawingAngle);
32 result.push_back(&data->sensorXTilt);
33 result.push_back(&data->sensorYTilt);
34 result.push_back(&data->sensorTiltDirection);
35 result.push_back(&data->sensorTiltElevation);
36 result.push_back(&data->sensorRotation);
37
38 result.push_back(&data->sensorFuzzyPerDab);
39 result.push_back(&data->sensorFuzzyPerStroke);
40
41 result.push_back(&data->sensorSpeed);
42 result.push_back(&data->sensorFade);
43 result.push_back(&data->sensorDistance);
44 result.push_back(&data->sensorTime);
45
46 result.push_back(&data->sensorPerspective);
47
48
49 return result;
50}

◆ setupStep() [1/2]

void detail::setupStep ( QDoubleSpinBox * spinBox,
qreal min,
qreal max )

Definition at line 48 of file KisCurveWidgetControlsManager.cpp.

48 {
49 if (qAbs(max - min) > 10) {
50 spinBox->setSingleStep(1.0);
51 } else {
52 spinBox->setSingleStep(0.1);
53 }
54}

◆ setupStep() [2/2]

void detail::setupStep ( QSpinBox * spinBox,
int min,
int max )

Definition at line 42 of file KisCurveWidgetControlsManager.cpp.

42 {
43 Q_UNUSED(min);
44 Q_UNUSED(max);
45 spinBox->setSingleStep(1);
46}

◆ sp2io() [1/2]

int detail::sp2io ( qreal x,
int min,
int max )

Definition at line 24 of file KisCurveWidgetControlsManager.cpp.

25{
27 return unitConverter.sp2io(x, min, max);
28}
int sp2io(double x, int min, int max)

References KisSpinBoxSplineUnitConverter::sp2io().

◆ sp2io() [2/2]

qreal detail::sp2io ( qreal x,
qreal min,
qreal max )

Definition at line 36 of file KisCurveWidgetControlsManager.cpp.

37{
38 const qreal rangeLen = max - min;
39 return x * rangeLen + min;
40}

◆ splitRects()

template<typename Policy , typename RowMergeOp , typename OutIt >
void detail::splitRects ( QVector< QRect >::iterator beginIt,
QVector< QRect >::iterator endIt,
OutIt resultIt,
QVector< QRect > tempBuf[2],
int gridSize,
RowMergeOp rowMergeOp )

Definition at line 165 of file KisRegion.cpp.

170{
171 if (beginIt == endIt) return;
172
173 QVector<QRect> &nextRowExtra = tempBuf[0];
174 QVector<QRect> &nextRowExtraTmp = tempBuf[1];
175
176 std::sort(beginIt, endIt, Policy::rowIsLess);
177 int rowStart = Policy::rowStart(*beginIt);
178 int rowEnd = rowStart + gridSize - 1;
179
180 auto it = beginIt;
181 while (1) {
182 bool switchToNextRow = false;
183
184 if (it == endIt) {
185 if (nextRowExtra.isEmpty()) {
186 rowMergeOp();
187 break;
188 } else {
189 switchToNextRow = true;
190 }
191 } else if (Policy::rowStart(*it) > rowEnd) {
192 switchToNextRow = true;
193 }
194
195 if (switchToNextRow) {
196 rowMergeOp();
197
198 if (!nextRowExtra.isEmpty()) {
199 rowStart = Policy::rowStart(nextRowExtra.first());
200 rowEnd = rowStart + gridSize - 1;
201
202 for (auto nextIt = nextRowExtra.begin(); nextIt != nextRowExtra.end(); ++nextIt) {
203 if (Policy::rowEnd(*nextIt) > rowEnd) {
204 nextRowExtraTmp.append(Policy::splitRectLo(*nextIt, rowEnd));
205 *resultIt++ = Policy::splitRectHi(*nextIt, rowEnd);
206 } else {
207 *resultIt++ = *nextIt;
208 }
209 }
210 nextRowExtra.clear();
211 std::swap(nextRowExtra, nextRowExtraTmp);
212
213 continue;
214 } else {
215 rowStart = Policy::rowStart(*it);
216 rowEnd = rowStart + gridSize - 1;
217 }
218 }
219
220 if (Policy::rowEnd(*it) > rowEnd) {
221 nextRowExtra.append(Policy::splitRectLo(*it, rowEnd));
222 *resultIt++ = Policy::splitRectHi(*it, rowEnd);
223 } else {
224 *resultIt++ = *it;
225 }
226
227 ++it;
228 }
229}

◆ warningLabelText()

QString detail::warningLabelText ( qreal realBrushSize,
qreal theoreticalMaskingBrushSize )

Definition at line 43 of file KisMaskingBrushOption.cpp.

44{
45 return
46 i18nc("warning about too big size of the masked brush",
47 "WARNING: Dependent size of the masked brush grew too big (%1 pixels). Its value has been cropped to %2 pixels.",
48 theoreticalMaskingBrushSize,
49 realBrushSize);
50}

◆ warningLabelVisible()

bool detail::warningLabelVisible ( qreal theoreticalBrushSize)

Definition at line 52 of file KisMaskingBrushOption.cpp.

52 {
53 KisImageConfig cfg(true);
54 return theoreticalBrushSize > cfg.maxMaskingBrushSize();
55}

References KisImageConfig::maxMaskingBrushSize().

◆ willChangeSpinBox() [1/2]

bool detail::willChangeSpinBox ( const QDoubleSpinBox * spinBox,
qreal newValue )

Definition at line 61 of file KisCurveWidgetControlsManager.cpp.

62{
63 return qRound(spinBox->value() * spinBox->decimals()) !=
64 qRound(newValue * spinBox->decimals());
65}

◆ willChangeSpinBox() [2/2]

bool detail::willChangeSpinBox ( const QSpinBox * spinBox,
int newValue )

Definition at line 56 of file KisCurveWidgetControlsManager.cpp.

57{
58 return spinBox->value() != newValue;
59}

Variable Documentation

◆ KIS_DECLARE_STATIC_INITIALIZER

detail::KIS_DECLARE_STATIC_INITIALIZER
Initial value:
{
auto addFactory = [](const KoID &id,
int minimumValue,
int maximumValue,
const QString &minimumLabel,
const QString &maximumLabel,
const QString &valueSuffix) {
minimumValue,
maximumValue,
minimumLabel,
maximumLabel,
valueSuffix));
}
static KisDynamicSensorFactoryRegistry * instance()
Definition KoID.h:30
addFactory(MyPaintPressureId, 0, 20, "", "", "")

Definition at line 27 of file MyPaintSensorPack.cpp.

27 {
28 auto addFactory = [](const KoID &id,
29 int minimumValue,
30 int maximumValue,
31 const QString &minimumLabel,
32 const QString &maximumLabel,
33 const QString &valueSuffix) {
35 minimumValue,
36 maximumValue,
37 minimumLabel,
38 maximumLabel,
39 valueSuffix));
40 };