Skip to content

Commit

Permalink
uncrustify
Browse files Browse the repository at this point in the history
  • Loading branch information
devernay committed May 10, 2016
1 parent 7e12ebb commit 5f27818
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 32 deletions.
2 changes: 1 addition & 1 deletion Keyer/Keyer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -279,7 +279,7 @@ class KeyerProcessorBase
return ( Kfg - (_center + _toleranceLower + _softnessLower) ) / -_softnessLower;
} else if (Kfg <= _center + _toleranceUpper) {
return 1.;
} else if ( ( 1. <= (_center + _toleranceUpper) ) && (1. <= Kfg) ) { // special case: everything above 1 is 1. if center+toleranceUpper>=1
} else if ( ( 1. <= (_center + _toleranceUpper) ) && (1. <= Kfg) ) { // special case: everything above 1 is 1. if center+toleranceUpper>=1
return 1.;
} else if ( ( Kfg < (_center + _toleranceUpper + _softnessUpper) ) && (_softnessUpper > 0.) ) {
return ( (_center + _toleranceUpper + _softnessUpper) - Kfg ) / _softnessUpper;
Expand Down
1 change: 0 additions & 1 deletion Shadertoy/Shadertoy.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -915,7 +915,6 @@ ShadertoyPluginFactory::describe(OFX::ImageEffectDescriptor &desc)
#ifdef OFX_EXTENSIONS_NATRON
desc.setChannelSelector(ePixelComponentNone);
#endif

} // ShadertoyPluginFactory::describe

void
Expand Down
57 changes: 27 additions & 30 deletions TrackerPM/TrackerPM.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -83,17 +83,17 @@ class TrackerPMPlugin
public:
/** @brief ctor */
TrackerPMPlugin(OfxImageEffectHandle handle)
: GenericTrackerPlugin(handle)
, _score(0)
, _center(0)
, _offset(0)
, _referenceFrame(0)
, _enableReferenceFrame(0)
, _correlationScore(0)
, _innerBtmLeft(0)
, _innerTopRight(0)
, _outerBtmLeft(0)
, _outerTopRight(0)
: GenericTrackerPlugin(handle)
, _score(0)
, _center(0)
, _offset(0)
, _referenceFrame(0)
, _enableReferenceFrame(0)
, _correlationScore(0)
, _innerBtmLeft(0)
, _innerTopRight(0)
, _outerBtmLeft(0)
, _outerTopRight(0)
{
_maskClip = fetchClip(getContext() == OFX::eContextPaint ? "Brush" : "Mask");
assert(!_maskClip || _maskClip->getPixelComponents() == ePixelComponentAlpha);
Expand Down Expand Up @@ -557,17 +557,15 @@ TrackerPMPlugin::trackRange(const OFX::TrackArguments& args)
}

bool enableRefFrame = _enableReferenceFrame->getValue();

while ( args.forward ? (t <= args.last) : (t >= args.last) ) {


OfxTime refFrame;
if (enableRefFrame) {
refFrame = (OfxTime)_referenceFrame->getValueAtTime(t);
} else {
refFrame = args.forward ? (t - 1) : (t + 1);
}


OFX::PixelComponentEnum srcComponents = _srcClip->getPixelComponents();
assert(srcComponents == OFX::ePixelComponentRGB || srcComponents == OFX::ePixelComponentRGBA ||
Expand Down Expand Up @@ -763,9 +761,8 @@ TrackerPMPlugin::setupAndProcess(TrackerPMProcessorBase &processor,
_center->setValueAtTime(refTime, refCenter.x, refCenter.y);
// create a keyframe at end point
_center->setValueAtTime(otherTime, newCenter.x - otherOffset.x, newCenter.y - otherOffset.y);
_correlationScore->setValueAtTime(otherTime, processor.getBestScore());
// endEditBlock();

_correlationScore->setValueAtTime( otherTime, processor.getBestScore() );
// endEditBlock();
}
}
} // TrackerPMPlugin::setupAndProcess
Expand Down Expand Up @@ -831,17 +828,17 @@ TrackerPMPlugin::trackInternal(OfxTime refTime,
OfxPointD refCenterWithOffset;
refCenterWithOffset.x = refCenter.x + offset.x;
refCenterWithOffset.y = refCenter.y + offset.y;

// The search window should be centered around the last keyframe we set to the center
OfxPointD prevTimeCenterWithOffset;
_center->getValueAtTime(otherTime, prevTimeCenterWithOffset.x, prevTimeCenterWithOffset.y);

OfxPointD offsetPrevTime;
_offset->getValueAtTime(otherTime, offsetPrevTime.x, offsetPrevTime.y);

prevTimeCenterWithOffset.x += offsetPrevTime.x;
prevTimeCenterWithOffset.y += offsetPrevTime.y;


OfxRectD refBounds;
getRefBounds(refRect, refCenterWithOffset, &refBounds);
Expand Down Expand Up @@ -940,12 +937,12 @@ TrackerPMPluginFactory::describe(OFX::ImageEffectDescriptor &desc)
desc.setRenderTwiceAlways(true);
desc.setRenderThreadSafety(kRenderThreadSafety);
desc.setOverlayInteractDescriptor(new TrackerRegionOverlayDescriptor);

#ifdef OFX_EXTENSIONS_NATRON
// This plug-in is deprecated since Natron has its new tracker implementation
if (OFX::getImageEffectHostDescription()->isNatron &&
OFX::getImageEffectHostDescription()->versionMajor >= 2 &&
OFX::getImageEffectHostDescription()->versionMinor >= 1) {
if ( OFX::getImageEffectHostDescription()->isNatron &&
( OFX::getImageEffectHostDescription()->versionMajor >= 2) &&
( OFX::getImageEffectHostDescription()->versionMinor >= 1) ) {
desc.setIsDeprecated(true);
}
#endif
Expand Down Expand Up @@ -998,7 +995,7 @@ TrackerPMPluginFactory::describeInContext(OFX::ImageEffectDescriptor &desc,
page->addChild(*param);
}
}

// ref
{
OFX::IntParamDescriptor* param = desc.defineIntParam(kParamTrackingReferenceFrame);
Expand All @@ -1010,7 +1007,7 @@ TrackerPMPluginFactory::describeInContext(OFX::ImageEffectDescriptor &desc,
page->addChild(*param);
}
}

// enable ref
{
OFX::BooleanParamDescriptor* param = desc.defineBooleanParam(kParamTrackingEnableReferenceFrame);
Expand All @@ -1022,7 +1019,7 @@ TrackerPMPluginFactory::describeInContext(OFX::ImageEffectDescriptor &desc,
page->addChild(*param);
}
}

// correlation score
{
OFX::DoubleParamDescriptor* param = desc.defineDoubleParam(kParamTrackingCorrelationScore);
Expand All @@ -1034,7 +1031,7 @@ TrackerPMPluginFactory::describeInContext(OFX::ImageEffectDescriptor &desc,
page->addChild(*param);
}
}


// innerBtmLeft
{
Expand Down

0 comments on commit 5f27818

Please sign in to comment.