|
Krita Source Code Documentation
|
Classes | |
| struct | ExportFileJob |
| struct | is_appendable_container |
| struct | is_container |
Enumerations | |
| enum | BackgroudSavingStartResult { Success = 0 , Failure = 1 , AnotherSavingInProgress = 2 , ImageLockFailure = 3 } |
| enum | DeviceCopyMode { CopySnapshot = 0 , CopyAllFrames } |
| enum | SaveFlag { SaveNone = 0 , SaveShowWarnings = 0x1 , SaveIsExporting = 0x2 , SaveInAutosaveMode = 0x4 } |
| enum | ThresholdMode { ThresholdNone = 0 , ThresholdFloor , ThresholdCeil , ThresholdMaxOut } |
Functions | |
| template<typename Func , typename Job > | |
| void | addJobBarrier (QVector< Job * > &jobs, Func func) |
| template<typename Func , typename Job > | |
| void | addJobBarrier (QVector< Job * > &jobs, int lod, Func func) |
| template<typename Func , typename Job > | |
| void | addJobBarrierExclusive (QVector< Job * > &jobs, Func func) |
| template<typename Func , typename Job > | |
| void | addJobBarrierExclusiveNoCancel (QVector< Job * > &jobs, Func func) |
| template<typename Func , typename Job > | |
| void | addJobBarrierNoCancel (QVector< Job * > &jobs, Func func) |
| template<typename Func , typename Job > | |
| void | addJobConcurrent (QVector< Job * > &jobs, Func func) |
| template<typename Func , typename Job > | |
| void | addJobConcurrent (QVector< Job * > &jobs, int lod, Func func) |
| template<typename Func , typename Job > | |
| void | addJobConcurrentNoCancel (QVector< Job * > &jobs, Func func) |
| template<typename Func , typename Job > | |
| void | addJobSequential (QVector< Job * > &jobs, Func func) |
| template<typename Func , typename Job > | |
| void | addJobSequential (QVector< Job * > &jobs, int lod, Func func) |
| template<typename Func , typename Job > | |
| void | addJobSequentialExclusive (QVector< Job * > &jobs, Func func) |
| template<typename Func , typename Job > | |
| void | addJobSequentialExclusive (QVector< Job * > &jobs, int lod, Func func) |
| template<typename Func , typename Job > | |
| void | addJobSequentialExclusiveNoCancel (QVector< Job * > &jobs, Func func) |
| template<typename Func , typename Job > | |
| void | addJobSequentialNoCancel (QVector< Job * > &jobs, Func func) |
| template<typename Func , typename Job > | |
| void | addJobUniquelyConcurrent (QVector< Job * > &jobs, Func func) |
| template<typename Func , typename Job > | |
| void | addJobUniquelyConcurrent (QVector< Job * > &jobs, int lod, Func func) |
| template<typename Func , typename Job > | |
| void | addJobUniquelyConcurrentNoCancel (QVector< Job * > &jobs, Func func) |
| void | applyToAlpha8Device (KisPaintDeviceSP dev, const QRect &rc, std::function< void(quint8)> func) |
| bool | checkInTriangle (const QRectF &rect, const QPolygonF &triangle) |
| bool | compareChannelFlags (QBitArray f1, QBitArray f2) |
| template<class T > | |
| bool | compareListsUnordered (const QList< T > &a, const QList< T > &b) |
| QImage | convertQImageToGrayA (const QImage &image) |
| qreal | estimatePortionOfTransparentPixels (KisPaintDeviceSP dev, const QRect &rect, qreal samplePortion) |
| boost::optional< QPointF > | fetchControlPoint (KoPathPoint *pt, bool takeFirst) |
| void | filterAlpha8Device (KisPaintDeviceSP dev, const QRect &rc, std::function< quint8(quint8)> func) |
| template<class C , typename KeepIfFunction > | |
| auto | filterContainer (C &container, KeepIfFunction keepIf) -> decltype(bool(keepIf(container[0])), void()) |
| template<class C > | |
| void | makeContainerUnique (C &container) |
| void | makeSymmetric (KoPathPoint *pt, bool copyFromFirst) |
| qreal KRITAIMAGE_EXPORT | maxDimensionPortion (const QRectF &bounds, qreal portion, qreal minValue) |
| QBitArray | mergeChannelFlags (const QBitArray &childFlags, const QBitArray &parentFlags) |
| qreal | mergeOpacityF (qreal opacity, qreal parentOpacity) |
| quint8 | mergeOpacityU8 (quint8 opacity, quint8 parentOpacity) |
| void | mirrorDab (Qt::Orientation dir, const QPoint ¢er, KisRenderedDab *dab, bool skipMirrorPixels) |
| void | mirrorDab (Qt::Orientation dir, const QPointF ¢er, KisRenderedDab *dab, bool skipMirrorPixels) |
| void | mirrorPoint (Qt::Orientation dir, const QPoint ¢er, QPointF *pt) |
| void | mirrorPoint (Qt::Orientation dir, const QPointF ¢er, QPointF *pt) |
| void | mirrorRect (Qt::Orientation dir, const QPoint ¢er, QRect *rc) |
| void | mirrorRect (Qt::Orientation dir, const QPointF ¢er, QRect *rc) |
| KisNodeSP | nearestNodeAfterRemoval (KisNodeSP node) |
| QSize | optimalPatchSize () |
| QTransform | pathShapeBooleanSpaceWorkaround (KisImageSP image) |
| QString KRITAIMAGE_EXPORT | prettyFormatReal (qreal value) |
| template<class PixelProcessor > | |
| void | processTwoDevices (const QRect &rc, KisRandomConstAccessorSP srcIt, KisRandomAccessorSP dstIt, const int srcPixelSize, const int dstPixelSize, PixelProcessor pixelProcessor) |
| template<class PixelProcessor > | |
| void | processTwoDevicesWithStrides (const QRect &rc, KisRandomConstAccessorSP srcIt, KisRandomAccessorSP dstIt, PixelProcessor pixelProcessor) |
| QVector< QPoint > | rasterizeHLine (const QPoint &startPoint, const QPoint &endPoint) |
| template<typename Visitor > | |
| void | rasterizeHLine (const QPoint &startPoint, const QPoint &endPoint, Visitor visitor) |
| QVector< QPoint > | rasterizeLineDDA (const QPoint &startPoint, const QPoint &endPoint) |
| template<typename Visitor > | |
| void | rasterizeLineDDA (const QPoint &startPoint, const QPoint &endPoint, Visitor visitor) |
| QVector< QPoint > | rasterizePolygonDDA (const QVector< QPoint > &polygonPoints) |
| template<typename Visitor > | |
| void | rasterizePolygonDDA (const QVector< QPoint > &polygonPoints, Visitor visitor) |
| QVector< QPoint > | rasterizePolylineDDA (const QVector< QPoint > &polylinePoints) |
| template<typename Visitor > | |
| void | rasterizePolylineDDA (const QVector< QPoint > &polylinePoints, Visitor visitor) |
| QVector< QPoint > | rasterizeVLine (const QPoint &startPoint, const QPoint &endPoint) |
| template<typename Visitor > | |
| void | rasterizeVLine (const QPoint &startPoint, const QPoint &endPoint, Visitor visitor) |
| void | renderExactRect (QPainter *p, const QRect &rc) |
| void | renderExactRect (QPainter *p, const QRect &rc, const QPen &pen) |
| QString | resolveAbsoluteFilePath (const QString &baseDir, const QString &filePath) |
| Resolve absolute file path from a file path and base dir. | |
| void | restoreControlPoint (KoPathPoint *pt, bool restoreFirst, boost::optional< QPointF > savedPoint) |
| QList< QPainterPath > | splitDisjointPaths (const QPainterPath &path) |
| KisRegion | splitPath (const QPainterPath &path) |
| QVector< QRect > | splitRectIntoPatches (const QRect &rc, const QSize &patchSize) |
| QVector< QRect > | splitRectIntoPatchesTight (const QRect &rc, const QSize &patchSize) |
| QVector< QRect > | splitRegionIntoPatches (const KisRegion ®ion, const QSize &patchSize) |
| QVector< QRect > KRITAIMAGE_EXPORT | splitRegionIntoPatches (const QRegion ®ion, const QSize &patchSize) |
| KisRegion | splitTriangles (const QPointF ¢er, const QVector< QPointF > &points) |
| void | thresholdOpacity (KisPaintDeviceSP device, const QRect &rect, ThresholdMode mode) |
| void | thresholdOpacityAlpha8 (KisPaintDeviceSP device, const QRect &rect, ThresholdMode mode) |
| QString KRITAIMAGE_EXPORT | toLocalizedOnOff (bool value) |
| QPainterPath | tryCloseTornSubpathsAfterIntersection (QPainterPath path) |
| bool | tryMergePoints (QPainterPath &path, const QPointF &startPoint, const QPointF &endPoint, qreal &distance, qreal distanceThreshold, bool lastSegment) |
| QPainterPath | trySimplifyPath (const QPainterPath &path, qreal lengthThreshold) |
| KisImportExportErrorCode | workaroundUnsuitableImageColorSpace (KisImageSP image, KisImportUserFeedbackInterface *feedbackInterface, KisImageBarrierLock &lock) |
| Enumerator | |
|---|---|
| Success | |
| Failure | |
| AnotherSavingInProgress | |
| ImageLockFailure | |
Definition at line 31 of file KisImportExportUtils.h.
| Enumerator | |
|---|---|
| CopySnapshot | |
| CopyAllFrames | |
Definition at line 51 of file kis_paint_device.h.
| enum KritaUtils::SaveFlag |
| Enumerator | |
|---|---|
| SaveNone | |
| SaveShowWarnings | |
| SaveIsExporting | |
| SaveInAutosaveMode | |
Definition at line 24 of file KisImportExportUtils.h.
| Enumerator | |
|---|---|
| ThresholdNone | |
| ThresholdFloor | |
| ThresholdCeil | |
| ThresholdMaxOut | |
Definition at line 131 of file krita_utils.h.
| void KritaUtils::addJobBarrier | ( | QVector< Job * > & | jobs, |
| Func | func ) |
Definition at line 35 of file KisRunnableStrokeJobUtils.h.
References KisStrokeJobData::BARRIER.
| void KritaUtils::addJobBarrier | ( | QVector< Job * > & | jobs, |
| int | lod, | ||
| Func | func ) |
Definition at line 71 of file KisRunnableStrokeJobUtils.h.
References KisStrokeJobData::BARRIER.
| void KritaUtils::addJobBarrierExclusive | ( | QVector< Job * > & | jobs, |
| Func | func ) |
Definition at line 40 of file KisRunnableStrokeJobUtils.h.
References KisStrokeJobData::BARRIER, and KisStrokeJobData::EXCLUSIVE.
| void KritaUtils::addJobBarrierExclusiveNoCancel | ( | QVector< Job * > & | jobs, |
| Func | func ) |
Definition at line 115 of file KisRunnableStrokeJobUtils.h.
References KisStrokeJobData::BARRIER, and KisStrokeJobData::EXCLUSIVE.
| void KritaUtils::addJobBarrierNoCancel | ( | QVector< Job * > & | jobs, |
| Func | func ) |
Definition at line 108 of file KisRunnableStrokeJobUtils.h.
References KisStrokeJobData::BARRIER.
| void KritaUtils::addJobConcurrent | ( | QVector< Job * > & | jobs, |
| Func | func ) |
Definition at line 30 of file KisRunnableStrokeJobUtils.h.
References KisStrokeJobData::CONCURRENT.
| void KritaUtils::addJobConcurrent | ( | QVector< Job * > & | jobs, |
| int | lod, | ||
| Func | func ) |
Definition at line 64 of file KisRunnableStrokeJobUtils.h.
References KisStrokeJobData::CONCURRENT.
| void KritaUtils::addJobConcurrentNoCancel | ( | QVector< Job * > & | jobs, |
| Func | func ) |
Definition at line 101 of file KisRunnableStrokeJobUtils.h.
References KisStrokeJobData::CONCURRENT.
| void KritaUtils::addJobSequential | ( | QVector< Job * > & | jobs, |
| Func | func ) |
Definition at line 19 of file KisRunnableStrokeJobUtils.h.
References KisStrokeJobData::SEQUENTIAL.
| void KritaUtils::addJobSequential | ( | QVector< Job * > & | jobs, |
| int | lod, | ||
| Func | func ) |
Definition at line 50 of file KisRunnableStrokeJobUtils.h.
References KisStrokeJobData::SEQUENTIAL.
| void KritaUtils::addJobSequentialExclusive | ( | QVector< Job * > & | jobs, |
| Func | func ) |
Definition at line 24 of file KisRunnableStrokeJobUtils.h.
References KisStrokeJobData::EXCLUSIVE, and KisStrokeJobData::SEQUENTIAL.
| void KritaUtils::addJobSequentialExclusive | ( | QVector< Job * > & | jobs, |
| int | lod, | ||
| Func | func ) |
Definition at line 57 of file KisRunnableStrokeJobUtils.h.
References KisStrokeJobData::EXCLUSIVE, and KisStrokeJobData::SEQUENTIAL.
| void KritaUtils::addJobSequentialExclusiveNoCancel | ( | QVector< Job * > & | jobs, |
| Func | func ) |
Definition at line 93 of file KisRunnableStrokeJobUtils.h.
References KisStrokeJobData::EXCLUSIVE, and KisStrokeJobData::SEQUENTIAL.
| void KritaUtils::addJobSequentialNoCancel | ( | QVector< Job * > & | jobs, |
| Func | func ) |
Definition at line 86 of file KisRunnableStrokeJobUtils.h.
References KisStrokeJobData::SEQUENTIAL.
| void KritaUtils::addJobUniquelyConcurrent | ( | QVector< Job * > & | jobs, |
| Func | func ) |
Definition at line 45 of file KisRunnableStrokeJobUtils.h.
References KisStrokeJobData::UNIQUELY_CONCURRENT.
| void KritaUtils::addJobUniquelyConcurrent | ( | QVector< Job * > & | jobs, |
| int | lod, | ||
| Func | func ) |
Definition at line 78 of file KisRunnableStrokeJobUtils.h.
References KisStrokeJobData::UNIQUELY_CONCURRENT.
| void KritaUtils::addJobUniquelyConcurrentNoCancel | ( | QVector< Job * > & | jobs, |
| Func | func ) |
Definition at line 122 of file KisRunnableStrokeJobUtils.h.
References KisStrokeJobData::UNIQUELY_CONCURRENT.
| void KRITAIMAGE_EXPORT KritaUtils::applyToAlpha8Device | ( | KisPaintDeviceSP | dev, |
| const QRect & | rc, | ||
| std::function< void(quint8)> | func ) |
Definition at line 407 of file krita_utils.cpp.
References KisSequentialIteratorBase< IteratorPolicy, SourcePolicy, ProgressPolicy >::nextPixel(), and KisSequentialIteratorBase< IteratorPolicy, SourcePolicy, ProgressPolicy >::rawDataConst().
| bool KritaUtils::checkInTriangle | ( | const QRectF & | rect, |
| const QPolygonF & | triangle ) |
Definition at line 97 of file krita_utils.cpp.
| bool KRITAIMAGE_EXPORT KritaUtils::compareChannelFlags | ( | QBitArray | f1, |
| QBitArray | f2 ) |
Definition at line 343 of file krita_utils.cpp.
| bool KritaUtils::compareListsUnordered | ( | const QList< T > & | a, |
| const QList< T > & | b ) |
Definition at line 17 of file krita_container_utils.h.
| QImage KRITAIMAGE_EXPORT KritaUtils::convertQImageToGrayA | ( | const QImage & | image | ) |
Definition at line 390 of file krita_utils.cpp.
| qreal KRITAIMAGE_EXPORT KritaUtils::estimatePortionOfTransparentPixels | ( | KisPaintDeviceSP | dev, |
| const QRect & | rect, | ||
| qreal | samplePortion ) |
Definition at line 423 of file krita_utils.cpp.
References KisPaintDevice::colorSpace(), KisPaintDevice::createRandomConstAccessorNG(), KisRandomConstAccessorNG::moveTo(), OPACITY_OPAQUE_U8, KoColorSpace::opacityU8(), and KisBaseConstAccessor::rawDataConst().
| boost::optional< QPointF > KritaUtils::fetchControlPoint | ( | KoPathPoint * | pt, |
| bool | takeFirst ) |
Definition at line 11 of file KoPathMergeUtils.cpp.
References KoPathPoint::activeControlPoint1, KoPathPoint::activeControlPoint2, KoPathPoint::controlPoint1, and KoPathPoint::controlPoint2.
| void KRITAIMAGE_EXPORT KritaUtils::filterAlpha8Device | ( | KisPaintDeviceSP | dev, |
| const QRect & | rc, | ||
| std::function< quint8(quint8)> | func ) |
Definition at line 415 of file krita_utils.cpp.
References KisSequentialIteratorBase< IteratorPolicy, SourcePolicy, ProgressPolicy >::nextPixel(), and KisSequentialIteratorBase< IteratorPolicy, SourcePolicy, ProgressPolicy >::rawData().
| auto KritaUtils::filterContainer | ( | C & | container, |
| KeepIfFunction | keepIf ) -> decltype(bool(keepIf(container[0])), void()) |
Definition at line 39 of file krita_container_utils.h.
References p.
Definition at line 28 of file krita_container_utils.h.
| void KritaUtils::makeSymmetric | ( | KoPathPoint * | pt, |
| bool | copyFromFirst ) |
Definition at line 28 of file KoPathMergeUtils.cpp.
References KoPathPoint::activeControlPoint1, KoPathPoint::activeControlPoint2, KoPathPoint::controlPoint1, KoPathPoint::controlPoint2, KoPathPoint::IsSymmetric, KoPathPoint::point, KoPathPoint::setControlPoint1(), KoPathPoint::setControlPoint2(), and KoPathPoint::setProperty().
| qreal KRITAIMAGE_EXPORT KritaUtils::maxDimensionPortion | ( | const QRectF & | bounds, |
| qreal | portion, | ||
| qreal | minValue ) |
Definition at line 190 of file krita_utils.cpp.
References bounds.
| QBitArray KRITAIMAGE_EXPORT KritaUtils::mergeChannelFlags | ( | const QBitArray & | childFlags, |
| const QBitArray & | parentFlags ) |
Definition at line 326 of file krita_utils.cpp.
| qreal KRITAIMAGE_EXPORT KritaUtils::mergeOpacityF | ( | qreal | opacity, |
| qreal | parentOpacity ) |
Definition at line 318 of file krita_utils.cpp.
References OPACITY_OPAQUE_F, and qFuzzyCompare().
| quint8 KRITAIMAGE_EXPORT KritaUtils::mergeOpacityU8 | ( | quint8 | opacity, |
| quint8 | parentOpacity ) |
Definition at line 310 of file krita_utils.cpp.
References OPACITY_OPAQUE_U8.
| void KRITAIMAGE_EXPORT KritaUtils::mirrorDab | ( | Qt::Orientation | dir, |
| const QPoint & | center, | ||
| KisRenderedDab * | dab, | ||
| bool | skipMirrorPixels ) |
Definition at line 454 of file krita_utils.cpp.
References KisRenderedDab::device, KisFixedPaintDevice::mirror(), KisRenderedDab::offset, and KisRenderedDab::realBounds().
| void KRITAIMAGE_EXPORT KritaUtils::mirrorDab | ( | Qt::Orientation | dir, |
| const QPointF & | center, | ||
| KisRenderedDab * | dab, | ||
| bool | skipMirrorPixels ) |
Definition at line 475 of file krita_utils.cpp.
References KisRenderedDab::device, KisFixedPaintDevice::mirror(), KisRenderedDab::offset, and KisRenderedDab::realBounds().
| void KRITAIMAGE_EXPORT KritaUtils::mirrorPoint | ( | Qt::Orientation | dir, |
| const QPoint & | center, | ||
| QPointF * | pt ) |
Definition at line 518 of file krita_utils.cpp.
| void KRITAIMAGE_EXPORT KritaUtils::mirrorPoint | ( | Qt::Orientation | dir, |
| const QPointF & | center, | ||
| QPointF * | pt ) |
Definition at line 527 of file krita_utils.cpp.
| void KRITAIMAGE_EXPORT KritaUtils::mirrorRect | ( | Qt::Orientation | dir, |
| const QPoint & | center, | ||
| QRect * | rc ) |
Definition at line 496 of file krita_utils.cpp.
| void KRITAIMAGE_EXPORT KritaUtils::mirrorRect | ( | Qt::Orientation | dir, |
| const QPointF & | center, | ||
| QRect * | rc ) |
Definition at line 507 of file krita_utils.cpp.
Definition at line 362 of file krita_utils.cpp.
References KisNode::nextSibling(), KisNode::parent, and KisNode::prevSibling().
| QSize KRITAIMAGE_EXPORT KritaUtils::optimalPatchSize | ( | ) |
Definition at line 35 of file krita_utils.cpp.
References KisImageConfig::updatePatchHeight(), and KisImageConfig::updatePatchWidth().
| QTransform KRITAIMAGE_EXPORT KritaUtils::pathShapeBooleanSpaceWorkaround | ( | KisImageSP | image | ) |
Returns a special transformation that converts vector shape coordinates ('pt') into a special coordinate space, where all path boolean operations should happen.
The problem is that Qt's path boolean operation do not support curves, therefore all the curves are converted into lines (see QPathSegments::addPath()). The curves are split into lines using absolute size of the curve for the threshold. Therefore, when applying boolean operations we should convert them into 'image pixel' coordinate space first.
See https://bugs.kde.org/show_bug.cgi?id=411056
Definition at line 536 of file krita_utils.cpp.
References KisImage::xRes(), and KisImage::yRes().
| QString KRITAIMAGE_EXPORT KritaUtils::prettyFormatReal | ( | qreal | value | ) |
| void KritaUtils::processTwoDevices | ( | const QRect & | rc, |
| KisRandomConstAccessorSP | srcIt, | ||
| KisRandomAccessorSP | dstIt, | ||
| const int | srcPixelSize, | ||
| const int | dstPixelSize, | ||
| PixelProcessor | pixelProcessor ) |
this is a special helper function for iterating through pixels in an extremely efficient way. One should either pass a functor or a lambda to it.
Definition at line 22 of file KisFastDeviceProcessingUtils.h.
References KisRandomConstAccessorNG::moveTo(), KisRandomConstAccessorNG::numContiguousColumns(), KisRandomConstAccessorNG::numContiguousRows(), KisBaseAccessor::rawData(), KisBaseConstAccessor::rawDataConst(), and KisRandomConstAccessorNG::rowStride().
| void KritaUtils::processTwoDevicesWithStrides | ( | const QRect & | rc, |
| KisRandomConstAccessorSP | srcIt, | ||
| KisRandomAccessorSP | dstIt, | ||
| PixelProcessor | pixelProcessor ) |
this is a special helper function for iterating through pixels in an extremely efficient way using strides. One should either pass a functor or a lambda to it.
Definition at line 86 of file KisFastDeviceProcessingUtils.h.
References KisRandomConstAccessorNG::moveTo(), KisRandomConstAccessorNG::numContiguousColumns(), KisRandomConstAccessorNG::numContiguousRows(), KisBaseAccessor::rawData(), KisBaseConstAccessor::rawDataConst(), and KisRandomConstAccessorNG::rowStride().
| QVector< QPoint > KRITAIMAGE_EXPORT KritaUtils::rasterizeHLine | ( | const QPoint & | startPoint, |
| const QPoint & | endPoint ) |
Definition at line 603 of file krita_utils.cpp.
References rasterizeHLine().
| void KritaUtils::rasterizeHLine | ( | const QPoint & | startPoint, |
| const QPoint & | endPoint, | ||
| Visitor | visitor ) |
Definition at line 142 of file krita_utils.h.
| QVector< QPoint > KRITAIMAGE_EXPORT KritaUtils::rasterizeLineDDA | ( | const QPoint & | startPoint, |
| const QPoint & | endPoint ) |
Definition at line 617 of file krita_utils.cpp.
References rasterizeLineDDA().
| void KritaUtils::rasterizeLineDDA | ( | const QPoint & | startPoint, |
| const QPoint & | endPoint, | ||
| Visitor | visitor ) |
Definition at line 176 of file krita_utils.h.
References rasterizeHLine(), and rasterizeVLine().
| QVector< QPoint > KRITAIMAGE_EXPORT KritaUtils::rasterizePolygonDDA | ( | const QVector< QPoint > & | polygonPoints | ) |
Definition at line 631 of file krita_utils.cpp.
References rasterizePolygonDDA().
| void KritaUtils::rasterizePolygonDDA | ( | const QVector< QPoint > & | polygonPoints, |
| Visitor | visitor ) |
Definition at line 260 of file krita_utils.h.
References rasterizeLineDDA(), and rasterizePolylineDDA().
| QVector< QPoint > KRITAIMAGE_EXPORT KritaUtils::rasterizePolylineDDA | ( | const QVector< QPoint > & | polylinePoints | ) |
Definition at line 624 of file krita_utils.cpp.
References rasterizePolylineDDA().
| void KritaUtils::rasterizePolylineDDA | ( | const QVector< QPoint > & | polylinePoints, |
| Visitor | visitor ) |
Definition at line 230 of file krita_utils.h.
References rasterizeLineDDA().
| QVector< QPoint > KRITAIMAGE_EXPORT KritaUtils::rasterizeVLine | ( | const QPoint & | startPoint, |
| const QPoint & | endPoint ) |
Definition at line 610 of file krita_utils.cpp.
References rasterizeVLine().
| void KritaUtils::rasterizeVLine | ( | const QPoint & | startPoint, |
| const QPoint & | endPoint, | ||
| Visitor | visitor ) |
Definition at line 159 of file krita_utils.h.
| void KRITAIMAGE_EXPORT KritaUtils::renderExactRect | ( | QPainter * | p, |
| const QRect & | rc ) |
When drawing a rect Qt uses quite a weird algorithm. It draws 4 lines: o at X-es: rect.x() and rect.right() + 1 o at Y-s: rect.y() and rect.bottom() + 1
Which means that bottom and right lines of the rect are painted outside the virtual rectangle the rect defines. This methods overcome this issue by painting the adjusted rect.
Definition at line 377 of file krita_utils.cpp.
References p.
| void KRITAIMAGE_EXPORT KritaUtils::renderExactRect | ( | QPainter * | p, |
| const QRect & | rc, | ||
| const QPen & | pen ) |
Definition at line 382 of file krita_utils.cpp.
References p, and renderExactRect().
| QString KRITAGLOBAL_EXPORT KritaUtils::resolveAbsoluteFilePath | ( | const QString & | baseDir, |
| const QString & | filePath ) |
Resolve absolute file path from a file path and base dir.
If the filePath is absolute, just return this path, otherwise try to merge baseDir and filePath to form an absolute file path
Definition at line 15 of file KisFileUtils.cpp.
| void KritaUtils::restoreControlPoint | ( | KoPathPoint * | pt, |
| bool | restoreFirst, | ||
| boost::optional< QPointF > | savedPoint ) |
Definition at line 43 of file KoPathMergeUtils.cpp.
References KoPathPoint::removeControlPoint1(), KoPathPoint::removeControlPoint2(), KoPathPoint::setControlPoint1(), and KoPathPoint::setControlPoint2().
| QList< QPainterPath > KRITAIMAGE_EXPORT KritaUtils::splitDisjointPaths | ( | const QPainterPath & | path | ) |
Split a path path into a set of disjoint (non-intersectable) paths if possible.
It tries to follow odd-even fill rule, but has a small problem: If you have three selections included into each other twice, then the smallest selection will be included into the final subpath, although it shouldn't according to odd-even-fill rule. It is still to be fixed.
Definition at line 279 of file krita_utils.cpp.
| KRITAIMAGE_EXPORT KisRegion KritaUtils::splitPath | ( | const QPainterPath & | path | ) |
Definition at line 153 of file krita_utils.cpp.
| QVector< QRect > KRITAIMAGE_EXPORT KritaUtils::splitRectIntoPatches | ( | const QRect & | rc, |
| const QSize & | patchSize ) |
Definition at line 42 of file krita_utils.cpp.
| QVector< QRect > KRITAIMAGE_EXPORT KritaUtils::splitRectIntoPatchesTight | ( | const QRect & | rc, |
| const QSize & | patchSize ) |
Definition at line 71 of file krita_utils.cpp.
| QVector< QRect > KRITAIMAGE_EXPORT KritaUtils::splitRegionIntoPatches | ( | const KisRegion & | region, |
| const QSize & | patchSize ) |
Definition at line 86 of file krita_utils.cpp.
References KisRegion::rects(), and splitRectIntoPatches().
| QVector< QRect > KRITAIMAGE_EXPORT KritaUtils::splitRegionIntoPatches | ( | const QRegion & | region, |
| const QSize & | patchSize ) |
| KRITAIMAGE_EXPORT KisRegion KritaUtils::splitTriangles | ( | const QPointF & | center, |
| const QVector< QPointF > & | points ) |
Definition at line 104 of file krita_utils.cpp.
References checkInTriangle().
| void KritaUtils::thresholdOpacity | ( | KisPaintDeviceSP | device, |
| const QRect & | rect, | ||
| ThresholdMode | mode ) |
Definition at line 558 of file krita_utils.cpp.
References KisPaintDevice::colorSpace(), KisSequentialIteratorBase< IteratorPolicy, SourcePolicy, ProgressPolicy >::nConseqPixels(), KisSequentialIteratorBase< IteratorPolicy, SourcePolicy, ProgressPolicy >::nextPixel(), KisSequentialIteratorBase< IteratorPolicy, SourcePolicy, ProgressPolicy >::nextPixels(), KoColorSpace::opacityU8(), KisSequentialIteratorBase< IteratorPolicy, SourcePolicy, ProgressPolicy >::rawData(), KisSequentialIteratorBase< IteratorPolicy, SourcePolicy, ProgressPolicy >::rawDataConst(), KoColorSpace::setOpacity(), ThresholdCeil, ThresholdFloor, and ThresholdMaxOut.
| void KritaUtils::thresholdOpacityAlpha8 | ( | KisPaintDeviceSP | device, |
| const QRect & | rect, | ||
| ThresholdMode | mode ) |
Definition at line 586 of file krita_utils.cpp.
References KisPaintDevice::colorSpace(), KisPaintDevice::fill(), filterAlpha8Device(), ThresholdCeil, ThresholdFloor, ThresholdMaxOut, and value().
| QString KRITAIMAGE_EXPORT KritaUtils::toLocalizedOnOff | ( | bool | value | ) |
Definition at line 358 of file krita_utils.cpp.
References value().
| QPainterPath KRITAIMAGE_EXPORT KritaUtils::tryCloseTornSubpathsAfterIntersection | ( | QPainterPath | path | ) |
Sometimes, when intersecting two paths, QPainterPath does not close some of the subpaths. It causes glitches when rendering them on screen. So we should just close them explicitly.
Note: after intersecting the paths all bezier curves are already converted to polylines, so it should be safe to go through the polygons.
See: https://bugs.kde.org/show_bug.cgi?id=408369
Definition at line 541 of file krita_utils.cpp.
References ENTER_FUNCTION, and ppVar.
| bool KritaUtils::tryMergePoints | ( | QPainterPath & | path, |
| const QPointF & | startPoint, | ||
| const QPointF & | endPoint, | ||
| qreal & | distance, | ||
| qreal | distanceThreshold, | ||
| bool | lastSegment ) |
Definition at line 196 of file krita_utils.cpp.
References distance(), and length().
| QPainterPath KRITAIMAGE_EXPORT KritaUtils::trySimplifyPath | ( | const QPainterPath & | path, |
| qreal | lengthThreshold ) |
Definition at line 231 of file krita_utils.cpp.
References distance(), and tryMergePoints().
| KisImportExportErrorCode KRITAUI_EXPORT KritaUtils::workaroundUnsuitableImageColorSpace | ( | KisImageSP | image, |
| KisImportUserFeedbackInterface * | feedbackInterface, | ||
| KisImageBarrierLock & | lock ) |
When the image has a colorspace that is not suitable for displaying, Krita should convert that into something more useful. This tool function asks the user about the desired working color space and converts into it.
The profile has no reverse mapping into for the described color space, so we cannot use it in Krita. We need to ask the user to convert the image right on loading
Here is an extremely tricky part! First we start the conversion stroke, and only after that we unlock the image. The point is that KisDelayedUpdateNodeInterface-based nodes are forbidden to start their update jobs while the image is locked, so this guarantees that no stroke will be started before we actually convert the image into something usable
Definition at line 18 of file KisImportExportUtils.cpp.
References KisImportUserFeedbackInterface::askUser(), ImportExportCodes::Cancelled, KoColorSpace::colorDepthId(), KoColorSpace::colorModelId(), KisImage::colorSpace(), KisColorSpaceConversionDialog::colorSpace(), KoColorSpaceRegistry::colorSpace(), KisColorSpaceConversionDialog::conversionFlags(), KisColorSpaceConversionDialog::conversionIntent(), KisImage::convertImageColorSpace(), ImportExportCodes::FormatColorSpaceUnsupported, KoID::id(), KoColorSpaceRegistry::instance(), KoColorConversionTransformation::internalConversionFlags(), KoColorConversionTransformation::internalRenderingIntent(), KoColorProfile::isSuitableForOutput(), KIS_SAFE_ASSERT_RECOVER_NOOP, KisColorSpaceConversionDialog::m_page, KoColorProfile::name, ImportExportCodes::OK, KoColorSpace::profile(), KoDialog::setCaption(), KisColorSpaceConversionDialog::setInitialColorSpace(), KisImportUserFeedbackInterface::SuppressedByBatchMode, KisImportUserFeedbackInterface::UserCancelled, and KisImage::waitForDone().