Krita Source Code Documentation
Loading...
Searching...
No Matches
PathQualityChecker Struct Reference

#include <KoColorConversionSystem_p.h>

Public Member Functions

bool isGoodPath (const KoColorConversionSystem::Path &path) const
 
bool lessWorseThan (const KoColorConversionSystem::Path &path1, const KoColorConversionSystem::Path &path2) const
 
 PathQualityChecker (int _referenceDepth)
 

Public Attributes

int referenceDepth
 

Detailed Description

Definition at line 333 of file KoColorConversionSystem_p.h.

Constructor & Destructor Documentation

◆ PathQualityChecker()

PathQualityChecker::PathQualityChecker ( int _referenceDepth)
inline

Definition at line 335 of file KoColorConversionSystem_p.h.

336 : referenceDepth(_referenceDepth)
337 {}

Member Function Documentation

◆ isGoodPath()

bool PathQualityChecker::isGoodPath ( const KoColorConversionSystem::Path & path) const
inline
Returns
true if the path maximize all the criteria (except length)

Definition at line 340 of file KoColorConversionSystem_p.h.

340 {
341 return path.unsupportedCapabilities() == None &&
342 path.referenceDepth >= referenceDepth;
343 }

References None.

◆ lessWorseThan()

bool PathQualityChecker::lessWorseThan ( const KoColorConversionSystem::Path & path1,
const KoColorConversionSystem::Path & path2 ) const
inline

Compare two paths.

Definition at line 348 of file KoColorConversionSystem_p.h.

348 {
349 // There is no point in comparing two paths which doesn't start from the same node or doesn't end at the same node
350
351 NodeCapabilities unsupported1 = path1.unsupportedCapabilities();
352 NodeCapabilities unsupported2 = path2.unsupportedCapabilities();
353
354 if (!unsupported1.testFlag(HasHdr) && unsupported2.testFlag(HasHdr)) {
355 return true;
356 }
357
358 if (!unsupported1.testFlag(HasColor) && unsupported2.testFlag(HasColor)) {
359 return true;
360 }
361
362 if (!unsupported1.testFlag(HasAlpha) && unsupported2.testFlag(HasAlpha)) {
363 return true;
364 }
365
366 if (path1.referenceDepth == path2.referenceDepth) {
367 return path1.cost < path2.cost; // if they have the same cost, well anyway you have to choose one, and there is no point in keeping one and not the other
368 }
369 return path1.referenceDepth > path2.referenceDepth;
370 }
NodeCapabilities unsupportedCapabilities() const

References KoColorConversionSystem::Path::cost, HasAlpha, HasColor, HasHdr, KoColorConversionSystem::Path::referenceDepth, and KoColorConversionSystem::Path::unsupportedCapabilities().

Member Data Documentation

◆ referenceDepth

int PathQualityChecker::referenceDepth

Definition at line 371 of file KoColorConversionSystem_p.h.


The documentation for this struct was generated from the following file: