From 3eded34e1d0f6274056c26a34ee8d6f6ca68a054 Mon Sep 17 00:00:00 2001 From: Aaron Colwell <300262+acolwell@users.noreply.github.com> Date: Tue, 12 Sep 2023 11:51:29 -0700 Subject: [PATCH 01/31] Refactor RenderScale (#920) * Refactored RenderScale - Moved declaration to its own file. - Removed inheritance from OfxPointD so implementation could be changed. - Made data members private to hide implementation and created helper methods to capture common use patterns. - Change TrackerNodeInteract::selectedMarkerScale to a double since it didn't really need to be a RenderScale. - Added named constant for RenderScale with x & y set to 1. - Convert RenderScale implementation to mipmapLevel. --- Engine/EffectInstance.cpp | 60 ++++++++++++------------- Engine/EffectInstance.h | 5 ++- Engine/EffectInstanceRenderRoI.cpp | 10 ++--- Engine/Engine.pro | 2 + Engine/EngineFwd.h | 1 + Engine/Image.cpp | 6 --- Engine/Image.h | 6 --- Engine/Node.cpp | 24 +++------- Engine/NodeInputs.cpp | 5 +-- Engine/OfxClipInstance.cpp | 8 ++-- Engine/OfxEffectInstance.cpp | 71 ++++++++++++++---------------- Engine/OfxImageEffectInstance.cpp | 7 +-- Engine/OutputSchedulerThread.cpp | 18 ++++---- Engine/ParallelRenderArgs.cpp | 7 +-- Engine/ParallelRenderArgs.h | 1 + Engine/PyNode.cpp | 3 +- Engine/RectD.cpp | 8 ++-- Engine/RenderScale.cpp | 31 +++++++++++++ Engine/RenderScale.h | 60 +++++++++++++++++++++++++ Engine/RotoPaint.cpp | 2 +- Engine/RotoSmear.cpp | 2 +- Engine/TrackMarker.cpp | 8 +--- Engine/TrackerContextPrivate.cpp | 2 +- Engine/TrackerFrameAccessor.cpp | 3 +- Engine/TrackerNode.cpp | 9 ++-- Engine/TrackerNodeInteract.cpp | 5 +-- Engine/TrackerNodeInteract.h | 2 +- Engine/ViewerInstance.cpp | 9 ++-- Global/GlobalDefines.h | 12 ----- Gui/CurveWidget.cpp | 2 +- Gui/ViewerGL.cpp | 28 ++++-------- Gui/ViewerTab10.cpp | 10 ++--- Gui/ViewerTabPrivate.cpp | 3 +- 33 files changed, 228 insertions(+), 202 deletions(-) create mode 100644 Engine/RenderScale.cpp create mode 100644 Engine/RenderScale.h diff --git a/Engine/EffectInstance.cpp b/Engine/EffectInstance.cpp index 968793e8a..b104c29d6 100644 --- a/Engine/EffectInstance.cpp +++ b/Engine/EffectInstance.cpp @@ -814,7 +814,7 @@ EffectInstance::getImage(int inputNb, /* * These are the data fields stored in the TLS from the on-going render action or instance changed action */ - unsigned int mipMapLevel = Image::getLevelFromScale(scale.x); + unsigned int mipMapLevel = scale.toMipmapLevel(); RoIMap inputsRoI; bool isIdentity = false; EffectInstancePtr identityInput; @@ -1176,7 +1176,7 @@ EffectInstance::calcDefaultRegionOfDefinition(U64 /*hash*/, RectD *rod) { - unsigned int mipMapLevel = Image::getLevelFromScale(scale.x); + unsigned int mipMapLevel = scale.toMipmapLevel(); RectI format = getOutputFormat(); double par = getAspectRatio(-1); *rod = format.toCanonical_noClipping(mipMapLevel, par); @@ -1258,7 +1258,7 @@ EffectInstance::ifInfiniteApplyHeuristic(U64 hash, bool isProjectFormat; RenderScale inputScale = scale; if (input->supportsRenderScaleMaybe() == eSupportsNo) { - inputScale.x = inputScale.y = 1.; + inputScale = RenderScale::identity; } StatusEnum st = input->getRegionOfDefinition_public(hash, time, inputScale, view, &inputRod, &isProjectFormat); if (st != eStatusFailed) { @@ -1281,7 +1281,7 @@ EffectInstance::ifInfiniteApplyHeuristic(U64 hash, RectI format = getOutputFormat(); assert(!format.isNull()); double par = getAspectRatio(-1); - unsigned int mipMapLevel = Image::getLevelFromScale(scale.x); + unsigned int mipMapLevel = scale.toMipmapLevel(); canonicalFormat = format.toCanonical_noClipping(mipMapLevel, par); } @@ -1351,7 +1351,7 @@ EffectInstance::getRegionsOfInterest(double time, //Tiles not supported: get the RoD as RoI RectD rod; bool isPF; - RenderScale inpScale(input->supportsRenderScale() ? scale.x : 1.); + RenderScale inpScale = (input->supportsRenderScale() ? scale : RenderScale::identity); StatusEnum stat = input->getRegionOfDefinition_public(input->getRenderHash(), time, inpScale, view, &rod, &isPF); if (stat == eStatusFailed) { return; @@ -2060,10 +2060,11 @@ EffectInstance::transformInputRois(const EffectInstance* self, invertTransform = Transform::matInverse(*it->second.cat, det); } - Transform::Matrix3x3 canonicalToPixel = Transform::matCanonicalToPixel(par, scale.x, - scale.y, false); - Transform::Matrix3x3 pixelToCanonical = Transform::matPixelToCanonical(par, scale.x, - scale.y, false); + const auto scalePt = scale.toOfxPointD(); + Transform::Matrix3x3 canonicalToPixel = Transform::matCanonicalToPixel(par, scalePt.x, + scalePt.y, false); + Transform::Matrix3x3 pixelToCanonical = Transform::matPixelToCanonical(par, scalePt.x, + scalePt.y, false); invertTransform = Transform::matMul(Transform::matMul(pixelToCanonical, invertTransform), canonicalToPixel); Transform::transformRegionFromRoD(foundRoI->second, invertTransform, transformedRenderWindow); @@ -2275,7 +2276,7 @@ EffectInstance::Implementation::tiledRenderingFunctor(const RectToRender & rectT } #ifndef NDEBUG - RenderScale scale( Image::getScaleFromMipMapLevel(mipMapLevel) ); + RenderScale scale = RenderScale::fromMipmapLevel(mipMapLevel); // check the dimensions of all input and output images const RectD & dstRodCanonical = firstPlaneToRender.renderMappedImage->getRoD(); const RectI dstBounds = dstRodCanonical.toPixelEnclosing(firstPlaneToRender.renderMappedImage->getMipMapLevel(), par); // compute dstRod at level 0 @@ -2401,10 +2402,9 @@ EffectInstance::Implementation::renderHandler(const EffectTLSDataPtr& tls, RenderActionArgs actionArgs; actionArgs.byPassCache = byPassCache; actionArgs.processChannels = processChannels; - actionArgs.mappedScale.x = actionArgs.mappedScale.y = Image::getScaleFromMipMapLevel( firstPlane.renderMappedImage->getMipMapLevel() ); + actionArgs.mappedScale = RenderScale::fromMipmapLevel(firstPlane.renderMappedImage->getMipMapLevel()); assert(isSupportedRenderScale(_publicInterface->supportsRenderScaleMaybe(), actionArgs.mappedScale)); - actionArgs.originalScale.x = Image::getScaleFromMipMapLevel(mipMapLevel); - actionArgs.originalScale.y = actionArgs.originalScale.x; + actionArgs.originalScale = RenderScale::fromMipmapLevel(mipMapLevel); actionArgs.draftMode = frameArgs->draftMode; actionArgs.useOpenGL = planes.useOpenGL; @@ -3303,7 +3303,7 @@ EffectInstance::drawOverlay_public(double time, RenderScale actualScale; if ( !canHandleRenderScaleForOverlays() ) { - actualScale.x = actualScale.y = 1.; + actualScale = RenderScale::identity; } else { actualScale = renderScale; } @@ -3335,7 +3335,7 @@ EffectInstance::onOverlayPenDown_public(double time, RenderScale actualScale; if ( !canHandleRenderScaleForOverlays() ) { - actualScale.x = actualScale.y = 1.; + actualScale = RenderScale::identity; } else { actualScale = renderScale; } @@ -3379,7 +3379,7 @@ EffectInstance::onOverlayPenDoubleClicked_public(double time, RenderScale actualScale; if ( !canHandleRenderScaleForOverlays() ) { - actualScale.x = actualScale.y = 1.; + actualScale = RenderScale::identity; } else { actualScale = renderScale; } @@ -3425,7 +3425,7 @@ EffectInstance::onOverlayPenMotion_public(double time, RenderScale actualScale; if ( !canHandleRenderScaleForOverlays() ) { - actualScale.x = actualScale.y = 1.; + actualScale = RenderScale::identity; } else { actualScale = renderScale; } @@ -3471,7 +3471,7 @@ EffectInstance::onOverlayPenUp_public(double time, RenderScale actualScale; if ( !canHandleRenderScaleForOverlays() ) { - actualScale.x = actualScale.y = 1.; + actualScale = RenderScale::identity; } else { actualScale = renderScale; } @@ -3515,7 +3515,7 @@ EffectInstance::onOverlayKeyDown_public(double time, RenderScale actualScale; if ( !canHandleRenderScaleForOverlays() ) { - actualScale.x = actualScale.y = 1.; + actualScale = RenderScale::identity; } else { actualScale = renderScale; } @@ -3551,7 +3551,7 @@ EffectInstance::onOverlayKeyUp_public(double time, RenderScale actualScale; if ( !canHandleRenderScaleForOverlays() ) { - actualScale.x = actualScale.y = 1.; + actualScale = RenderScale::identity; } else { actualScale = renderScale; } @@ -3587,7 +3587,7 @@ EffectInstance::onOverlayKeyRepeat_public(double time, RenderScale actualScale; if ( !canHandleRenderScaleForOverlays() ) { - actualScale.x = actualScale.y = 1.; + actualScale = RenderScale::identity; } else { actualScale = renderScale; } @@ -3620,7 +3620,7 @@ EffectInstance::onOverlayFocusGained_public(double time, RenderScale actualScale; if ( !canHandleRenderScaleForOverlays() ) { - actualScale.x = actualScale.y = 1.; + actualScale = RenderScale::identity; } else { actualScale = renderScale; } @@ -3654,7 +3654,7 @@ EffectInstance::onOverlayFocusLost_public(double time, RenderScale actualScale; if ( !canHandleRenderScaleForOverlays() ) { - actualScale.x = actualScale.y = 1.; + actualScale = RenderScale::identity; } else { actualScale = renderScale; } @@ -3815,7 +3815,7 @@ EffectInstance::getRegionOfDefinitionFromCache(U64 hash, RectD* rod, bool* isProjectFormat) { - unsigned int mipMapLevel = Image::getLevelFromScale(scale.x); + unsigned int mipMapLevel = scale.toMipmapLevel(); bool foundInCache = _imp->actionsCache->getRoDResult(hash, time, view, mipMapLevel, rod); if (foundInCache) { @@ -3844,7 +3844,7 @@ EffectInstance::getRegionOfDefinition_public(U64 hash, return eStatusFailed; } - unsigned int mipMapLevel = Image::getLevelFromScale(scale.x); + unsigned int mipMapLevel = scale.toMipmapLevel(); bool foundInCache = _imp->actionsCache->getRoDResult(hash, time, view, mipMapLevel, rod); if (foundInCache) { if (isProjectFormat) { @@ -3881,12 +3881,11 @@ EffectInstance::getRegionOfDefinition_public(U64 hash, } StatusEnum ret; - RenderScale scaleOne(1.); { RECURSIVE_ACTION(); - ret = getRegionOfDefinition(hash, time, supportsRenderScaleMaybe() == eSupportsNo ? scaleOne : scale, view, rod); + ret = getRegionOfDefinition(hash, time, supportsRenderScaleMaybe() == eSupportsNo ? RenderScale::identity : scale, view, rod); if ( (ret != eStatusOK) && (ret != eStatusReplyDefault) ) { // rod is not valid @@ -4643,11 +4642,11 @@ EffectInstance::redrawOverlayInteract() RenderScale EffectInstance::getOverlayInteractRenderScale() const { - RenderScale renderScale(1.); + RenderScale renderScale; if (isDoingInteractAction() && _imp->overlaysViewport) { unsigned int mmLevel = _imp->overlaysViewport->getCurrentRenderScale(); - renderScale.x = renderScale.y = Image::getScaleFromMipMapLevel(mmLevel); + renderScale = RenderScale::fromMipmapLevel(mmLevel); } return renderScale; @@ -5070,7 +5069,6 @@ EffectInstancePtr EffectInstance::getNearestNonIdentity(double time) { U64 hash = getRenderHash(); - RenderScale scale(1.); Format frmt; getApp()->getProject()->getProjectDefaultFormat(&frmt); @@ -5078,7 +5076,7 @@ EffectInstance::getNearestNonIdentity(double time) double inputTimeIdentity; int inputNbIdentity; ViewIdx inputView; - if ( !isIdentity_public(true, hash, time, scale, frmt, ViewIdx(0), &inputTimeIdentity, &inputView, &inputNbIdentity) ) { + if ( !isIdentity_public(true, hash, time, RenderScale::identity, frmt, ViewIdx(0), &inputTimeIdentity, &inputView, &inputNbIdentity) ) { return shared_from_this(); } else { if (inputNbIdentity < 0) { diff --git a/Engine/EffectInstance.h b/Engine/EffectInstance.h index b50e56c58..1c0d915c6 100644 --- a/Engine/EffectInstance.h +++ b/Engine/EffectInstance.h @@ -39,6 +39,7 @@ #include "Engine/Knob.h" // for KnobHolder #include "Engine/RectD.h" #include "Engine/RectI.h" +#include "Engine/RenderScale.h" #include "Engine/RenderStats.h" #include "Engine/EngineFwd.h" #include "Engine/ParallelRenderArgs.h" @@ -158,7 +159,7 @@ GCC_DIAG_SUGGEST_OVERRIDE_ON RenderRoIArgs() : time(0) - , scale(1.) + , scale() , mipMapLevel(0) , view(0) , roi() @@ -1132,7 +1133,7 @@ GCC_DIAG_SUGGEST_OVERRIDE_ON **/ static bool isSupportedRenderScale(SupportsEnum supportsRS, const RenderScale renderScale) { - return (supportsRS != eSupportsNo) || (renderScale.x == 1. && renderScale.y == 1.); + return (supportsRS != eSupportsNo) || (renderScale == RenderScale::identity); } public: diff --git a/Engine/EffectInstanceRenderRoI.cpp b/Engine/EffectInstanceRenderRoI.cpp index f6cf35875..d6c05e7ec 100644 --- a/Engine/EffectInstanceRenderRoI.cpp +++ b/Engine/EffectInstanceRenderRoI.cpp @@ -386,7 +386,7 @@ EffectInstance::renderRoI(const RenderRoIArgs & args, } else { renderMappedMipMapLevel = args.mipMapLevel; } - RenderScale renderMappedScale( Image::getScaleFromMipMapLevel(renderMappedMipMapLevel) ); + RenderScale renderMappedScale( RenderScale::fromMipmapLevel(renderMappedMipMapLevel) ); assert(isSupportedRenderScale(supportsRS, renderMappedScale)); @@ -426,7 +426,7 @@ EffectInstance::renderRoI(const RenderRoIArgs & args, supportsRS = supportsRenderScaleMaybe(); renderFullScaleThenDownscale = (supportsRS == eSupportsNo && mipMapLevel != 0); if (renderFullScaleThenDownscale) { - renderMappedScale.x = renderMappedScale.y = 1.; + renderMappedScale = RenderScale::identity; renderMappedMipMapLevel = 0; } } @@ -572,7 +572,7 @@ EffectInstance::renderRoI(const RenderRoIArgs & args, if ( (supportsRS == eSupportsMaybe) && (mipMapLevel != 0) ) { // supportsRenderScaleMaybe may have changed, update it renderFullScaleThenDownscale = true; - renderMappedScale.x = renderMappedScale.y = 1.; + renderMappedScale = RenderScale::identity; renderMappedMipMapLevel = 0; } @@ -838,7 +838,7 @@ EffectInstance::renderRoI(const RenderRoIArgs & args, if (renderFullScaleThenDownscale) { renderFullScaleThenDownscale = false; renderMappedMipMapLevel = args.mipMapLevel; - renderMappedScale.x = renderMappedScale.y = Image::getScaleFromMipMapLevel(renderMappedMipMapLevel); + renderMappedScale = RenderScale::fromMipmapLevel(renderMappedMipMapLevel); if (frameArgs->tilesSupported) { roi = args.roi; if ( !roi.clipIfOverlaps(downscaledImageBoundsNc) ) { @@ -1864,7 +1864,7 @@ EffectInstance::renderRoIInternal(EffectInstance* self, } } - RenderScale renderMappedScale( Image::getScaleFromMipMapLevel(renderMappedMipMapLevel) ); + RenderScale renderMappedScale( RenderScale::fromMipmapLevel(renderMappedMipMapLevel) ); RenderingFunctorRetEnum renderStatus = eRenderingFunctorRetOK; if ( planesToRender->rectsToRender.empty() ) { retCode = EffectInstance::eRenderRoIStatusImageAlreadyRendered; diff --git a/Engine/Engine.pro b/Engine/Engine.pro index 221cb7e25..748d7be8e 100644 --- a/Engine/Engine.pro +++ b/Engine/Engine.pro @@ -173,6 +173,7 @@ SOURCES += \ ReadNode.cpp \ RectD.cpp \ RectI.cpp \ + RenderScale.cpp \ RenderStats.cpp \ RotoContext.cpp \ RotoDrawableItem.cpp \ @@ -343,6 +344,7 @@ HEADERS += \ RectDSerialization.h \ RectI.h \ RectISerialization.h \ + RenderScale.h \ RenderStats.h \ RotoContext.h \ RotoContextPrivate.h \ diff --git a/Engine/EngineFwd.h b/Engine/EngineFwd.h index f3a53c1c6..55f1bf6fb 100644 --- a/Engine/EngineFwd.h +++ b/Engine/EngineFwd.h @@ -233,6 +233,7 @@ class ProjectSerialization; class RectD; class RectI; class RenderEngine; +class RenderScale; class RenderStats; class RenderingFlagSetter; class RotoContext; diff --git a/Engine/Image.cpp b/Engine/Image.cpp index a56efba90..ce51db876 100644 --- a/Engine/Image.cpp +++ b/Engine/Image.cpp @@ -2333,12 +2333,6 @@ Image::buildMipMapLevel(const RectD& dstRoD, } } // buildMipMapLevel -double -Image::getScaleFromMipMapLevel(unsigned int level) -{ - return 1. / (1 << level); -} - #ifndef M_LN2 #define M_LN2 0.693147180559945309417232121458176568 /* loge(2) */ #endif diff --git a/Engine/Image.h b/Engine/Image.h index 4449f5531..e57aeaf25 100644 --- a/Engine/Image.h +++ b/Engine/Image.h @@ -322,11 +322,6 @@ class Image return this->_params->getMipMapLevel(); } - double getScale() const - { - return getScaleFromMipMapLevel( getMipMapLevel() ); - } - unsigned int getComponentsCount() const; const ImagePlaneDesc& getComponents() const { @@ -766,7 +761,6 @@ class Image void upscaleMipMap(const RectI & roi, unsigned int fromLevel, unsigned int toLevel, Image* output) const; - static double getScaleFromMipMapLevel(unsigned int level); static unsigned int getLevelFromScale(double s); /** diff --git a/Engine/Node.cpp b/Engine/Node.cpp index 117aebe80..c69bf50ad 100644 --- a/Engine/Node.cpp +++ b/Engine/Node.cpp @@ -1641,12 +1641,11 @@ Node::makeInfoForInput(int inputNumber) const ss << "" << tr("Frame range:").toStdString() << " " << first << " - " << last << "
"; } { - RenderScale scale(1.); RectD rod; bool isProjectFormat; StatusEnum stat = input->getRegionOfDefinition_public(getHashValue(), time, - scale, ViewIdx(0), &rod, &isProjectFormat); + RenderScale::identity, ViewIdx(0), &rod, &isProjectFormat); if (stat != eStatusFailed) { ss << "" << tr("Region of Definition (at t=%1):").arg(time).toStdString() << " "; ss << tr("left = %1 bottom = %2 right = %3 top = %4").arg(rod.x1).arg(rod.y1).arg(rod.x2).arg(rod.y2).toStdString() << "
"; @@ -3301,7 +3300,6 @@ Node::makePreviewImage(SequenceTime time, ComputingPreviewSetter_RAII computingPreviewRAII( _imp.get() ); RectD rod; bool isProjectFormat; - RenderScale scale(1.); U64 nodeHash = getHashValue(); EffectInstance* effect = 0; NodeGroup* isGroup = dynamic_cast( _imp->effect.get() ); @@ -3317,7 +3315,7 @@ Node::makePreviewImage(SequenceTime time, effect->clearPersistentMessage(false); - StatusEnum stat = effect->getRegionOfDefinition_public(nodeHash, time, scale, ViewIdx(0), &rod, &isProjectFormat); + StatusEnum stat = effect->getRegionOfDefinition_public(nodeHash, time, RenderScale::identity, ViewIdx(0), &rod, &isProjectFormat); if ( (stat == eStatusFailed) || rod.isNull() ) { return false; } @@ -3329,8 +3327,7 @@ Node::makePreviewImage(SequenceTime time, int closestPowerOf2 = std::max(closestPowerOf2X, closestPowerOf2Y); unsigned int mipMapLevel = std::min(std::log( (double)closestPowerOf2 ) / std::log(2.), 5.); - scale.x = Image::getScaleFromMipMapLevel(mipMapLevel); - scale.y = scale.x; + const RenderScale scale = RenderScale::fromMipmapLevel(mipMapLevel); const double par = effect->getAspectRatio(-1); const RectI renderWindow = rod.toPixelEnclosing(mipMapLevel, par); @@ -4811,7 +4808,6 @@ Node::onRefreshIdentityStateRequestReceived() ProjectPtr project = getApp()->getProject(); double time = project->currentFrame(); - RenderScale scale(1.); double inputTime = 0; U64 hash = getHashValue(); bool viewAware = _imp->effect->isViewAware(); @@ -4834,7 +4830,7 @@ Node::onRefreshIdentityStateRequestReceived() for (int i = 0; i < nViews; ++i) { int identityInputNb = -1; ViewIdx identityView; - bool isViewIdentity = _imp->effect->isIdentity_public(true, hash, time, scale, frmt, ViewIdx(i), &inputTime, &identityView, &identityInputNb); + bool isViewIdentity = _imp->effect->isIdentity_public(true, hash, time, RenderScale::identity, frmt, ViewIdx(i), &inputTime, &identityView, &identityInputNb); if ( (i > 0) && ( (isViewIdentity != isIdentity) || (identityInputNb != inputNb) || (identityView.value() != i) ) ) { isIdentity = false; inputNb = -1; @@ -5167,7 +5163,6 @@ Node::Implementation::onLayerChanged(int inputNb, } if (!isRefreshingInputRelatedData) { ///Clip preferences have changed - RenderScale s(1.); effect->refreshMetadata_public(true); } if ( !enabledChan[0].lock() ) { @@ -5273,7 +5268,6 @@ Node::Implementation::onMaskSelectorChanged(int inputNb, if (!isRefreshingInputRelatedData) { ///Clip preferences have changed - RenderScale s(1.); effect->refreshMetadata_public(true); } } @@ -5819,7 +5813,6 @@ addIdentityNodesRecursively(const Node* caller, /* Very unlikely that there's no request pass. But we still check */ - RenderScale scale(1.); double inputTimeId; ViewIdx identityView; int inputNbId; @@ -5829,7 +5822,7 @@ addIdentityNodesRecursively(const Node* caller, RectI format = node->getEffectInstance()->getOutputFormat(); - isIdentity = node->getEffectInstance()->isIdentity_public(true, renderHash, time, scale, format, view, &inputTimeId, &identityView, &inputNbId); + isIdentity = node->getEffectInstance()->isIdentity_public(true, renderHash, time, RenderScale::identity, format, view, &inputTimeId, &identityView, &inputNbId); } @@ -6111,14 +6104,12 @@ Node::refreshAllInputRelatedData(bool /*canChangeValues*/, } double time = (double)getApp()->getTimeLine()->currentFrame(); - RenderScale scaleOne(1.); ///Render scale support might not have been set already because getRegionOfDefinition could have failed until all non optional inputs were connected if (_imp->effect->supportsRenderScaleMaybe() == EffectInstance::eSupportsMaybe) { RectD rod; - StatusEnum stat = _imp->effect->getRegionOfDefinition(getHashValue(), time, scaleOne, ViewIdx(0), &rod); + StatusEnum stat = _imp->effect->getRegionOfDefinition(getHashValue(), time, RenderScale::identity, ViewIdx(0), &rod); if (stat != eStatusFailed) { - RenderScale scale(0.5); - stat = _imp->effect->getRegionOfDefinition(getHashValue(), time, scale, ViewIdx(0), &rod); + stat = _imp->effect->getRegionOfDefinition(getHashValue(), time, RenderScale::fromMipmapLevel(1), ViewIdx(0), &rod); if (stat != eStatusFailed) { _imp->effect->setSupportsRenderScaleMaybe(EffectInstance::eSupportsYes); } else { @@ -7262,7 +7253,6 @@ Node::addUserComponents(const ImagePlaneDesc& comps) } if (!_imp->isRefreshingInputRelatedData) { ///Clip preferences have changed - RenderScale s(1.); getEffectInstance()->refreshMetadata_public(true); } { diff --git a/Engine/NodeInputs.cpp b/Engine/NodeInputs.cpp index 1be52f2e6..7af97bcf1 100644 --- a/Engine/NodeInputs.cpp +++ b/Engine/NodeInputs.cpp @@ -627,12 +627,11 @@ checkCanConnectNoMultiRes(const Node* output, { //http://openfx.sourceforge.net/Documentation/1.3/ofxProgrammingReference.html#kOfxImageEffectPropSupportsMultiResolution //Check that the input has the same RoD that another input and that its rod is set to 0,0 - RenderScale scale(1.); RectD rod; bool isProjectFormat; StatusEnum stat = input->getEffectInstance()->getRegionOfDefinition_public(input->getHashValue(), output->getApp()->getTimeLine()->currentFrame(), - scale, + RenderScale::identity, ViewIdx(0), &rod, &isProjectFormat); @@ -660,7 +659,7 @@ checkCanConnectNoMultiRes(const Node* output, RectD inputRod; stat = inputNode->getEffectInstance()->getRegionOfDefinition_public(inputNode->getHashValue(), output->getApp()->getTimeLine()->currentFrame(), - scale, + RenderScale::identity, ViewIdx(0), &inputRod, &isProjectFormat); if ( (stat == eStatusFailed) && !inputRod.isNull() ) { diff --git a/Engine/OfxClipInstance.cpp b/Engine/OfxClipInstance.cpp index a266a1b9b..3062fbb4a 100644 --- a/Engine/OfxClipInstance.cpp +++ b/Engine/OfxClipInstance.cpp @@ -601,7 +601,7 @@ OfxClipInstance::getRegionOfDefinitionInternal(OfxTime time, bool isProjectFormat; U64 nodeHash = associatedNode->getRenderHash(); RectD rod; - RenderScale scale( Image::getScaleFromMipMapLevel(mipmapLevel) ); + const RenderScale scale = RenderScale::fromMipmapLevel(mipmapLevel); StatusEnum st = associatedNode->getRegionOfDefinition_public(nodeHash, time, scale, view, &rod, &isProjectFormat); if (st == eStatusFailed) { ret->x1 = 0.; @@ -971,7 +971,7 @@ OfxClipInstance::getInputImageInternal(const OfxTime time, } - RenderScale renderScale( Image::getScaleFromMipMapLevel(mipMapLevel) ); + const RenderScale renderScale = RenderScale::fromMipmapLevel(mipMapLevel); RectD bounds; if (optionalBounds) { bounds.x1 = optionalBounds->x1; @@ -1368,8 +1368,8 @@ OfxImageCommon::OfxImageCommon(OFX::Host::ImageEffect::ImageBase* ofxImageBase, assert(internalImage); - unsigned int mipMapLevel = internalImage->getMipMapLevel(); - RenderScale scale( NATRON_NAMESPACE::Image::getScaleFromMipMapLevel(mipMapLevel) ); + const unsigned int mipMapLevel = internalImage->getMipMapLevel(); + const OfxPointD scale = RenderScale::fromMipmapLevel(mipMapLevel).toOfxPointD(); ofxImageBase->setDoubleProperty(kOfxImageEffectPropRenderScale, scale.x, 0); ofxImageBase->setDoubleProperty(kOfxImageEffectPropRenderScale, scale.y, 1); diff --git a/Engine/OfxEffectInstance.cpp b/Engine/OfxEffectInstance.cpp index 2b36ae9d8..2c786c538 100644 --- a/Engine/OfxEffectInstance.cpp +++ b/Engine/OfxEffectInstance.cpp @@ -694,9 +694,6 @@ OfxEffectInstance::tryInitializeOverlayInteracts() OfxPluginEntryPoint *overlayEntryPoint = _imp->effect->getOverlayInteractMainEntry(); if (overlayEntryPoint) { _imp->overlayInteract.reset( new OfxOverlayInteract(*_imp->effect, 8, true) ); - double sx, sy; - effectInstance()->getRenderScaleRecursive(sx, sy); - RenderScale s(sx, sy); { ClipsThreadStorageSetter clipSetter(effectInstance(), @@ -1209,7 +1206,7 @@ OfxEffectInstance::onInputChanged(int inputNo) OfxClipInstance* clip = getClipCorrespondingToInput(inputNo); assert(clip); double time = getApp()->getTimeLine()->currentFrame(); - RenderScale s(1.); + const OfxPointD scale = {1., 1.}; { @@ -1222,7 +1219,7 @@ OfxEffectInstance::onInputChanged(int inputNo) assert(_imp->effect); _imp->effect->beginInstanceChangedAction(kOfxChangeUserEdited); - _imp->effect->clipInstanceChangedAction(clip->getName(), kOfxChangeUserEdited, time, s); + _imp->effect->clipInstanceChangedAction(clip->getName(), kOfxChangeUserEdited, time, scale); _imp->effect->endInstanceChangedAction(kOfxChangeUserEdited); } } @@ -1397,12 +1394,12 @@ OfxEffectInstance::getRegionOfDefinition(U64 /*hash*/, assert(_imp->effect); - unsigned int mipMapLevel = Image::getLevelFromScale(scale.x); + unsigned int mipMapLevel = scale.toMipmapLevel(); // getRegionOfDefinition may be the first action with renderscale called on any effect. // it may have to check for render scale support. SupportsEnum supportsRS = supportsRenderScaleMaybe(); - bool scaleIsOne = (scale.x == 1. && scale.y == 1.); + bool scaleIsOne = scale == RenderScale::identity; if ( (supportsRS == eSupportsNo) && !scaleIsOne ) { qDebug() << "getRegionOfDefinition called with render scale != 1, but effect does not support render scale!"; @@ -1419,11 +1416,11 @@ OfxEffectInstance::getRegionOfDefinition(U64 /*hash*/, assert(_imp->effect); if (getRecursionLevel() > 1) { - stat = _imp->effect->getRegionOfDefinitionAction(time, scale, view, ofxRod); + stat = _imp->effect->getRegionOfDefinitionAction(time, scale.toOfxPointD(), view, ofxRod); } else { ///Take the preferences lock so that it cannot be modified throughout the action. QReadLocker preferencesLocker(&_imp->preferencesLock); - stat = _imp->effect->getRegionOfDefinitionAction(time, scale, view, ofxRod); + stat = _imp->effect->getRegionOfDefinitionAction(time, scale.toOfxPointD(), view, ofxRod); } if (supportsRS == eSupportsMaybe) { OfxRectD tmpRod; @@ -1537,7 +1534,7 @@ OfxEffectInstance::calcDefaultRegionOfDefinition(U64 /*hash*/, throw std::runtime_error("OfxEffectInstance not initialized"); } - unsigned int mipMapLevel = Image::getLevelFromScale(scale.x); + unsigned int mipMapLevel = scale.toMipmapLevel(); OfxRectD ofxRod; { @@ -1560,9 +1557,9 @@ OfxEffectInstance::calcDefaultRegionOfDefinition(U64 /*hash*/, // the following ofxh function does the job QReadLocker preferencesLocker(&_imp->preferencesLock); - ofxRod = _imp->effect->calcDefaultRegionOfDefinition(time, scale, view); + ofxRod = _imp->effect->calcDefaultRegionOfDefinition(time, scale.toOfxPointD(), view); } else { - ofxRod = _imp->effect->calcDefaultRegionOfDefinition(time, scale, view); + ofxRod = _imp->effect->calcDefaultRegionOfDefinition(time, scale.toOfxPointD(), view); } } rod->x1 = ofxRod.x1; @@ -1603,7 +1600,7 @@ OfxEffectInstance::getRegionsOfInterest(double time, OfxStatus stat; ///before calling getRoIaction set the relevant info on the clips - unsigned int mipMapLevel = Image::getLevelFromScale(scale.x); + unsigned int mipMapLevel = scale.toMipmapLevel(); { SET_CAN_SET_VALUE(false); @@ -1616,7 +1613,7 @@ OfxEffectInstance::getRegionsOfInterest(double time, ///Take the preferences lock so that it cannot be modified throughout the action. QReadLocker preferencesLocker(&_imp->preferencesLock); assert(_imp->effect); - stat = _imp->effect->getRegionOfInterestAction( (OfxTime)time, scale, view, + stat = _imp->effect->getRegionOfInterestAction( (OfxTime)time, scale.toOfxPointD(), view, roi, inputRois ); } @@ -1834,7 +1831,7 @@ OfxEffectInstance::isIdentity(double time, throw std::logic_error("isIdentity called with an unsupported RenderScale"); } - unsigned int mipMapLevel = Image::getLevelFromScale(scale.x); + unsigned int mipMapLevel = scale.toMipmapLevel(); OfxStatus stat; { @@ -1855,11 +1852,11 @@ OfxEffectInstance::isIdentity(double time, int identityView = view; string identityPlane = kFnOfxImagePlaneColour; if (getRecursionLevel() > 1) { - stat = _imp->effect->isIdentityAction(inputTimeOfx, field, ofxRoI, scale, identityView, identityPlane, inputclip); + stat = _imp->effect->isIdentityAction(inputTimeOfx, field, ofxRoI, scale.toOfxPointD(), identityView, identityPlane, inputclip); } else { ///Take the preferences lock so that it cannot be modified throughout the action. QReadLocker preferencesLocker(&_imp->preferencesLock); - stat = _imp->effect->isIdentityAction(inputTimeOfx, field, ofxRoI, scale, identityView, identityPlane, inputclip); + stat = _imp->effect->isIdentityAction(inputTimeOfx, field, ofxRoI, scale.toOfxPointD(), identityView, identityPlane, inputclip); } if (identityView != view || identityPlane != kFnOfxImagePlaneColour) { //#pragma message WARN("can Natron RB2-multiplane2 handle isIdentity across views and planes?") @@ -1946,7 +1943,7 @@ OfxEffectInstance::beginSequenceRender(double first, assert(isSupportedRenderScale(supportsRenderScaleMaybe(), scale)); OfxStatus stat; - unsigned int mipMapLevel = Image::getLevelFromScale(scale.x); + unsigned int mipMapLevel = scale.toMipmapLevel(); { ClipsThreadStorageSetter clipSetter(effectInstance(), view, @@ -1960,7 +1957,7 @@ OfxEffectInstance::beginSequenceRender(double first, ///Take the preferences lock so that it cannot be modified throughout the action. QReadLocker preferencesLocker(&_imp->preferencesLock); stat = effectInstance()->beginRenderAction(first, last, step, - interactive, scale, + interactive, scale.toOfxPointD(), isSequentialRender, isRenderResponseToUserInteraction, isOpenGLRender, oglData, draftMode, view); } @@ -1988,7 +1985,7 @@ OfxEffectInstance::endSequenceRender(double first, assert(isSupportedRenderScale(supportsRenderScaleMaybe(), scale)); OfxStatus stat; - unsigned int mipMapLevel = Image::getLevelFromScale(scale.x); + unsigned int mipMapLevel = scale.toMipmapLevel(); { ClipsThreadStorageSetter clipSetter(effectInstance(), view, @@ -2001,7 +1998,7 @@ OfxEffectInstance::endSequenceRender(double first, ///Take the preferences lock so that it cannot be modified throughout the action. QReadLocker preferencesLocker(&_imp->preferencesLock); stat = effectInstance()->endRenderAction(first, last, step, - interactive, scale, + interactive, scale.toOfxPointD(), isSequentialRender, isRenderResponseToUserInteraction, isOpenGLRender, oglData, draftMode, view); } @@ -2078,7 +2075,7 @@ OfxEffectInstance::render(const RenderActionArgs& args) RenderThreadStorageSetter clipSetter(effectInstance(), args.view, - Image::getLevelFromScale(args.originalScale.x), + args.originalScale.toMipmapLevel(), firstPlane.first, args.inputImages); OfxGLContextEffectData* isOfxGLData = dynamic_cast( args.glContextData.get() ); @@ -2089,7 +2086,7 @@ OfxEffectInstance::render(const RenderActionArgs& args) stat = _imp->effect->renderAction( (OfxTime)args.time, field, ofxRoI, - args.mappedScale, + args.mappedScale.toOfxPointD(), args.isSequentialRender, args.isRenderResponseToUserInteraction, args.useOpenGL, @@ -2203,7 +2200,7 @@ OfxEffectInstance::drawOverlay(double time, } if (_imp->overlayInteract) { SET_CAN_SET_VALUE(false); - _imp->overlayInteract->drawAction(time, renderScale, view, _imp->overlayInteract->hasColorPicker() ? &_imp->overlayInteract->getLastColorPickerColor() : /*colourPicker=*/0); + _imp->overlayInteract->drawAction(time, renderScale.toOfxPointD(), view, _imp->overlayInteract->hasColorPicker() ? &_imp->overlayInteract->getLastColorPickerColor() : /*colourPicker=*/0); } } @@ -2238,7 +2235,7 @@ OfxEffectInstance::onOverlayPenDown(double time, SET_CAN_SET_VALUE(true); - OfxStatus stat = _imp->overlayInteract->penDownAction(time, renderScale, view, _imp->overlayInteract->hasColorPicker() ? &_imp->overlayInteract->getLastColorPickerColor() : /*colourPicker=*/0, penPos, penPosViewport, pressure); + OfxStatus stat = _imp->overlayInteract->penDownAction(time, renderScale.toOfxPointD(), view, _imp->overlayInteract->hasColorPicker() ? &_imp->overlayInteract->getLastColorPickerColor() : /*colourPicker=*/0, penPos, penPosViewport, pressure); if ( (getRecursionLevel() == 1) && checkIfOverlayRedrawNeeded() ) { @@ -2279,7 +2276,7 @@ OfxEffectInstance::onOverlayPenMotion(double time, OfxStatus stat; SET_CAN_SET_VALUE(true); - stat = _imp->overlayInteract->penMotionAction(time, renderScale, view, _imp->overlayInteract->hasColorPicker() ? &_imp->overlayInteract->getLastColorPickerColor() : /*colourPicker=*/0, penPos, penPosViewport, pressure); + stat = _imp->overlayInteract->penMotionAction(time, renderScale.toOfxPointD(), view, _imp->overlayInteract->hasColorPicker() ? &_imp->overlayInteract->getLastColorPickerColor() : /*colourPicker=*/0, penPos, penPosViewport, pressure); if ( (getRecursionLevel() == 1) && checkIfOverlayRedrawNeeded() ) { stat = _imp->overlayInteract->redraw(); @@ -2315,7 +2312,7 @@ OfxEffectInstance::onOverlayPenUp(double time, penPosViewport.y = viewportPos.y(); SET_CAN_SET_VALUE(true); - OfxStatus stat = _imp->overlayInteract->penUpAction(time, renderScale, view, _imp->overlayInteract->hasColorPicker() ? &_imp->overlayInteract->getLastColorPickerColor() : /*colourPicker=*/0, penPos, penPosViewport, pressure); + OfxStatus stat = _imp->overlayInteract->penUpAction(time, renderScale.toOfxPointD(), view, _imp->overlayInteract->hasColorPicker() ? &_imp->overlayInteract->getLastColorPickerColor() : /*colourPicker=*/0, penPos, penPosViewport, pressure); if ( (getRecursionLevel() == 1) && checkIfOverlayRedrawNeeded() ) { stat = _imp->overlayInteract->redraw(); @@ -2345,7 +2342,7 @@ OfxEffectInstance::onOverlayKeyDown(double time, if (_imp->overlayInteract) { QByteArray keyStr; SET_CAN_SET_VALUE(true); - OfxStatus stat = _imp->overlayInteract->keyDownAction( time, renderScale, view,_imp->overlayInteract->hasColorPicker() ? &_imp->overlayInteract->getLastColorPickerColor() : /*colourPicker=*/0, (int)key, keyStr.data() ); + OfxStatus stat = _imp->overlayInteract->keyDownAction( time, renderScale.toOfxPointD(), view,_imp->overlayInteract->hasColorPicker() ? &_imp->overlayInteract->getLastColorPickerColor() : /*colourPicker=*/0, (int)key, keyStr.data() ); if ( (getRecursionLevel() == 1) && checkIfOverlayRedrawNeeded() ) { stat = _imp->overlayInteract->redraw(); @@ -2373,7 +2370,7 @@ OfxEffectInstance::onOverlayKeyUp(double time, if (_imp->overlayInteract) { QByteArray keyStr; SET_CAN_SET_VALUE(true); - OfxStatus stat = _imp->overlayInteract->keyUpAction( time, renderScale, view, _imp->overlayInteract->hasColorPicker() ? &_imp->overlayInteract->getLastColorPickerColor() : /*colourPicker=*/0, (int)key, keyStr.data() ); + OfxStatus stat = _imp->overlayInteract->keyUpAction( time, renderScale.toOfxPointD(), view, _imp->overlayInteract->hasColorPicker() ? &_imp->overlayInteract->getLastColorPickerColor() : /*colourPicker=*/0, (int)key, keyStr.data() ); if ( (getRecursionLevel() == 1) && checkIfOverlayRedrawNeeded() ) { stat = _imp->overlayInteract->redraw(); @@ -2404,7 +2401,7 @@ OfxEffectInstance::onOverlayKeyRepeat(double time, QByteArray keyStr; SET_CAN_SET_VALUE(true); - OfxStatus stat = _imp->overlayInteract->keyRepeatAction( time, renderScale, view, _imp->overlayInteract->hasColorPicker() ? &_imp->overlayInteract->getLastColorPickerColor() : /*colourPicker=*/0, (int)key, keyStr.data() ); + OfxStatus stat = _imp->overlayInteract->keyRepeatAction( time, renderScale.toOfxPointD(), view, _imp->overlayInteract->hasColorPicker() ? &_imp->overlayInteract->getLastColorPickerColor() : /*colourPicker=*/0, (int)key, keyStr.data() ); if ( (getRecursionLevel() == 1) && checkIfOverlayRedrawNeeded() ) { stat = _imp->overlayInteract->redraw(); @@ -2430,7 +2427,7 @@ OfxEffectInstance::onOverlayFocusGained(double time, if (_imp->overlayInteract) { OfxStatus stat; SET_CAN_SET_VALUE(true); - stat = _imp->overlayInteract->gainFocusAction(time, renderScale, view, _imp->overlayInteract->hasColorPicker() ? &_imp->overlayInteract->getLastColorPickerColor() : /*colourPicker=*/0); + stat = _imp->overlayInteract->gainFocusAction(time, renderScale.toOfxPointD(), view, _imp->overlayInteract->hasColorPicker() ? &_imp->overlayInteract->getLastColorPickerColor() : /*colourPicker=*/0); if (stat == kOfxStatOK) { return true; } @@ -2450,7 +2447,7 @@ OfxEffectInstance::onOverlayFocusLost(double time, if (_imp->overlayInteract) { OfxStatus stat; SET_CAN_SET_VALUE(true); - stat = _imp->overlayInteract->loseFocusAction(time, renderScale, view, _imp->overlayInteract->hasColorPicker() ? &_imp->overlayInteract->getLastColorPickerColor() : /*colourPicker=*/0); + stat = _imp->overlayInteract->loseFocusAction(time, renderScale.toOfxPointD(), view, _imp->overlayInteract->hasColorPicker() ? &_imp->overlayInteract->getLastColorPickerColor() : /*colourPicker=*/0); if (stat == kOfxStatOK) { return true; } @@ -2606,19 +2603,19 @@ OfxEffectInstance::knobChanged(KnobI* k, ViewIdx v = ( view.isAll() || view.isCurrent() ) ? ViewIdx(0) : ViewIdx(view); ClipsThreadStorageSetter clipSetter( effect, v, - Image::getLevelFromScale(renderScale.x) ); + renderScale.toMipmapLevel() ); ///This action as all the overlay interacts actions can trigger recursive actions, such as ///getClipPreferences() so we don't take the clips preferences lock for read here otherwise we would ///create a deadlock. This code then assumes that the instance changed action of the plug-in doesn't require ///the clip preferences to stay the same throughout the action. - stat = effect->paramInstanceChangedAction(k->getOriginalName(), ofxReason, (OfxTime)time, renderScale); + stat = effect->paramInstanceChangedAction(k->getOriginalName(), ofxReason, (OfxTime)time, renderScale.toOfxPointD()); } else { ///This action as all the overlay interacts actions can trigger recursive actions, such as ///getClipPreferences() so we don't take the clips preferences lock for read here otherwise we would ///create a deadlock. This code then assumes that the instance changed action of the plug-in doesn't require ///the clip preferences to stay the same throughout the action. - stat = effect->paramInstanceChangedAction(k->getOriginalName(), ofxReason, (OfxTime)time, renderScale); + stat = effect->paramInstanceChangedAction(k->getOriginalName(), ofxReason, (OfxTime)time, renderScale.toOfxPointD()); } if ( (stat != kOfxStatOK) && (stat != kOfxStatReplyDefault) ) { @@ -2994,10 +2991,10 @@ OfxEffectInstance::getTransform(double time, ClipsThreadStorageSetter clipSetter( effectInstance(), view, - Image::getLevelFromScale(renderScale.x) ); + renderScale.toMipmapLevel() ); try { - stat = effectInstance()->getTransformAction( (OfxTime)time, field, renderScale, draftRender, view, clipName, tmpTransform ); + stat = effectInstance()->getTransformAction( (OfxTime)time, field, renderScale.toOfxPointD(), draftRender, view, clipName, tmpTransform ); } catch (...) { return eStatusFailed; } diff --git a/Engine/OfxImageEffectInstance.cpp b/Engine/OfxImageEffectInstance.cpp index 3e78fe085..e73ed6d14 100644 --- a/Engine/OfxImageEffectInstance.cpp +++ b/Engine/OfxImageEffectInstance.cpp @@ -442,9 +442,10 @@ OfxImageEffectInstance::getRenderScaleRecursive(double &x, ///get the render scale of the 1st viewer if ( !attachedViewers.empty() ) { ViewerInstance* first = attachedViewers.front(); - int mipMapLevel = first->getMipMapLevel(); - x = Image::getScaleFromMipMapLevel( (unsigned int)mipMapLevel ); - y = x; + int mipmapLevel = first->getMipMapLevel(); + const auto scale = RenderScale::fromMipmapLevel((unsigned int)mipmapLevel).toOfxPointD(); + x = scale.x; + y = scale.y; } else { x = 1.; y = 1.; diff --git a/Engine/OutputSchedulerThread.cpp b/Engine/OutputSchedulerThread.cpp index c1dee7c0a..49d7910bc 100644 --- a/Engine/OutputSchedulerThread.cpp +++ b/Engine/OutputSchedulerThread.cpp @@ -1085,11 +1085,10 @@ OutputSchedulerThread::startRender() } SequentialPreferenceEnum pref = effect->getSequentialPreference(); if ( (pref == eSequentialPreferenceOnlySequential) || (pref == eSequentialPreferencePreferSequential) ) { - RenderScale scaleOne(1.); if (effect->beginSequenceRender_public( firstFrame, lastFrame, frameStep, false, - scaleOne, true, + RenderScale::identity, true, true, false, ViewIdx(0), @@ -1176,11 +1175,10 @@ OutputSchedulerThread::stopRender() firstFrame = args->firstFrame; lastFrame = args->lastFrame; - RenderScale scaleOne(1.); ignore_result( effect->endSequenceRender_public( firstFrame, lastFrame, 1, !appPTR->isBackground(), - scaleOne, true, + RenderScale::identity, true, !appPTR->isBackground(), false, ViewIdx(0), @@ -2245,8 +2243,8 @@ class DefaultRenderFrameRunnable try { ////Writers always render at scale 1. - int mipMapLevel = 0; - RenderScale scale(1.); + const int mipmapLevel = 0; + const RenderScale scale = RenderScale::fromMipmapLevel(mipmapLevel); RectD rod; bool isProjectFormat; @@ -2323,7 +2321,7 @@ class DefaultRenderFrameRunnable { FrameRequestMap request; - stat = EffectInstance::computeRequestPass(time, viewsToRender[view], mipMapLevel, rod, activeInputNode, request); + stat = EffectInstance::computeRequestPass(time, viewsToRender[view], mipmapLevel, rod, activeInputNode, request); if (stat == eStatusFailed) { _imp->scheduler->notifyRenderFailure("Error caught while rendering"); @@ -2335,7 +2333,7 @@ class DefaultRenderFrameRunnable std::map planes; std::unique_ptr renderArgs( new EffectInstance::RenderRoIArgs(time, //< the time at which to render scale, //< the scale at which to render - mipMapLevel, //< the mipmap level (redundant with the scale) + mipmapLevel, //< the mipmap level (redundant with the scale) viewsToRender[view], //< the view to render false, renderWindow, //< the region of interest (in pixel coordinates) @@ -2406,8 +2404,6 @@ DefaultScheduler::processFrame(const BufferedFrames& frames) //Only consider the first frame, we shouldn't have multiple view here anyway. const BufferedFrame& frame = frames.front(); - ///Writers render to scale 1 always - RenderScale scale(1.); OutputEffectInstancePtr effect = _effect.lock(); U64 hash = effect->getHash(); bool isProjectFormat; @@ -2444,6 +2440,8 @@ DefaultScheduler::processFrame(const BufferedFrames& frames) false, it->stats); RectD rod; + ///Writers render to scale 1 always + const RenderScale scale; ignore_result( effect->getRegionOfDefinition_public(hash, it->time, scale, it->view, &rod, &isProjectFormat) ); const RectI roi = rod.toPixelEnclosing(0, par); diff --git a/Engine/ParallelRenderArgs.cpp b/Engine/ParallelRenderArgs.cpp index 8043e7ede..4d3f062c4 100644 --- a/Engine/ParallelRenderArgs.cpp +++ b/Engine/ParallelRenderArgs.cpp @@ -246,9 +246,6 @@ EffectInstance::treeRecurseFunctor(bool isRenderFunctor, ///Do not count frames pre-fetched in RoI functor mode, it is harmless and may ///limit calculations that will be done later on anyway. } else { - RenderScale scaleOne(1.); - RenderScale scale( Image::getScaleFromMipMapLevel(originalMipMapLevel) ); - ///Render the input image with the bit depth of its preference ImageBitDepthEnum inputPrefDepth = inputEffect->getBitDepth(-1); @@ -261,7 +258,7 @@ EffectInstance::treeRecurseFunctor(bool isRenderFunctor, } const unsigned int upstreamMipMapLevel = useScaleOneInputs ? 0 : originalMipMapLevel; - const RenderScale & upstreamScale = useScaleOneInputs ? scaleOne : scale; + const RenderScale upstreamScale = useScaleOneInputs ? RenderScale::identity : RenderScale::fromMipmapLevel(originalMipMapLevel); const RectI inputRoIPixelCoords = roi.toPixelEnclosing(upstreamMipMapLevel, inputPar); std::map inputImgs; @@ -344,7 +341,7 @@ EffectInstance::getInputsRoIsFunctor(bool useTransforms, ///Setup global data for the node for the whole frame render NodeFrameRequestPtr tmp = std::make_shared(); - tmp->mappedScale.x = tmp->mappedScale.y = Image::getScaleFromMipMapLevel(mappedLevel); + tmp->mappedScale = RenderScale::fromMipmapLevel(mappedLevel); tmp->nodeHash = effect->getRenderHash(); std::pair ret = requests.insert( std::make_pair(node, tmp) ); diff --git a/Engine/ParallelRenderArgs.h b/Engine/ParallelRenderArgs.h index 04881cc4a..ca75b53df 100644 --- a/Engine/ParallelRenderArgs.h +++ b/Engine/ParallelRenderArgs.h @@ -35,6 +35,7 @@ #include "Global/GlobalDefines.h" #include "Engine/RectD.h" +#include "Engine/RenderScale.h" #include "Engine/ViewIdx.h" #include "Engine/EngineFwd.h" diff --git a/Engine/PyNode.cpp b/Engine/PyNode.cpp index f1071c1cf..3b84c3c47 100644 --- a/Engine/PyNode.cpp +++ b/Engine/PyNode.cpp @@ -967,9 +967,8 @@ Effect::getRegionOfDefinition(double time, return rod; } U64 hash = getInternalNode()->getHashValue(); - RenderScale s(1.); bool isProject; - StatusEnum stat = getInternalNode()->getEffectInstance()->getRegionOfDefinition_public(hash, time, s, ViewIdx(view), &rod, &isProject); + StatusEnum stat = getInternalNode()->getEffectInstance()->getRegionOfDefinition_public(hash, time, RenderScale::identity, ViewIdx(view), &rod, &isProject); if (stat != eStatusOK) { return RectD(); } diff --git a/Engine/RectD.cpp b/Engine/RectD.cpp index 5d8e67c0a..1a2666123 100644 --- a/Engine/RectD.cpp +++ b/Engine/RectD.cpp @@ -30,17 +30,15 @@ #include #include "Engine/RectI.h" +#include "Engine/RenderScale.h" NATRON_NAMESPACE_ENTER RectI -RectD::toPixelEnclosing(const RenderScale& scale, +RectD::toPixelEnclosing(const RenderScale& renderScale, double par) const { - return RectI(std::floor(x1 * scale.x / par), - std::floor(y1 * scale.y), - std::ceil(x2 * scale.x / par), - std::ceil(y2 * scale.y)); + return toPixelEnclosing(renderScale.toMipmapLevel(), par); } RectI diff --git a/Engine/RenderScale.cpp b/Engine/RenderScale.cpp new file mode 100644 index 000000000..6b5fea992 --- /dev/null +++ b/Engine/RenderScale.cpp @@ -0,0 +1,31 @@ +/* ***** BEGIN LICENSE BLOCK ***** + * This file is part of Natron , + * (C) 2018-2023 The Natron developers + * (C) 2013-2018 INRIA and Alexandre Gauthier-Foichat + * + * Natron is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * Natron is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with Natron. If not, see + * ***** END LICENSE BLOCK ***** */ + +#include "RenderScale.h" + +#include "Global/Macros.h" + +#include "Engine/Image.h" + +NATRON_NAMESPACE_ENTER + +// static +const RenderScale RenderScale::identity; + +NATRON_NAMESPACE_EXIT diff --git a/Engine/RenderScale.h b/Engine/RenderScale.h new file mode 100644 index 000000000..3a09eb8c6 --- /dev/null +++ b/Engine/RenderScale.h @@ -0,0 +1,60 @@ +/* ***** BEGIN LICENSE BLOCK ***** + * This file is part of Natron , + * (C) 2018-2023 The Natron developers + * (C) 2013-2018 INRIA and Alexandre Gauthier-Foichat + * + * Natron is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * Natron is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with Natron. If not, see + * ***** END LICENSE BLOCK ***** */ + +#ifndef RENDERSCALE_H +#define RENDERSCALE_H + +#include + +#include "Global/Macros.h" + +#include "ofxCore.h" + +NATRON_NAMESPACE_ENTER + +class RenderScale { +public: + // Default constructed object has x & y scale set to 1. + constexpr RenderScale() = default; + + // Named constant where x & y scale are both 1. (i.e the identity scale factor in both directions.) + static const RenderScale identity; + + bool operator==(const RenderScale& rhs) const { return mipmapLevel == rhs.mipmapLevel; } + bool operator!=(const RenderScale& rhs) const { return !(*this == rhs); } + + OfxPointD toOfxPointD() const + { + assert(mipmapLevel < 8 * sizeof(mipmapLevel)); + const double scale = 1. / (1 << mipmapLevel); + return { scale, scale }; + } + + static RenderScale fromMipmapLevel(unsigned int mipmapLevel) { return RenderScale(mipmapLevel); } + unsigned int toMipmapLevel() const { return mipmapLevel; } + +private: + RenderScale(unsigned int mipmapLevel_) : mipmapLevel(mipmapLevel_) {} + + unsigned int mipmapLevel = 0; +}; + +NATRON_NAMESPACE_EXIT + +#endif // RENDERSCALE_H diff --git a/Engine/RotoPaint.cpp b/Engine/RotoPaint.cpp index 7879edd99..c51e40c8c 100644 --- a/Engine/RotoPaint.cpp +++ b/Engine/RotoPaint.cpp @@ -1531,7 +1531,7 @@ RotoPaint::render(const RenderActionArgs& args) copyChannels[i] = _imp->enabledKnobs[i].lock()->getValue(); } - unsigned int mipMapLevel = Image::getLevelFromScale(args.mappedScale.x); + unsigned int mipMapLevel = args.mappedScale.toMipmapLevel(); RenderRoIArgs rotoPaintArgs(args.time, args.mappedScale, mipMapLevel, diff --git a/Engine/RotoSmear.cpp b/Engine/RotoSmear.cpp index 32e90791f..400730a88 100644 --- a/Engine/RotoSmear.cpp +++ b/Engine/RotoSmear.cpp @@ -213,7 +213,7 @@ RotoSmear::render(const RenderActionArgs& args) assert(context); bool duringPainting = isDuringPaintStrokeCreationThreadLocal(); - unsigned int mipmapLevel = Image::getLevelFromScale(args.originalScale.x); + unsigned int mipmapLevel = args.originalScale.toMipmapLevel(); std::list > > strokes; int strokeIndex; node->getLastPaintStrokePoints(args.time, mipmapLevel, &strokes, &strokeIndex); diff --git a/Engine/TrackMarker.cpp b/Engine/TrackMarker.cpp index 6f3a946e7..eb98dcd13 100644 --- a/Engine/TrackMarker.cpp +++ b/Engine/TrackMarker.cpp @@ -743,11 +743,9 @@ TrackMarker::resetCenter() NodePtr input = context->getNode()->getInput(0); if (input) { SequenceTime time = input->getApp()->getTimeLine()->currentFrame(); - RenderScale scale; - scale.x = scale.y = 1; RectD rod; bool isProjectFormat; - StatusEnum stat = input->getEffectInstance()->getRegionOfDefinition_public(input->getHashValue(), time, scale, ViewIdx(0), &rod, &isProjectFormat); + StatusEnum stat = input->getEffectInstance()->getRegionOfDefinition_public(input->getHashValue(), time, RenderScale::identity, ViewIdx(0), &rod, &isProjectFormat); Point center; center.x = 0; center.y = 0; @@ -1197,10 +1195,8 @@ TrackMarker::getMarkerImage(int time, true, //isAnalysis false, //draftMode RenderStatsPtr() ); - RenderScale scale; - scale.x = scale.y = 1.; EffectInstance::RenderRoIArgs args( time, - scale, + RenderScale::identity, mipmapLevel, //mipmaplevel ViewIdx(0), false, diff --git a/Engine/TrackerContextPrivate.cpp b/Engine/TrackerContextPrivate.cpp index d8f40aaf7..57ba0f20f 100644 --- a/Engine/TrackerContextPrivate.cpp +++ b/Engine/TrackerContextPrivate.cpp @@ -1499,7 +1499,7 @@ TrackerContextPrivate::getInputRoDAtTime(double time) const if (!input) { useProjFormat = true; } else { - StatusEnum stat = input->getEffectInstance()->getRegionOfDefinition_public(input->getHashValue(), time, RenderScale(1.), ViewIdx(0), &ret, 0); + StatusEnum stat = input->getEffectInstance()->getRegionOfDefinition_public(input->getHashValue(), time, RenderScale::identity, ViewIdx(0), &ret, 0); if (stat == eStatusFailed) { useProjFormat = true; } else { diff --git a/Engine/TrackerFrameAccessor.cpp b/Engine/TrackerFrameAccessor.cpp index e2ec22656..572682232 100644 --- a/Engine/TrackerFrameAccessor.cpp +++ b/Engine/TrackerFrameAccessor.cpp @@ -335,8 +335,7 @@ TrackerFrameAccessor::GetImage(int /*clip*/, } // Not in accessor cache, call renderRoI - RenderScale scale; - scale.y = scale.x = Image::getScaleFromMipMapLevel( (unsigned int)downscale ); + const RenderScale scale = RenderScale::fromMipmapLevel( (unsigned int)downscale ); RectD precomputedRoD; diff --git a/Engine/TrackerNode.cpp b/Engine/TrackerNode.cpp index 9a55edd21..4b0007610 100644 --- a/Engine/TrackerNode.cpp +++ b/Engine/TrackerNode.cpp @@ -2217,9 +2217,8 @@ TrackerNode::onOverlayPenMotion(double time, if (prevDist != 0) { double dist = std::sqrt( ( pos.x() - centerPoint.x) * ( pos.x() - centerPoint.x) + ( pos.y() - centerPoint.y) * ( pos.y() - centerPoint.y) ); double ratio = dist / prevDist; - _imp->ui->selectedMarkerScale.x *= ratio; - _imp->ui->selectedMarkerScale.x = MathUtils::clamp(_imp->ui->selectedMarkerScale.x, 0.05, 1.); - _imp->ui->selectedMarkerScale.y = _imp->ui->selectedMarkerScale.x; + + _imp->ui->selectedMarkerScale = MathUtils::clamp(_imp->ui->selectedMarkerScale * ratio, 0.05, 1.); didSomething = true; } break; @@ -2235,8 +2234,8 @@ TrackerNode::onOverlayPenMotion(double time, } double x = centerKnob->getValueAtTime(time, 0); double y = centerKnob->getValueAtTime(time, 1); - double dx = delta.x * _imp->ui->selectedMarkerScale.x; - double dy = delta.y * _imp->ui->selectedMarkerScale.y; + double dx = delta.x * _imp->ui->selectedMarkerScale; + double dy = delta.y * _imp->ui->selectedMarkerScale; x += dx; y += dy; centerKnob->setValuesAtTime(time, x, y, view, eValueChangedReasonPluginEdited); diff --git a/Engine/TrackerNodeInteract.cpp b/Engine/TrackerNodeInteract.cpp index fd129e685..493d4e0cc 100644 --- a/Engine/TrackerNodeInteract.cpp +++ b/Engine/TrackerNodeInteract.cpp @@ -90,11 +90,10 @@ TrackerNodeInteract::TrackerNodeInteract(TrackerNodePrivate* p) , pboID(0) , imageGetterWatcher() , showMarkerTexture(false) - , selectedMarkerScale() + , selectedMarkerScale(1.) , selectedMarkerImg() , isTracking(false) { - selectedMarkerScale.x = selectedMarkerScale.y = 1.; } TrackerNodeInteract::~TrackerNodeInteract() @@ -920,7 +919,7 @@ TrackerNodeInteract::drawSelectedMarkerTexture(const std::pair& topLeftTex.x = texCoords.x1; topLeftTex.y = texCoords.y2; topRightTex.x = texCoords.x2; topRightTex.y = texCoords.y2; btmRightTex.x = texCoords.x2; btmRightTex.y = texCoords.y1; - Transform::Matrix3x3 m = Transform::matTransformCanonical(0, 0, selectedMarkerScale.x, selectedMarkerScale.y, 0, 0, false, 0, xCenterPercent, yCenterPercent); + Transform::Matrix3x3 m = Transform::matTransformCanonical(0, 0, selectedMarkerScale, selectedMarkerScale, 0, 0, false, 0, xCenterPercent, yCenterPercent); btmLeftTex = Transform::matApply(m, btmLeftTex); topLeftTex = Transform::matApply(m, topLeftTex); btmRightTex = Transform::matApply(m, btmRightTex); diff --git a/Engine/TrackerNodeInteract.h b/Engine/TrackerNodeInteract.h index c5eac580e..cbef0c1b9 100644 --- a/Engine/TrackerNodeInteract.h +++ b/Engine/TrackerNodeInteract.h @@ -375,7 +375,7 @@ GCC_DIAG_SUGGEST_OVERRIDE_ON GLuint pboID; TrackWatcherPtr imageGetterWatcher; bool showMarkerTexture; - RenderScale selectedMarkerScale; + double selectedMarkerScale; ImageWPtr selectedMarkerImg; bool isTracking; diff --git a/Engine/ViewerInstance.cpp b/Engine/ViewerInstance.cpp index d94895346..3296e1431 100644 --- a/Engine/ViewerInstance.cpp +++ b/Engine/ViewerInstance.cpp @@ -1158,8 +1158,6 @@ ViewerInstance::getRoDAndLookupCache(const bool useOnlyRoDCache, // If it's eSupportsMaybe and mipMapLevel!=0, don't forget to update // this after the first call to getRegionOfDefinition(). - const RenderScale scaleOne(1.); - // This may be eSupportsMaybe EffectInstance::SupportsEnum supportsRS = outArgs->activeInputToRender->supportsRenderScaleMaybe(); @@ -1169,8 +1167,7 @@ ViewerInstance::getRoDAndLookupCache(const bool useOnlyRoDCache, for (int lookup = 0; lookup < nLookups; ++lookup) { const unsigned mipMapLevel = lookup == 0 ? outArgs->mipmapLevelWithoutDraft : outArgs->mipMapLevelWithDraft; - RenderScale scale; - scale.x = scale.y = Image::getScaleFromMipMapLevel(mipMapLevel); + RenderScale scale = RenderScale::fromMipmapLevel(mipMapLevel); RectD rod; @@ -1193,7 +1190,7 @@ ViewerInstance::getRoDAndLookupCache(const bool useOnlyRoDCache, } else { stat = outArgs->activeInputToRender->getRegionOfDefinition_public(outArgs->activeInputHash, outArgs->params->time, - supportsRS == eSupportsNo ? scaleOne : scale, + supportsRS == eSupportsNo ? RenderScale::identity : scale, outArgs->params->view, &rod, 0 /*isProjectFormat*/); @@ -1517,7 +1514,7 @@ ViewerInstance::renderViewer_internal(ViewIdx view, { std::unique_ptr renderArgs; renderArgs.reset( new EffectInstance::RenderRoIArgs(inArgs.params->time, - Image::getScaleFromMipMapLevel(inArgs.params->mipMapLevel), + RenderScale::fromMipmapLevel(inArgs.params->mipMapLevel), inArgs.params->mipMapLevel, view, inArgs.forceRender, diff --git a/Global/GlobalDefines.h b/Global/GlobalDefines.h index 1b5adc02a..3a41fc94c 100644 --- a/Global/GlobalDefines.h +++ b/Global/GlobalDefines.h @@ -75,18 +75,6 @@ typedef std::uint16_t U16; NATRON_NAMESPACE_ENTER typedef int SequenceTime; - -struct RenderScale - : public OfxPointD -{ - RenderScale() { x = y = 1.; } - - RenderScale(double scale) { x = y = scale; } - - RenderScale(double scaleX, - double scaleY) { x = scaleX; y = scaleY; } -}; - typedef OfxPointD Point; typedef OfxRGBAColourF RGBAColourF; typedef OfxRGBAColourD RGBAColourD; diff --git a/Gui/CurveWidget.cpp b/Gui/CurveWidget.cpp index d1ea4db6a..a57ede41d 100644 --- a/Gui/CurveWidget.cpp +++ b/Gui/CurveWidget.cpp @@ -694,7 +694,7 @@ CurveWidget::paintGL() //GLProtectAttrib a(GL_COLOR_BUFFER_BIT | GL_LINE_BIT | GL_CURRENT_BIT | GL_ENABLE_BIT); GLProtectAttrib a(GL_LINE_BIT | GL_CURRENT_BIT | GL_ENABLE_BIT); - RenderScale scale(1.); + const OfxPointD scale = {1., 1.}; customInteract->setCallingViewport(this); customInteract->drawAction(0, scale, 0, customInteract->hasColorPicker() ? &customInteract->getLastColorPickerColor() : 0); glCheckErrorIgnoreOSXBug(); diff --git a/Gui/ViewerGL.cpp b/Gui/ViewerGL.cpp index 234906da8..a0b3dfd3b 100644 --- a/Gui/ViewerGL.cpp +++ b/Gui/ViewerGL.cpp @@ -603,7 +603,7 @@ ViewerGL::centerWipe() } void -ViewerGL::drawOverlay(unsigned int mipMapLevel) +ViewerGL::drawOverlay(unsigned int mipmapLevel) { // always running in the main thread assert( qApp && qApp->thread() == QThread::currentThread() ); @@ -722,13 +722,12 @@ ViewerGL::drawOverlay(unsigned int mipMapLevel) glCheckError(); glColor4f(1., 1., 1., 1.); - double scale = 1. / (1 << mipMapLevel); /* Draw the overlays corresponding to the image displayed on the viewer, not the current timeline's time */ double time = getCurrentlyDisplayedTime(); - _imp->viewerTab->drawOverlays( time, RenderScale(scale) ); + _imp->viewerTab->drawOverlays( time, RenderScale::fromMipmapLevel(mipmapLevel) ); glCheckErrorIgnoreOSXBug(); @@ -1881,9 +1880,7 @@ ViewerGL::mousePressEvent(QMouseEvent* e) if (!overlaysCaught && (_imp->ms == eMouseStateUndefined) && _imp->overlay) { - unsigned int mipMapLevel = getCurrentRenderScale(); - double scale = 1. / (1 << mipMapLevel); - overlaysCaught = _imp->viewerTab->notifyOverlaysPenDown( RenderScale(scale), _imp->pointerTypeOnPress, QMouseEventLocalPos(e), zoomPos, _imp->pressureOnPress, currentTimeForEvent(e) ); + overlaysCaught = _imp->viewerTab->notifyOverlaysPenDown( RenderScale::fromMipmapLevel(getCurrentRenderScale()), _imp->pointerTypeOnPress, QMouseEventLocalPos(e), zoomPos, _imp->pressureOnPress, currentTimeForEvent(e) ); if (overlaysCaught) { mustRedraw = true; } @@ -2083,9 +2080,7 @@ ViewerGL::mouseReleaseEvent(QMouseEvent* e) QMutexLocker l(&_imp->zoomCtxMutex); zoomPos = _imp->zoomCtx.toZoomCoordinates( e->x(), e->y() ); } - unsigned int mipMapLevel = getCurrentRenderScale(); - double scale = 1. / (1 << mipMapLevel); - if ( _imp->viewerTab->notifyOverlaysPenUp(RenderScale(scale), QMouseEventLocalPos(e), zoomPos, currentTimeForEvent(e), _imp->pressureOnRelease) ) { + if ( _imp->viewerTab->notifyOverlaysPenUp(RenderScale::fromMipmapLevel(getCurrentRenderScale()), QMouseEventLocalPos(e), zoomPos, currentTimeForEvent(e), _imp->pressureOnRelease) ) { mustRedraw = true; } if (mustRedraw) { @@ -2508,10 +2503,8 @@ ViewerGL::penMotionInternal(int x, }; break; default: { QPointF localPos(x, y); - unsigned int mipMapLevel = getCurrentRenderScale(); - double scale = 1. / (1 << mipMapLevel); if ( _imp->overlay && - _imp->viewerTab->notifyOverlaysPenMotion(RenderScale(scale), localPos, zoomPos, pressure, timestamp) ) { + _imp->viewerTab->notifyOverlaysPenMotion(RenderScale::fromMipmapLevel(getCurrentRenderScale()), localPos, zoomPos, pressure, timestamp) ) { mustRedraw = true; overlaysCaughtByPlugin = true; } @@ -2539,15 +2532,12 @@ ViewerGL::penMotionInternal(int x, void ViewerGL::mouseDoubleClickEvent(QMouseEvent* e) { - unsigned int mipMapLevel = getCurrentRenderScale(); QPointF pos_opengl; { QMutexLocker l(&_imp->zoomCtxMutex); pos_opengl = _imp->zoomCtx.toZoomCoordinates( e->x(), e->y() ); } - double scale = 1. / (1 << mipMapLevel); - - if ( _imp->viewerTab->notifyOverlaysPenDoubleClick(RenderScale(scale), QMouseEventLocalPos(e), pos_opengl) ) { + if ( _imp->viewerTab->notifyOverlaysPenDoubleClick(RenderScale::fromMipmapLevel(getCurrentRenderScale()), QMouseEventLocalPos(e), pos_opengl) ) { update(); } QOpenGLWidget::mouseDoubleClickEvent(e); @@ -3139,8 +3129,7 @@ ViewerGL::focusInEvent(QFocusEvent* e) if ( !_imp->viewerTab->getGui() ) { return; } - double scale = 1. / ( 1 << getCurrentRenderScale() ); - if ( _imp->viewerTab->notifyOverlaysFocusGained( RenderScale(scale) ) ) { + if ( _imp->viewerTab->notifyOverlaysFocusGained( RenderScale::fromMipmapLevel(getCurrentRenderScale()) ) ) { update(); } QOpenGLWidget::focusInEvent(e); @@ -3156,8 +3145,7 @@ ViewerGL::focusOutEvent(QFocusEvent* e) return; } - double scale = 1. / ( 1 << getCurrentRenderScale() ); - if ( _imp->viewerTab->notifyOverlaysFocusLost( RenderScale(scale) ) ) { + if ( _imp->viewerTab->notifyOverlaysFocusLost( RenderScale::fromMipmapLevel(getCurrentRenderScale()) ) ) { update(); } QOpenGLWidget::focusOutEvent(e); diff --git a/Gui/ViewerTab10.cpp b/Gui/ViewerTab10.cpp index 6cf09378a..6139b3879 100644 --- a/Gui/ViewerTab10.cpp +++ b/Gui/ViewerTab10.cpp @@ -617,11 +617,11 @@ ViewerTab::keyPressEvent(QKeyEvent* e) bool accept = true; Qt::KeyboardModifiers modifiers = e->modifiers(); Qt::Key key = (Qt::Key)Gui::handleNativeKeys( e->key(), e->nativeScanCode(), e->nativeVirtualKey() ); - double scale = 1. / ( 1 << _imp->viewer->getCurrentRenderScale() ); - if ( e->isAutoRepeat() && notifyOverlaysKeyRepeat(RenderScale(scale), e) ) { + const unsigned int mipMapLevel = _imp->viewer->getCurrentRenderScale(); + if ( e->isAutoRepeat() && notifyOverlaysKeyRepeat(RenderScale::fromMipmapLevel(mipMapLevel), e) ) { update(); - } else if ( notifyOverlaysKeyDown(RenderScale(scale), e) ) { + } else if ( notifyOverlaysKeyDown(RenderScale::fromMipmapLevel(mipMapLevel), e) ) { update(); } else if ( isKeybind(kShortcutGroupViewer, kShortcutIDActionLuminance, modifiers, key) ) { int currentIndex = _imp->viewerChannels->activeIndex(); @@ -901,8 +901,8 @@ ViewerTab::keyReleaseEvent(QKeyEvent* e) if ( !getGui() ) { return QWidget::keyPressEvent(e); } - double scale = 1. / ( 1 << _imp->viewer->getCurrentRenderScale() ); - if ( notifyOverlaysKeyUp(RenderScale(scale), e) ) { + const unsigned int mipMapLevel = _imp->viewer->getCurrentRenderScale(); + if ( notifyOverlaysKeyUp(RenderScale::fromMipmapLevel(mipMapLevel), e) ) { _imp->viewer->redraw(); } else { handleUnCaughtKeyUpEvent(e); diff --git a/Gui/ViewerTabPrivate.cpp b/Gui/ViewerTabPrivate.cpp index 8ee10c562..10e9e3570 100644 --- a/Gui/ViewerTabPrivate.cpp +++ b/Gui/ViewerTabPrivate.cpp @@ -174,7 +174,6 @@ ViewerTabPrivate::getOverlayTransform(double time, if ( currentNode == targetNode ) { return true; } - RenderScale s(1.); EffectInstancePtr input; StatusEnum stat = eStatusReplyDefault; Transform::Matrix3x3 mat; @@ -186,7 +185,7 @@ ViewerTabPrivate::getOverlayTransform(double time, if ( !currentNode->getNode()->isNodeDisabled() /*&& currentNode->getNode()->getCurrentCanTransform()*/ ) { // Always use draft mode to draw overlay (so that transforms are applied, // even in case of motion blur, see Transform3x3Plugin::getTransform() ) - stat = currentNode->getTransform_public(time, s, /*draftRender=*/true, view, &input, &mat); + stat = currentNode->getTransform_public(time, RenderScale::identity, /*draftRender=*/true, view, &input, &mat); } if (stat == eStatusFailed) { return false; From 0b03e24534f645e77b88837ca484f4ba70a1831b Mon Sep 17 00:00:00 2001 From: Aaron Colwell <300262+acolwell@users.noreply.github.com> Date: Wed, 13 Sep 2023 14:43:11 -0700 Subject: [PATCH 02/31] Fix mipmapLevel capitalization and a few minor mipmapLevel related cleanups (#922) * Make mipmapLevel capitalization consistent across the codebase. * Fix instances of mipmapLevels stored in ints instead of unsigned ints. * Removed ViewerInstance::getViewerMipmapLevel() since it was identical to ViewerInstance::getMipmapLevel() and updated the single caller. * Rename OverlaySupport::getCurrentRenderScale() to getCurrentMipmapLevel(). --- Engine/Bezier.cpp | 52 ++++----- Engine/Bezier.h | 18 ++-- Engine/DiskCacheNode.cpp | 2 +- Engine/EffectInstance.cpp | 167 ++++++++++++++-------------- Engine/EffectInstance.h | 24 ++--- Engine/EffectInstancePrivate.cpp | 24 ++--- Engine/EffectInstancePrivate.h | 28 ++--- Engine/EffectInstanceRenderRoI.cpp | 116 ++++++++++---------- Engine/FrameEntrySerialization.h | 2 +- Engine/FrameKey.cpp | 10 +- Engine/FrameKey.h | 8 +- Engine/HistogramCPU.cpp | 10 +- Engine/HistogramCPU.h | 2 +- Engine/Image.cpp | 48 ++++----- Engine/Image.h | 20 ++-- Engine/ImageCopyChannels.cpp | 4 +- Engine/ImageKey.cpp | 4 +- Engine/ImageParams.h | 21 ++-- Engine/ImageParamsSerialization.h | 2 +- Engine/Knob.h | 1 - Engine/KnobGuiI.h | 1 - Engine/Node.cpp | 18 ++-- Engine/Node.h | 4 +- Engine/OfxClipInstance.cpp | 34 +++--- Engine/OfxClipInstance.h | 6 +- Engine/OfxEffectInstance.cpp | 24 ++--- Engine/OfxImageEffectInstance.cpp | 3 +- Engine/OpenGLViewerI.h | 8 +- Engine/OutputEffectInstance.cpp | 2 +- Engine/OverlaySupport.h | 2 +- Engine/ParallelRenderArgs.cpp | 26 ++--- Engine/RectD.cpp | 4 +- Engine/RectD.h | 2 +- Engine/RectI.cpp | 2 +- Engine/RectI.h | 2 +- Engine/RenderStats.cpp | 6 +- Engine/RenderStats.h | 4 +- Engine/RotoContext.cpp | 20 ++-- Engine/RotoPaint.cpp | 4 +- Engine/RotoSmear.cpp | 2 +- Engine/RotoStrokeItem.cpp | 8 +- Engine/RotoStrokeItem.h | 2 +- Engine/Settings.cpp | 2 +- Engine/Settings.h | 2 +- Engine/TrackerFrameAccessor.cpp | 16 +-- Engine/UpdateViewerParams.h | 4 +- Engine/ViewerInstance.cpp | 72 ++++++------- Engine/ViewerInstance.h | 12 +-- Engine/ViewerInstancePrivate.h | 4 +- Gui/CurveWidget.h | 1 - Gui/CustomParamInteract.h | 1 - Gui/DopeSheetView.cpp | 11 -- Gui/DopeSheetView.h | 1 - Gui/Histogram.cpp | 16 +-- Gui/ProjectGui.cpp | 2 +- Gui/ProjectGuiSerialization.cpp | 2 +- Gui/ProjectGuiSerialization.h | 4 +- Gui/PyGuiApp.cpp | 4 +- Gui/RenderStatsDialog.cpp | 2 +- Gui/ViewerGL.cpp | 168 ++++++++++++++--------------- Gui/ViewerGL.h | 22 ++-- Gui/ViewerGLPrivate.cpp | 6 +- Gui/ViewerGLPrivate.h | 6 +- Gui/ViewerTab.h | 4 +- Gui/ViewerTab10.cpp | 10 +- Gui/ViewerTab30.cpp | 16 +-- 66 files changed, 550 insertions(+), 585 deletions(-) diff --git a/Engine/Bezier.cpp b/Engine/Bezier.cpp index 471bb8c38..1b30f5be8 100644 --- a/Engine/Bezier.cpp +++ b/Engine/Bezier.cpp @@ -337,7 +337,7 @@ bezierSegmentBboxUpdate(bool useGuiCurves, const BezierCP & last, double time, ViewIdx view, - unsigned int mipMapLevel, + unsigned int mipmapLevel, const Transform::Matrix3x3& transform, RectD* bbox) ///< input/output { @@ -372,8 +372,8 @@ bezierSegmentBboxUpdate(bool useGuiCurves, p2.y = p2M.y / p2M.z; p3.y = p3M.y / p3M.z; - if (mipMapLevel > 0) { - int pot = 1 << mipMapLevel; + if (mipmapLevel > 0) { + int pot = 1 << mipmapLevel; p0.x /= pot; p0.y /= pot; @@ -396,7 +396,7 @@ Bezier::bezierSegmentListBboxUpdate(bool useGuiCurves, bool isOpenBezier, double time, ViewIdx view, - unsigned int mipMapLevel, + unsigned int mipmapLevel, const Transform::Matrix3x3& transform, RectD* bbox) ///< input/output { @@ -428,7 +428,7 @@ Bezier::bezierSegmentListBboxUpdate(bool useGuiCurves, } next = points.begin(); } - bezierSegmentBboxUpdate(useGuiCurves, *(*it), *(*next), time, view, mipMapLevel, transform, bbox); + bezierSegmentBboxUpdate(useGuiCurves, *(*it), *(*next), time, view, mipmapLevel, transform, bbox); // increment for next iteration if ( next != points.end() ) { @@ -717,7 +717,7 @@ bezierSegmentEval(bool useGuiCurves, const BezierCP & last, double time, ViewIdx view, - unsigned int mipMapLevel, + unsigned int mipmapLevel, #ifdef ROTO_BEZIER_EVAL_ITERATIVE int nbPointsPerSegment, #else @@ -752,8 +752,8 @@ bezierSegmentEval(bool useGuiCurves, p3.x = p3M.x / p3M.z; p3.y = p3M.y / p3M.z; - if (mipMapLevel > 0) { - int pot = 1 << mipMapLevel; + if (mipmapLevel > 0) { + int pot = 1 << mipmapLevel; p0.x /= pot; p0.y /= pot; @@ -2539,7 +2539,7 @@ Bezier::deCastelJau(bool isOpenBezier, bool useGuiCurves, const std::list& cps, double time, - unsigned int mipMapLevel, + unsigned int mipmapLevel, bool finished, int nBPointsPerSegment, const Transform::Matrix3x3& transform, @@ -2572,7 +2572,7 @@ Bezier::deCastelJau(bool isOpenBezier, if (points) { std::list segmentPoints; - bezierSegmentEval(useGuiCurves, *(*it), *(*next), time, ViewIdx(0), mipMapLevel, nBPointsPerSegment, transform, &segmentPoints, bbox); + bezierSegmentEval(useGuiCurves, *(*it), *(*next), time, ViewIdx(0), mipmapLevel, nBPointsPerSegment, transform, &segmentPoints, bbox); // If we are a closed bezier or we are not on the last segment, remove the last point so we don't add duplicates if (isClosed || !isLastSegment) { @@ -2583,7 +2583,7 @@ Bezier::deCastelJau(bool isOpenBezier, points->push_back(segmentPoints); } else { assert(pointsSingleList); - bezierSegmentEval(useGuiCurves, *(*it), *(*next), time, ViewIdx(0), mipMapLevel, nBPointsPerSegment, transform, pointsSingleList, bbox); + bezierSegmentEval(useGuiCurves, *(*it), *(*next), time, ViewIdx(0), mipmapLevel, nBPointsPerSegment, transform, pointsSingleList, bbox); // If we are a closed bezier or we are not on the last segment, remove the last point so we don't add duplicates if (isClosed || !isLastSegment) { if (!pointsSingleList->empty()) { @@ -2605,7 +2605,7 @@ Bezier::deCastelJau(bool isOpenBezier, void Bezier::evaluateAtTime_DeCasteljau(bool useGuiPoints, double time, - unsigned int mipMapLevel, + unsigned int mipmapLevel, #ifdef ROTO_BEZIER_EVAL_ITERATIVE int nbPointsPerSegment, #else @@ -2614,7 +2614,7 @@ Bezier::evaluateAtTime_DeCasteljau(bool useGuiPoints, std::list >* points, RectD* bbox) const { - evaluateAtTime_DeCasteljau_internal(useGuiPoints, time, mipMapLevel, + evaluateAtTime_DeCasteljau_internal(useGuiPoints, time, mipmapLevel, #ifdef ROTO_BEZIER_EVAL_ITERATIVE nbPointsPerSegment, #else @@ -2626,7 +2626,7 @@ Bezier::evaluateAtTime_DeCasteljau(bool useGuiPoints, void Bezier::evaluateAtTime_DeCasteljau(bool useGuiPoints, double time, - unsigned int mipMapLevel, + unsigned int mipmapLevel, #ifdef ROTO_BEZIER_EVAL_ITERATIVE int nbPointsPerSegment, #else @@ -2635,7 +2635,7 @@ Bezier::evaluateAtTime_DeCasteljau(bool useGuiPoints, std::list* pointsSingleList, RectD* bbox) const { - evaluateAtTime_DeCasteljau_internal(useGuiPoints, time, mipMapLevel, + evaluateAtTime_DeCasteljau_internal(useGuiPoints, time, mipmapLevel, #ifdef ROTO_BEZIER_EVAL_ITERATIVE nbPointsPerSegment, #else @@ -2647,7 +2647,7 @@ Bezier::evaluateAtTime_DeCasteljau(bool useGuiPoints, void Bezier::evaluateAtTime_DeCasteljau_internal(bool useGuiCurves, double time, - unsigned int mipMapLevel, + unsigned int mipmapLevel, #ifdef ROTO_BEZIER_EVAL_ITERATIVE int nbPointsPerSegment, #else @@ -2662,7 +2662,7 @@ Bezier::evaluateAtTime_DeCasteljau_internal(bool useGuiCurves, getTransformAtTime(time, &transform); QMutexLocker l(&itemMutex); - deCastelJau(isOpenBezier(), useGuiCurves, _imp->points, time, mipMapLevel, _imp->finished, + deCastelJau(isOpenBezier(), useGuiCurves, _imp->points, time, mipmapLevel, _imp->finished, #ifdef ROTO_BEZIER_EVAL_ITERATIVE nbPointsPerSegment, #else @@ -2674,11 +2674,11 @@ Bezier::evaluateAtTime_DeCasteljau_internal(bool useGuiCurves, void Bezier::evaluateAtTime_DeCasteljau_autoNbPoints(bool useGuiPoints, double time, - unsigned int mipMapLevel, + unsigned int mipmapLevel, std::list >* points, RectD* bbox) const { - evaluateAtTime_DeCasteljau(useGuiPoints, time, mipMapLevel, + evaluateAtTime_DeCasteljau(useGuiPoints, time, mipmapLevel, #ifdef ROTO_BEZIER_EVAL_ITERATIVE -1, #else @@ -2690,7 +2690,7 @@ Bezier::evaluateAtTime_DeCasteljau_autoNbPoints(bool useGuiPoints, void Bezier::evaluateFeatherPointsAtTime_DeCasteljau(bool useGuiCurves, double time, - unsigned int mipMapLevel, + unsigned int mipmapLevel, #ifdef ROTO_BEZIER_EVAL_ITERATIVE int nbPointsPerSegment, #else @@ -2700,7 +2700,7 @@ Bezier::evaluateFeatherPointsAtTime_DeCasteljau(bool useGuiCurves, std::list* points, RectD* bbox) const { - evaluateFeatherPointsAtTime_DeCasteljau_internal(useGuiCurves, time, mipMapLevel, + evaluateFeatherPointsAtTime_DeCasteljau_internal(useGuiCurves, time, mipmapLevel, #ifdef ROTO_BEZIER_EVAL_ITERATIVE nbPointsPerSegment, #else @@ -2712,7 +2712,7 @@ Bezier::evaluateFeatherPointsAtTime_DeCasteljau(bool useGuiCurves, void Bezier::evaluateFeatherPointsAtTime_DeCasteljau_internal(bool useGuiPoints, double time, - unsigned int mipMapLevel, + unsigned int mipmapLevel, #ifdef ROTO_BEZIER_EVAL_ITERATIVE int nbPointsPerSegment, #else @@ -2760,7 +2760,7 @@ Bezier::evaluateFeatherPointsAtTime_DeCasteljau_internal(bool useGuiPoints, } if (points) { std::list segmentPoints; - bezierSegmentEval(useGuiPoints, *(*it), *(*next), time, ViewIdx(0), mipMapLevel, + bezierSegmentEval(useGuiPoints, *(*it), *(*next), time, ViewIdx(0), mipmapLevel, #ifdef ROTO_BEZIER_EVAL_ITERATIVE nbPointsPerSegment, #else @@ -2777,7 +2777,7 @@ Bezier::evaluateFeatherPointsAtTime_DeCasteljau_internal(bool useGuiPoints, points->push_back(segmentPoints); } else { assert(pointsSingleList); - bezierSegmentEval(useGuiPoints, *(*it), *(*next), time, ViewIdx(0), mipMapLevel, + bezierSegmentEval(useGuiPoints, *(*it), *(*next), time, ViewIdx(0), mipmapLevel, #ifdef ROTO_BEZIER_EVAL_ITERATIVE nbPointsPerSegment, #else @@ -2809,7 +2809,7 @@ Bezier::evaluateFeatherPointsAtTime_DeCasteljau_internal(bool useGuiPoints, void Bezier::evaluateFeatherPointsAtTime_DeCasteljau(bool useGuiPoints, double time, - unsigned int mipMapLevel, + unsigned int mipmapLevel, #ifdef ROTO_BEZIER_EVAL_ITERATIVE int nbPointsPerSegment, #else @@ -2819,7 +2819,7 @@ Bezier::evaluateFeatherPointsAtTime_DeCasteljau(bool useGuiPoints, std::list >* points, ///< output RectD* bbox) const ///< output { - evaluateFeatherPointsAtTime_DeCasteljau_internal(useGuiPoints, time, mipMapLevel, + evaluateFeatherPointsAtTime_DeCasteljau_internal(useGuiPoints, time, mipmapLevel, #ifdef ROTO_BEZIER_EVAL_ITERATIVE nbPointsPerSegment, #else diff --git a/Engine/Bezier.h b/Engine/Bezier.h index 27fe7b2ac..3cd4cf646 100644 --- a/Engine/Bezier.h +++ b/Engine/Bezier.h @@ -360,7 +360,7 @@ GCC_DIAG_SUGGEST_OVERRIDE_ON static void deCastelJau(bool isOpenBezier, bool useGuiCurves, - const std::list& cps, double time, unsigned int mipMapLevel, + const std::list& cps, double time, unsigned int mipmapLevel, bool finished, int nBPointsPerSegment, const Transform::Matrix3x3& transform, @@ -378,7 +378,7 @@ GCC_DIAG_SUGGEST_OVERRIDE_ON **/ void evaluateAtTime_DeCasteljau(bool useGuiCurves, double time, - unsigned int mipMapLevel, + unsigned int mipmapLevel, #ifdef ROTO_BEZIER_EVAL_ITERATIVE int nbPointsPerSegment, #else @@ -389,7 +389,7 @@ GCC_DIAG_SUGGEST_OVERRIDE_ON void evaluateAtTime_DeCasteljau(bool useGuiCurves, double time, - unsigned int mipMapLevel, + unsigned int mipmapLevel, #ifdef ROTO_BEZIER_EVAL_ITERATIVE int nbPointsPerSegment, #else @@ -402,7 +402,7 @@ GCC_DIAG_SUGGEST_OVERRIDE_ON void evaluateAtTime_DeCasteljau_internal(bool useGuiCurves, double time, - unsigned int mipMapLevel, + unsigned int mipmapLevel, #ifdef ROTO_BEZIER_EVAL_ITERATIVE int nbPointsPerSegment, #else @@ -419,7 +419,7 @@ GCC_DIAG_SUGGEST_OVERRIDE_ON **/ void evaluateAtTime_DeCasteljau_autoNbPoints(bool useGuiCurves, double time, - unsigned int mipMapLevel, + unsigned int mipmapLevel, std::list >* points, RectD* bbox) const; @@ -429,7 +429,7 @@ GCC_DIAG_SUGGEST_OVERRIDE_ON **/ void evaluateFeatherPointsAtTime_DeCasteljau(bool useGuiCurves, double time, - unsigned int mipMapLevel, + unsigned int mipmapLevel, #ifdef ROTO_BEZIER_EVAL_ITERATIVE int nbPointsPerSegment, #else @@ -441,7 +441,7 @@ GCC_DIAG_SUGGEST_OVERRIDE_ON void evaluateFeatherPointsAtTime_DeCasteljau(bool useGuiCurves, double time, - unsigned int mipMapLevel, + unsigned int mipmapLevel, #ifdef ROTO_BEZIER_EVAL_ITERATIVE int nbPointsPerSegment, #else @@ -455,7 +455,7 @@ GCC_DIAG_SUGGEST_OVERRIDE_ON void evaluateFeatherPointsAtTime_DeCasteljau_internal(bool useGuiCurves, double time, - unsigned int mipMapLevel, + unsigned int mipmapLevel, #ifdef ROTO_BEZIER_EVAL_ITERATIVE int nbPointsPerSegment, #else @@ -479,7 +479,7 @@ GCC_DIAG_SUGGEST_OVERRIDE_ON bool isOpenBezier, double time, ViewIdx view, - unsigned int mipMapLevel, + unsigned int mipmapLevel, const Transform::Matrix3x3& transform, RectD* bbox); diff --git a/Engine/DiskCacheNode.cpp b/Engine/DiskCacheNode.cpp index d777f4876..cf398433a 100644 --- a/Engine/DiskCacheNode.cpp +++ b/Engine/DiskCacheNode.cpp @@ -221,7 +221,7 @@ DiskCacheNode::render(const RenderActionArgs& args) if (!srcImg) { return eStatusFailed; } - if ( srcImg->getMipMapLevel() != output.second->getMipMapLevel() ) { + if ( srcImg->getMipmapLevel() != output.second->getMipmapLevel() ) { throw std::runtime_error("Host gave image with wrong scale"); } if ( ( srcImg->getComponents() != output.second->getComponents() ) || ( srcImg->getBitDepth() != output.second->getBitDepth() ) ) { diff --git a/Engine/EffectInstance.cpp b/Engine/EffectInstance.cpp index b104c29d6..ecbeceb22 100644 --- a/Engine/EffectInstance.cpp +++ b/Engine/EffectInstance.cpp @@ -814,7 +814,7 @@ EffectInstance::getImage(int inputNb, /* * These are the data fields stored in the TLS from the on-going render action or instance changed action */ - unsigned int mipMapLevel = scale.toMipmapLevel(); + unsigned int mipmapLevel = scale.toMipmapLevel(); RoIMap inputsRoI; bool isIdentity = false; EffectInstancePtr identityInput; @@ -964,15 +964,15 @@ EffectInstance::getImage(int inputNb, ///Does this node supports images at a scale different than 1 - bool renderFullScaleThenDownscale = (!supportsRenderScale() && mipMapLevel != 0 && returnStorage == eStorageModeRAM); + bool renderFullScaleThenDownscale = (!supportsRenderScale() && mipmapLevel != 0 && returnStorage == eStorageModeRAM); ///Do we want to render the graph upstream at scale 1 or at the requested render scale ? (user setting) bool renderScaleOneUpstreamIfRenderScaleSupportDisabled = false; - unsigned int renderMappedMipMapLevel = mipMapLevel; + unsigned int renderMappedMipmapLevel = mipmapLevel; if (renderFullScaleThenDownscale) { renderScaleOneUpstreamIfRenderScaleSupportDisabled = node->useScaleOneImagesWhenRenderScaleSupportIsDisabled(); if (renderScaleOneUpstreamIfRenderScaleSupportDisabled) { - renderMappedMipMapLevel = 0; + renderMappedMipmapLevel = 0; } } @@ -991,7 +991,7 @@ EffectInstance::getImage(int inputNb, } - RectI pixelRoI = roi.toPixelEnclosing(renderScaleOneUpstreamIfRenderScaleSupportDisabled ? 0 : mipMapLevel, par); + RectI pixelRoI = roi.toPixelEnclosing(renderScaleOneUpstreamIfRenderScaleSupportDisabled ? 0 : mipmapLevel, par); ImagePtr inputImg; @@ -1001,7 +1001,7 @@ EffectInstance::getImage(int inputNb, assert(attachedStroke); if (attachedStroke) { if (duringPaintStroke) { - inputImg = node->getOrRenderLastStrokeImage(mipMapLevel, par, components, depth); + inputImg = node->getOrRenderLastStrokeImage(mipmapLevel, par, components, depth); } else { RectD rotoSrcRod; if (inputIsRotoBrush) { @@ -1018,7 +1018,7 @@ EffectInstance::getImage(int inputNb, } inputImg = attachedStroke->renderMaskFromStroke(components, - time, view, depth, mipMapLevel, rotoSrcRod); + time, view, depth, mipmapLevel, rotoSrcRod); if ( roto->isDoingNeatRender() ) { getApp()->updateStrokeImage(inputImg, 0, false); @@ -1065,7 +1065,7 @@ EffectInstance::getImage(int inputNb, std::map inputImages; RenderRoIRetCode retCode = inputEffect->renderRoI(RenderRoIArgs(time, scale, - renderMappedMipMapLevel, + renderMappedMipmapLevel, view, byPassCache, pixelRoI, @@ -1104,19 +1104,19 @@ EffectInstance::getImage(int inputNb, if (roiPixel) { *roiPixel = pixelRoI; } - unsigned int inputImgMipMapLevel = inputImg->getMipMapLevel(); + unsigned int inputImgMipmapLevel = inputImg->getMipmapLevel(); ///If the plug-in doesn't support the render scale, but the image is downscaled, up-scale it. ///Note that we do NOT cache it because it is really low def! ///For OpenGL textures, we do not do it because GL_TEXTURE_2D uses normalized texture coordinates anyway, so any OpenGL plug-in should support render scale. - if (!dontUpscale && renderFullScaleThenDownscale && (inputImgMipMapLevel != 0) && returnStorage == eStorageModeRAM) { - assert(inputImgMipMapLevel != 0); + if (!dontUpscale && renderFullScaleThenDownscale && (inputImgMipmapLevel != 0) && returnStorage == eStorageModeRAM) { + assert(inputImgMipmapLevel != 0); ///Resize the image according to the requested scale ImageBitDepthEnum bitdepth = inputImg->getBitDepth(); const RectI bounds = inputImg->getRoD().toPixelEnclosing(0, par); ImagePtr rescaledImg = std::make_shared( inputImg->getComponents(), inputImg->getRoD(), bounds, 0, par, bitdepth, inputImg->getPremultiplication(), inputImg->getFieldingOrder() ); - inputImg->upscaleMipMap( inputImg->getBounds(), inputImgMipMapLevel, 0, rescaledImg.get() ); + inputImg->upscaleMipmap( inputImg->getBounds(), inputImgMipmapLevel, 0, rescaledImg.get() ); if (roiPixel) { if (!inputRoDSet) { bool isProjectFormat; @@ -1124,7 +1124,7 @@ EffectInstance::getImage(int inputNb, Q_UNUSED(st); } - pixelRoI = pixelRoI.toNewMipMapLevel(inputImgMipMapLevel, 0, par, inputRoD); + pixelRoI = pixelRoI.toNewMipmapLevel(inputImgMipmapLevel, 0, par, inputRoD); *roiPixel = pixelRoI; } @@ -1176,10 +1176,10 @@ EffectInstance::calcDefaultRegionOfDefinition(U64 /*hash*/, RectD *rod) { - unsigned int mipMapLevel = scale.toMipmapLevel(); + unsigned int mipmapLevel = scale.toMipmapLevel(); RectI format = getOutputFormat(); double par = getAspectRatio(-1); - *rod = format.toCanonical_noClipping(mipMapLevel, par); + *rod = format.toCanonical_noClipping(mipmapLevel, par); } StatusEnum @@ -1281,8 +1281,8 @@ EffectInstance::ifInfiniteApplyHeuristic(U64 hash, RectI format = getOutputFormat(); assert(!format.isNull()); double par = getAspectRatio(-1); - unsigned int mipMapLevel = scale.toMipmapLevel(); - canonicalFormat = format.toCanonical_noClipping(mipMapLevel, par); + unsigned int mipmapLevel = scale.toMipmapLevel(); + canonicalFormat = format.toCanonical_noClipping(mipmapLevel, par); } // BE CAREFUL: @@ -1617,7 +1617,7 @@ EffectInstance::getImageFromCacheAndConvertIfNeeded(bool /*useCache*/, StorageModeEnum storage, StorageModeEnum returnStorage, const ImageKey & key, - unsigned int mipMapLevel, + unsigned int mipmapLevel, const RectI* boundsParam, const RectD* rodParam, const RectI& roi, @@ -1665,7 +1665,7 @@ EffectInstance::getImageFromCacheAndConvertIfNeeded(bool /*useCache*/, ImagePtr imageToConvert; for (ImageList::iterator it = cachedImages.begin(); it != cachedImages.end(); ++it) { - unsigned int imgMMlevel = (*it)->getMipMapLevel(); + unsigned int imgMMlevel = (*it)->getMipmapLevel(); const ImagePlaneDesc & imgComps = (*it)->getComponents(); ImageBitDepthEnum imgDepth = (*it)->getBitDepth(); @@ -1692,26 +1692,26 @@ EffectInstance::getImageFromCacheAndConvertIfNeeded(bool /*useCache*/, }*/ bool convertible = (imgComps.isColorPlane() && components.isColorPlane()) || (imgComps == components); - if ( (imgMMlevel == mipMapLevel) && convertible && + if ( (imgMMlevel == mipmapLevel) && convertible && ( getSizeOfForBitDepth(imgDepth) >= getSizeOfForBitDepth(bitdepth) ) /* && imgComps == components && imgDepth == bitdepth*/ ) { ///We found a matching image *image = *it; break; } else { - if ( (*it)->getStorageMode() != eStorageModeRAM || (imgMMlevel >= mipMapLevel) || !convertible || + if ( (*it)->getStorageMode() != eStorageModeRAM || (imgMMlevel >= mipmapLevel) || !convertible || ( getSizeOfForBitDepth(imgDepth) < getSizeOfForBitDepth(bitdepth) ) ) { ///Either smaller resolution or not enough components or bit-depth is not as deep, don't use the image continue; } - assert(imgMMlevel < mipMapLevel); + assert(imgMMlevel < mipmapLevel); if (!imageToConvert) { imageToConvert = *it; } else { ///We found an image which scale is closer to the requested mipmap level we want, use it instead - if ( imgMMlevel > imageToConvert->getMipMapLevel() ) { + if ( imgMMlevel > imageToConvert->getMipmapLevel() ) { imageToConvert = *it; } } @@ -1723,10 +1723,10 @@ EffectInstance::getImageFromCacheAndConvertIfNeeded(bool /*useCache*/, (imageToConvert)->allocateMemory(); - if (imageToConvert->getMipMapLevel() != mipMapLevel) { + if (imageToConvert->getMipmapLevel() != mipmapLevel) { ImageParamsPtr oldParams = imageToConvert->getParams(); - assert(imageToConvert->getMipMapLevel() < mipMapLevel); + assert(imageToConvert->getMipmapLevel() < mipmapLevel); //This is the bounds of the upscaled image RectI imgToConvertBounds = imageToConvert->getBounds(); @@ -1734,7 +1734,7 @@ EffectInstance::getImageFromCacheAndConvertIfNeeded(bool /*useCache*/, //The rodParam might be different of oldParams->getRoD() simply because the RoD is dependent on the mipmap level const RectD & rod = rodParam ? *rodParam : oldParams->getRoD(); - RectI downscaledBounds = rod.toPixelEnclosing(mipMapLevel, imageToConvert->getPixelAspectRatio()); + RectI downscaledBounds = rod.toPixelEnclosing(mipmapLevel, imageToConvert->getPixelAspectRatio()); if (boundsParam) { downscaledBounds.merge(*boundsParam); @@ -1743,7 +1743,7 @@ EffectInstance::getImageFromCacheAndConvertIfNeeded(bool /*useCache*/, ImageParamsPtr imageParams = Image::makeParams(rod, downscaledBounds, oldParams->getPixelAspectRatio(), - mipMapLevel, + mipmapLevel, oldParams->isRodProjectFormat(), oldParams->getComponents(), oldParams->getBitDepth(), @@ -1752,8 +1752,6 @@ EffectInstance::getImageFromCacheAndConvertIfNeeded(bool /*useCache*/, eStorageModeRAM); - imageParams->setMipMapLevel(mipMapLevel); - ImagePtr img; getOrCreateFromCacheInternal(key, imageParams, imageToConvert->usesBitMap(), &img); @@ -1768,16 +1766,16 @@ EffectInstance::getImageFromCacheAndConvertIfNeeded(bool /*useCache*/, of the downscale image, clip it against the bounds of the downscale image, re-upscale it to the original mipmap level and ensure that it lies into the original image bounds */ - int downscaleLevels = img->getMipMapLevel() - imageToConvert->getMipMapLevel(); + int downscaleLevels = img->getMipmapLevel() - imageToConvert->getMipmapLevel(); RectI dstRoi = imgToConvertBounds.downscalePowerOfTwoSmallestEnclosing(downscaleLevels); dstRoi.clipIfOverlaps(downscaledBounds); dstRoi = dstRoi.upscalePowerOfTwo(downscaleLevels); dstRoi.clipIfOverlaps(imgToConvertBounds); if (imgToConvertBounds.area() > 1) { - imageToConvert->downscaleMipMap( rod, + imageToConvert->downscaleMipmap( rod, dstRoi, - imageToConvert->getMipMapLevel(), img->getMipMapLevel(), + imageToConvert->getMipmapLevel(), img->getMipmapLevel(), imageToConvert->usesBitMap(), img.get() ); } else { @@ -2085,7 +2083,7 @@ EffectInstance::renderInputImagesForRoI(const FrameViewRequest* request, const RectD & rod, const RectD & canonicalRenderWindow, const InputMatrixMapPtr& inputTransforms, - unsigned int mipMapLevel, + unsigned int mipmapLevel, const RenderScale & renderMappedScale, bool useScaleOneInputImages, bool byPassCache, @@ -2112,7 +2110,7 @@ EffectInstance::renderInputImagesForRoI(const FrameViewRequest* request, inputTransforms, useTransforms, renderStorageMode, - mipMapLevel, + mipmapLevel, time, view, NodePtr(), @@ -2146,8 +2144,8 @@ EffectInstance::Implementation::tiledRenderingFunctor(EffectInstance::Implementa args.firstFrame, args.lastFrame, args.preferredInput, - args.mipMapLevel, - args.renderMappedMipMapLevel, + args.mipmapLevel, + args.renderMappedMipmapLevel, args.rod, args.time, args.view, @@ -2173,8 +2171,8 @@ EffectInstance::Implementation::tiledRenderingFunctor(const RectToRender & rectT const int firstFrame, const int lastFrame, const int preferredInput, - const unsigned int mipMapLevel, - const unsigned int renderMappedMipMapLevel, + const unsigned int mipmapLevel, + const unsigned int renderMappedMipmapLevel, const RectD & rod, const double time, const ViewIdx view, @@ -2208,15 +2206,15 @@ EffectInstance::Implementation::tiledRenderingFunctor(const RectToRender & rectT RectI renderMappedRectToRender = rectToRender.rect; /* - * downscaledRectToRender is in the mipMapLevel + * downscaledRectToRender is in the mipmapLevel */ RectI downscaledRectToRender = renderMappedRectToRender; ///Upscale the RoI to a region in the full scale image so it is in canonical coordinates if (renderFullScaleThenDownscale) { - assert(mipMapLevel > 0 && renderMappedMipMapLevel != mipMapLevel); - downscaledRectToRender = renderMappedRectToRender.toNewMipMapLevel(renderMappedMipMapLevel, mipMapLevel, par, rod); + assert(mipmapLevel > 0 && renderMappedMipmapLevel != mipmapLevel); + downscaledRectToRender = renderMappedRectToRender.toNewMipmapLevel(renderMappedMipmapLevel, mipmapLevel, par, rod); } // at this point, it may be unnecessary to call render because it was done a long time ago => check the bitmap here! @@ -2276,10 +2274,10 @@ EffectInstance::Implementation::tiledRenderingFunctor(const RectToRender & rectT } #ifndef NDEBUG - RenderScale scale = RenderScale::fromMipmapLevel(mipMapLevel); + RenderScale scale = RenderScale::fromMipmapLevel(mipmapLevel); // check the dimensions of all input and output images const RectD & dstRodCanonical = firstPlaneToRender.renderMappedImage->getRoD(); - const RectI dstBounds = dstRodCanonical.toPixelEnclosing(firstPlaneToRender.renderMappedImage->getMipMapLevel(), par); // compute dstRod at level 0 + const RectI dstBounds = dstRodCanonical.toPixelEnclosing(firstPlaneToRender.renderMappedImage->getMipmapLevel(), par); // compute dstRod at level 0 if (!frameArgs->tilesSupported) { const RectI dstRealBounds = firstPlaneToRender.renderMappedImage->getBounds(); assert(dstRealBounds.x1 == dstBounds.x1); @@ -2293,7 +2291,7 @@ EffectInstance::Implementation::tiledRenderingFunctor(const RectToRender & rectT ++it) { for (ImageList::const_iterator it2 = it->second.begin(); it2 != it->second.end(); ++it2) { const RectD & srcRodCanonical = (*it2)->getRoD(); - const RectI srcBounds = srcRodCanonical.toPixelEnclosing( (*it2)->getMipMapLevel(), (*it2)->getPixelAspectRatio() ); // compute srcRod at level 0 + const RectI srcBounds = srcRodCanonical.toPixelEnclosing( (*it2)->getMipmapLevel(), (*it2)->getPixelAspectRatio() ); // compute srcRod at level 0 if (!frameArgs->tilesSupported) { // http://openfx.sourceforge.net/Documentation/1.3/ofxProgrammingReference.html#kOfxImageEffectPropSupportsTiles @@ -2306,7 +2304,7 @@ EffectInstance::Implementation::tiledRenderingFunctor(const RectToRender & rectT * Blur will actually retrieve the image from the cache and downscale it rather than recompute it. * Since the Writer does not support tiles, the Blur image is the full image and not a tile, which can be veryfied by * - * bounds = blurCachedImage->getRod().toPixelEnclosing(blurCachedImage->getMipMapLevel(), blurCachedImage->getPixelAspectRatio()) + * bounds = blurCachedImage->getRod().toPixelEnclosing(blurCachedImage->getMipmapLevel(), blurCachedImage->getPixelAspectRatio()) * * Since the Blur RoD changed (the RoD at mmlevel 0 is different than the ROD at mmlevel 1), * the resulting bounds of the downscaled image are not necessarily exactly result of the new downscaled RoD to the enclosing pixel @@ -2337,13 +2335,13 @@ EffectInstance::Implementation::tiledRenderingFunctor(const RectToRender & rectT } //end for if (_publicInterface->supportsRenderScaleMaybe() == eSupportsNo) { - assert(firstPlaneToRender.renderMappedImage->getMipMapLevel() == 0); - assert(renderMappedMipMapLevel == 0); + assert(firstPlaneToRender.renderMappedImage->getMipmapLevel() == 0); + assert(renderMappedMipmapLevel == 0); } #endif // !NDEBUG RenderingFunctorRetEnum handlerRet = renderHandler(tls, - mipMapLevel, + mipmapLevel, renderFullScaleThenDownscale, isSequentialRender, isRenderResponseToUserInteraction, @@ -2366,7 +2364,7 @@ EffectInstance::Implementation::tiledRenderingFunctor(const RectToRender & rectT EffectInstance::RenderingFunctorRetEnum EffectInstance::Implementation::renderHandler(const EffectTLSDataPtr& tls, - const unsigned int mipMapLevel, + const unsigned int mipmapLevel, const bool renderFullScaleThenDownscale, const bool isSequentialRender, const bool isRenderResponseToUserInteraction, @@ -2402,9 +2400,9 @@ EffectInstance::Implementation::renderHandler(const EffectTLSDataPtr& tls, RenderActionArgs actionArgs; actionArgs.byPassCache = byPassCache; actionArgs.processChannels = processChannels; - actionArgs.mappedScale = RenderScale::fromMipmapLevel(firstPlane.renderMappedImage->getMipMapLevel()); + actionArgs.mappedScale = RenderScale::fromMipmapLevel(firstPlane.renderMappedImage->getMipmapLevel()); assert(isSupportedRenderScale(_publicInterface->supportsRenderScaleMaybe(), actionArgs.mappedScale)); - actionArgs.originalScale = RenderScale::fromMipmapLevel(mipMapLevel); + actionArgs.originalScale = RenderScale::fromMipmapLevel(mipmapLevel); actionArgs.draftMode = frameArgs->draftMode; actionArgs.useOpenGL = planes.useOpenGL; @@ -2458,7 +2456,7 @@ EffectInstance::Implementation::renderHandler(const EffectTLSDataPtr& tls, // scoped_ptr std::unique_ptr renderArgs( new EffectInstance::RenderRoIArgs(tls->currentRenderArgs.identityTime, actionArgs.originalScale, - mipMapLevel, + mipmapLevel, view, false, downscaledRectToRender, @@ -2501,7 +2499,7 @@ EffectInstance::Implementation::renderHandler(const EffectTLSDataPtr& tls, std::map::iterator idIt = identityPlanes.begin(); for (std::map::iterator it = planes.planes.begin(); it != planes.planes.end(); ++it, ++idIt) { - if ( renderFullScaleThenDownscale && ( idIt->second->getMipMapLevel() > it->second.fullscaleImage->getMipMapLevel() ) ) { + if ( renderFullScaleThenDownscale && ( idIt->second->getMipmapLevel() > it->second.fullscaleImage->getMipmapLevel() ) ) { // We cannot be rendering using OpenGL in this case assert(!planes.useOpenGL); @@ -2517,7 +2515,7 @@ EffectInstance::Implementation::renderHandler(const EffectTLSDataPtr& tls, sourceImage = std::make_shared(it->second.fullscaleImage->getComponents(), idIt->second->getRoD(), idIt->second->getBounds(), - idIt->second->getMipMapLevel(), + idIt->second->getMipmapLevel(), idIt->second->getPixelAspectRatio(), it->second.fullscaleImage->getBitDepth(), idIt->second->getPremultiplication(), @@ -2533,17 +2531,17 @@ EffectInstance::Implementation::renderHandler(const EffectTLSDataPtr& tls, ///then upscale const RectD & rod = sourceImage->getRoD(); - const RectI bounds = rod.toPixelEnclosing(it->second.renderMappedImage->getMipMapLevel(), it->second.renderMappedImage->getPixelAspectRatio()); + const RectI bounds = rod.toPixelEnclosing(it->second.renderMappedImage->getMipmapLevel(), it->second.renderMappedImage->getPixelAspectRatio()); ImagePtr inputPlane = std::make_shared(it->first, rod, bounds, - it->second.renderMappedImage->getMipMapLevel(), + it->second.renderMappedImage->getMipmapLevel(), it->second.renderMappedImage->getPixelAspectRatio(), it->second.renderMappedImage->getBitDepth(), it->second.renderMappedImage->getPremultiplication(), it->second.renderMappedImage->getFieldingOrder(), false); - sourceImage->upscaleMipMap( sourceImage->getBounds(), sourceImage->getMipMapLevel(), inputPlane->getMipMapLevel(), inputPlane.get() ); + sourceImage->upscaleMipmap( sourceImage->getBounds(), sourceImage->getMipmapLevel(), inputPlane->getMipmapLevel(), inputPlane.get() ); it->second.fullscaleImage->pasteFrom(*inputPlane, renderMappedRectToRender, false); } else { if ( !idIt->second->getBounds().contains(downscaledRectToRender) ) { @@ -2592,7 +2590,7 @@ EffectInstance::Implementation::renderHandler(const EffectTLSDataPtr& tls, it->second.tmpImage = std::make_shared(prefComp, it->second.renderMappedImage->getRoD(), actionArgs.roi, - it->second.renderMappedImage->getMipMapLevel(), + it->second.renderMappedImage->getMipmapLevel(), it->second.renderMappedImage->getPixelAspectRatio(), outputClipPrefDepth, it->second.renderMappedImage->getPremultiplication(), @@ -2776,19 +2774,19 @@ EffectInstance::Implementation::renderHandler(const EffectTLSDataPtr& tls, assert(!planes.useOpenGL); ///copy the rectangle rendered in the full scale image to the downscaled output - assert(mipMapLevel != 0); + assert(mipmapLevel != 0); assert(it->second.fullscaleImage != it->second.downscaleImage && it->second.renderMappedImage == it->second.fullscaleImage); ImagePtr mappedOriginalInputImage = originalInputImage; - if ( originalInputImage && (originalInputImage->getMipMapLevel() != 0) ) { + if ( originalInputImage && (originalInputImage->getMipmapLevel() != 0) ) { bool mustCopyUnprocessedChannels = it->second.tmpImage->canCallCopyUnProcessedChannels(processChannels); if (mustCopyUnprocessedChannels || useMaskMix) { ///there is some processing to be done by copyUnProcessedChannels or applyMaskMix - ///but originalInputImage is not in the correct mipMapLevel, upscale it - assert(originalInputImage->getMipMapLevel() > it->second.tmpImage->getMipMapLevel() && - originalInputImage->getMipMapLevel() == mipMapLevel); + ///but originalInputImage is not in the correct mipmapLevel, upscale it + assert(originalInputImage->getMipmapLevel() > it->second.tmpImage->getMipmapLevel() && + originalInputImage->getMipmapLevel() == mipmapLevel); ImagePtr tmp = std::make_shared(it->second.tmpImage->getComponents(), it->second.tmpImage->getRoD(), renderMappedRectToRender, @@ -2798,7 +2796,7 @@ EffectInstance::Implementation::renderHandler(const EffectTLSDataPtr& tls, it->second.tmpImage->getPremultiplication(), it->second.tmpImage->getFieldingOrder(), false); - originalInputImage->upscaleMipMap( downscaledRectToRender, originalInputImage->getMipMapLevel(), 0, tmp.get() ); + originalInputImage->upscaleMipmap( downscaledRectToRender, originalInputImage->getMipmapLevel(), 0, tmp.get() ); mappedOriginalInputImage = tmp; } } @@ -2818,7 +2816,7 @@ EffectInstance::Implementation::renderHandler(const EffectTLSDataPtr& tls, ImagePtr tmp( new Image(it->second.fullscaleImage->getComponents(), it->second.tmpImage->getRoD(), renderMappedRectToRender, - mipMapLevel, + mipmapLevel, it->second.tmpImage->getPixelAspectRatio(), it->second.fullscaleImage->getBitDepth(), it->second.fullscaleImage->getPremultiplication(), @@ -2828,7 +2826,7 @@ EffectInstance::Implementation::renderHandler(const EffectTLSDataPtr& tls, ImagePtr tmp = std::make_shared(it->second.fullscaleImage->getComponents(), it->second.tmpImage->getRoD(), renderMappedRectToRender, - mipMapLevel, + mipmapLevel, it->second.tmpImage->getPixelAspectRatio(), it->second.fullscaleImage->getBitDepth(), it->second.fullscaleImage->getPremultiplication(), @@ -2840,15 +2838,15 @@ EffectInstance::Implementation::renderHandler(const EffectTLSDataPtr& tls, _publicInterface->getApp()->getDefaultColorSpaceForBitDepth( it->second.tmpImage->getBitDepth() ), _publicInterface->getApp()->getDefaultColorSpaceForBitDepth( it->second.fullscaleImage->getBitDepth() ), -1, false, unPremultRequired, tmp.get() ); - tmp->downscaleMipMap( it->second.tmpImage->getRoD(), - renderMappedRectToRender, 0, mipMapLevel, false, it->second.downscaleImage.get() ); + tmp->downscaleMipmap( it->second.tmpImage->getRoD(), + renderMappedRectToRender, 0, mipmapLevel, false, it->second.downscaleImage.get() ); it->second.fullscaleImage->pasteFrom(*tmp, renderMappedRectToRender, false); } else { /* * Downscaling required only */ - it->second.tmpImage->downscaleMipMap( it->second.tmpImage->getRoD(), - actionArgs.roi, 0, mipMapLevel, false, it->second.downscaleImage.get() ); + it->second.tmpImage->downscaleMipmap( it->second.tmpImage->getRoD(), + actionArgs.roi, 0, mipmapLevel, false, it->second.downscaleImage.get() ); if (it->second.tmpImage != it->second.fullscaleImage) { it->second.fullscaleImage->pasteFrom(*(it->second.tmpImage), renderMappedRectToRender, false); } @@ -2938,7 +2936,7 @@ EffectInstance::allocateImagePlaneAndSetInThreadLocalStorage(const ImagePlaneDes img->getPremultiplication(), img->getFieldingOrder(), img->getPixelAspectRatio(), - img->getMipMapLevel(), + img->getMipmapLevel(), false, img->getParams()->getStorageInfo().mode, useCache, @@ -2958,7 +2956,7 @@ EffectInstance::allocateImagePlaneAndSetInThreadLocalStorage(const ImagePlaneDes p.tmpImage.reset( new Image(p.renderMappedImage->getComponents(), p.renderMappedImage->getRoD(), tls->currentRenderArgs.renderWindowPixel, - p.renderMappedImage->getMipMapLevel(), + p.renderMappedImage->getMipmapLevel(), p.renderMappedImage->getPixelAspectRatio(), p.renderMappedImage->getBitDepth(), p.renderMappedImage->getPremultiplication(), @@ -2969,7 +2967,7 @@ EffectInstance::allocateImagePlaneAndSetInThreadLocalStorage(const ImagePlaneDes p.tmpImage = std::make_shared(p.renderMappedImage->getComponents(), p.renderMappedImage->getRoD(), tls->currentRenderArgs.renderWindowPixel, - p.renderMappedImage->getMipMapLevel(), + p.renderMappedImage->getMipmapLevel(), p.renderMappedImage->getPixelAspectRatio(), p.renderMappedImage->getBitDepth(), p.renderMappedImage->getPremultiplication(), @@ -3815,8 +3813,8 @@ EffectInstance::getRegionOfDefinitionFromCache(U64 hash, RectD* rod, bool* isProjectFormat) { - unsigned int mipMapLevel = scale.toMipmapLevel(); - bool foundInCache = _imp->actionsCache->getRoDResult(hash, time, view, mipMapLevel, rod); + unsigned int mipmapLevel = scale.toMipmapLevel(); + bool foundInCache = _imp->actionsCache->getRoDResult(hash, time, view, mipmapLevel, rod); if (foundInCache) { if (isProjectFormat) { @@ -3844,8 +3842,8 @@ EffectInstance::getRegionOfDefinition_public(U64 hash, return eStatusFailed; } - unsigned int mipMapLevel = scale.toMipmapLevel(); - bool foundInCache = _imp->actionsCache->getRoDResult(hash, time, view, mipMapLevel, rod); + unsigned int mipmapLevel = scale.toMipmapLevel(); + bool foundInCache = _imp->actionsCache->getRoDResult(hash, time, view, mipmapLevel, rod); if (foundInCache) { if (isProjectFormat) { *isProjectFormat = false; @@ -3891,7 +3889,7 @@ EffectInstance::getRegionOfDefinition_public(U64 hash, // rod is not valid //if (!isDuringStrokeCreation) { _imp->actionsCache->invalidateAll(hash); - _imp->actionsCache->setRoDResult( hash, time, view, mipMapLevel, RectD() ); + _imp->actionsCache->setRoDResult( hash, time, view, mipmapLevel, RectD() ); // } return ret; @@ -3899,7 +3897,7 @@ EffectInstance::getRegionOfDefinition_public(U64 hash, if ( rod->isNull() ) { // RoD is empty, which means output is black and transparent - _imp->actionsCache->setRoDResult( hash, time, view, mipMapLevel, RectD() ); + _imp->actionsCache->setRoDResult( hash, time, view, mipmapLevel, RectD() ); return ret; } @@ -3913,7 +3911,7 @@ EffectInstance::getRegionOfDefinition_public(U64 hash, assert(rod->x1 <= rod->x2 && rod->y1 <= rod->y2); //if (!isDuringStrokeCreation) { - _imp->actionsCache->setRoDResult(hash, time, view, mipMapLevel, *rod); + _imp->actionsCache->setRoDResult(hash, time, view, mipmapLevel, *rod); //} return ret; @@ -3939,11 +3937,11 @@ FramesNeededMap EffectInstance::getFramesNeeded_public(U64 hash, double time, ViewIdx view, - unsigned int mipMapLevel) + unsigned int mipmapLevel) { NON_RECURSIVE_ACTION(); FramesNeededMap framesNeeded; - bool foundInCache = _imp->actionsCache->getFramesNeededResult(hash, time, view, mipMapLevel, &framesNeeded); + bool foundInCache = _imp->actionsCache->getFramesNeededResult(hash, time, view, mipmapLevel, &framesNeeded); if (foundInCache) { return framesNeeded; } @@ -3956,7 +3954,7 @@ EffectInstance::getFramesNeeded_public(U64 hash, } } - _imp->actionsCache->setFramesNeededResult(hash, time, view, mipMapLevel, framesNeeded); + _imp->actionsCache->setFramesNeededResult(hash, time, view, mipmapLevel, framesNeeded); return framesNeeded; } @@ -4645,8 +4643,7 @@ EffectInstance::getOverlayInteractRenderScale() const RenderScale renderScale; if (isDoingInteractAction() && _imp->overlaysViewport) { - unsigned int mmLevel = _imp->overlaysViewport->getCurrentRenderScale(); - renderScale = RenderScale::fromMipmapLevel(mmLevel); + renderScale = RenderScale::fromMipmapLevel(_imp->overlaysViewport->getCurrentMipmapLevel()); } return renderScale; diff --git a/Engine/EffectInstance.h b/Engine/EffectInstance.h index 1c0d915c6..613b5c982 100644 --- a/Engine/EffectInstance.h +++ b/Engine/EffectInstance.h @@ -134,7 +134,7 @@ GCC_DIAG_SUGGEST_OVERRIDE_ON double time; //< the time at which to render RenderScale scale; //< the scale at which to render - unsigned int mipMapLevel; //< the mipmap level (redundant with the scale, stored here to avoid refetching it everytimes) + unsigned int mipmapLevel; //< the mipmap level (redundant with the scale, stored here to avoid refetching it everytimes) ViewIdx view; //< the view to render RectI roi; //< the renderWindow (in pixel coordinates) , watch out OpenFX action getRegionsOfInterest expects canonical coords! RectD preComputedRoD; //< pre-computed region of definition in canonical coordinates for this effect to speed-up the call to renderRoi @@ -160,7 +160,7 @@ GCC_DIAG_SUGGEST_OVERRIDE_ON RenderRoIArgs() : time(0) , scale() - , mipMapLevel(0) + , mipmapLevel(0) , view(0) , roi() , preComputedRoD() @@ -178,7 +178,7 @@ GCC_DIAG_SUGGEST_OVERRIDE_ON RenderRoIArgs( double time_, const RenderScale & scale_, - unsigned int mipMapLevel_, + unsigned int mipmapLevel_, ViewIdx view_, bool byPassCache_, const RectI & roi_, @@ -192,7 +192,7 @@ GCC_DIAG_SUGGEST_OVERRIDE_ON const EffectInstance::InputImagesMap & inputImages = EffectInstance::InputImagesMap() ) : time(time_) , scale(scale_) - , mipMapLevel(mipMapLevel_) + , mipmapLevel(mipmapLevel_) , view(view_) , roi(roi_) , preComputedRoD(preComputedRoD_) @@ -580,7 +580,7 @@ GCC_DIAG_SUGGEST_OVERRIDE_ON StorageModeEnum storage, StorageModeEnum returnStorage, const ImageKey & key, - unsigned int mipMapLevel, + unsigned int mipmapLevel, const RectI* boundsParam, const RectD* rodParam, const RectI& roi, @@ -687,7 +687,7 @@ GCC_DIAG_SUGGEST_OVERRIDE_ON static StatusEnum getInputsRoIsFunctor(bool useTransforms, double time, ViewIdx view, - unsigned originalMipMapLevel, + unsigned originalMipmapLevel, const NodePtr & node, const NodePtr& callerNode, const NodePtr & treeRoot, @@ -701,7 +701,7 @@ GCC_DIAG_SUGGEST_OVERRIDE_ON **/ static StatusEnum computeRequestPass(double time, ViewIdx view, - unsigned int mipMapLevel, + unsigned int mipmapLevel, const RectD & renderWindow, const NodePtr & treeRoot, FrameRequestMap & request); @@ -714,7 +714,7 @@ GCC_DIAG_SUGGEST_OVERRIDE_ON const InputMatrixMapPtr & reroutesMap, bool useTransforms, // roi functor specific StorageModeEnum renderStorageMode, // The storage of the image returned by the current Render - unsigned int originalMipMapLevel, // roi functor specific + unsigned int originalMipmapLevel, // roi functor specific double time, ViewIdx view, const NodePtr & treeRoot, @@ -1162,7 +1162,7 @@ GCC_DIAG_SUGGEST_OVERRIDE_ON ViewIdx view, RoIMap* ret); - FramesNeededMap getFramesNeeded_public(U64 hash, double time, ViewIdx view, unsigned int mipMapLevel) WARN_UNUSED_RETURN; + FramesNeededMap getFramesNeeded_public(U64 hash, double time, ViewIdx view, unsigned int mipmapLevel) WARN_UNUSED_RETURN; void getFrameRange_public(U64 hash, double *first, double *last, bool bypasscache = false); @@ -2123,7 +2123,7 @@ GCC_DIAG_SUGGEST_OVERRIDE_ON * @brief The internal of renderRoI, mainly it calls render and handles the thread safety of the effect. * @param time The time at which to render * @param scale The scale at which to render - * @param mipMapLevel Redundant with scale + * @param mipmapLevel Redundant with scale * @param view The view on which to render * @param renderWindow The rectangle to render of the image, in pixel coordinates * @param cachedImgParams The parameters of the image to render as they are in the cache. @@ -2148,7 +2148,7 @@ GCC_DIAG_SUGGEST_OVERRIDE_ON double time, const ParallelRenderArgsPtr & frameArgs, RenderSafetyEnum safety, - unsigned int mipMapLevel, + unsigned int mipmapLevel, ViewIdx view, const RectD & rod, //!< rod in canonical coordinates const double par, @@ -2173,7 +2173,7 @@ GCC_DIAG_SUGGEST_OVERRIDE_ON const RectD & rod, const RectD & canonicalRenderWindow, const InputMatrixMapPtr & transformMatrix, - unsigned int mipMapLevel, + unsigned int mipmapLevel, const RenderScale & renderMappedScale, bool useScaleOneInputImages, bool byPassCache, diff --git a/Engine/EffectInstancePrivate.cpp b/Engine/EffectInstancePrivate.cpp index 11c6fda27..06c5bdf2e 100644 --- a/Engine/EffectInstancePrivate.cpp +++ b/Engine/EffectInstancePrivate.cpp @@ -116,7 +116,7 @@ ActionsCache::getIdentityResult(U64 hash, ActionKey key; key.time = time; key.view = view; - key.mipMapLevel = 0; + key.mipmapLevel = 0; IdentityCacheMap::const_iterator found = it->_identityCache.find(key); if ( found != it->_identityCache.end() ) { @@ -148,7 +148,7 @@ ActionsCache::setIdentityResult(U64 hash, key.time = time; key.view = view; - key.mipMapLevel = 0; + key.mipmapLevel = 0; IdentityResults & v = cache._identityCache[key]; v.inputIdentityNb = inputNbIdentity; @@ -167,7 +167,7 @@ ActionsCache::getComponentsNeededResults(U64 hash, double time, ViewIdx view, Ef ActionKey key; key.time = time; key.view = view; - key.mipMapLevel = 0; + key.mipmapLevel = 0; ComponentsNeededCacheMap::const_iterator found = it->_componentsNeededCache.find(key); if ( found != it->_componentsNeededCache.end() ) { @@ -200,7 +200,7 @@ ActionsCache::setComponentsNeededResults(U64 hash, double time, ViewIdx view, co key.time = time; key.view = view; - key.mipMapLevel = 0; + key.mipmapLevel = 0; ComponentsNeededResults & v = cache._componentsNeededCache[key]; v.neededComps = neededComps; @@ -217,7 +217,7 @@ bool ActionsCache::getRoDResult(U64 hash, double time, ViewIdx view, - unsigned int mipMapLevel, + unsigned int mipmapLevel, RectD* rod) { QMutexLocker l(&_cacheMutex); @@ -227,7 +227,7 @@ ActionsCache::getRoDResult(U64 hash, ActionKey key; key.time = time; key.view = view; - key.mipMapLevel = mipMapLevel; + key.mipmapLevel = mipmapLevel; RoDCacheMap::const_iterator found = it->_rodCache.find(key); if ( found != it->_rodCache.end() ) { @@ -247,7 +247,7 @@ void ActionsCache::setRoDResult(U64 hash, double time, ViewIdx view, - unsigned int mipMapLevel, + unsigned int mipmapLevel, const RectD & rod) { QMutexLocker l(&_cacheMutex); @@ -256,7 +256,7 @@ ActionsCache::setRoDResult(U64 hash, key.time = time; key.view = view; - key.mipMapLevel = mipMapLevel; + key.mipmapLevel = mipmapLevel; cache._rodCache[key] = rod; } @@ -265,7 +265,7 @@ bool ActionsCache::getFramesNeededResult(U64 hash, double time, ViewIdx view, - unsigned int mipMapLevel, + unsigned int mipmapLevel, FramesNeededMap* framesNeeded) { QMutexLocker l(&_cacheMutex); @@ -275,7 +275,7 @@ ActionsCache::getFramesNeededResult(U64 hash, ActionKey key; key.time = time; key.view = view; - key.mipMapLevel = mipMapLevel; + key.mipmapLevel = mipmapLevel; FramesNeededCacheMap::const_iterator found = it->_framesNeededCache.find(key); if ( found != it->_framesNeededCache.end() ) { @@ -295,7 +295,7 @@ void ActionsCache::setFramesNeededResult(U64 hash, double time, ViewIdx view, - unsigned int mipMapLevel, + unsigned int mipmapLevel, const FramesNeededMap & framesNeeded) { QMutexLocker l(&_cacheMutex); @@ -304,7 +304,7 @@ ActionsCache::setFramesNeededResult(U64 hash, key.time = time; key.view = view; - key.mipMapLevel = mipMapLevel; + key.mipmapLevel = mipmapLevel; cache._framesNeededCache[key] = framesNeeded; } diff --git a/Engine/EffectInstancePrivate.h b/Engine/EffectInstancePrivate.h index 6dc3b3a65..5f767ff6a 100644 --- a/Engine/EffectInstancePrivate.h +++ b/Engine/EffectInstancePrivate.h @@ -56,7 +56,7 @@ struct ActionKey { double time; ViewIdx view; - unsigned int mipMapLevel; + unsigned int mipmapLevel; }; struct IdentityResults @@ -85,9 +85,9 @@ struct CompareActionsCacheKeys if (lhs.time < rhs.time) { return true; } else if (lhs.time == rhs.time) { - if (lhs.mipMapLevel < rhs.mipMapLevel) { + if (lhs.mipmapLevel < rhs.mipmapLevel) { return true; - } else if (lhs.mipMapLevel == rhs.mipMapLevel) { + } else if (lhs.mipmapLevel == rhs.mipmapLevel) { if (lhs.view < rhs.view) { return true; } else { @@ -135,13 +135,13 @@ class ActionsCache void setComponentsNeededResults(U64 hash, double time, ViewIdx view, const EffectInstance::ComponentsNeededMap& neededComps, std::bitset<4> processChannels, bool processAll, const std::list& passThroughPlanes,int passThroughInputNb, ViewIdx passThroughView, double passThroughTime); - bool getRoDResult(U64 hash, double time, ViewIdx view, unsigned int mipMapLevel, RectD* rod); + bool getRoDResult(U64 hash, double time, ViewIdx view, unsigned int mipmapLevel, RectD* rod); - void setRoDResult(U64 hash, double time, ViewIdx view, unsigned int mipMapLevel, const RectD & rod); + void setRoDResult(U64 hash, double time, ViewIdx view, unsigned int mipmapLevel, const RectD & rod); - bool getFramesNeededResult(U64 hash, double time, ViewIdx view, unsigned int mipMapLevel, FramesNeededMap* framesNeeded); + bool getFramesNeededResult(U64 hash, double time, ViewIdx view, unsigned int mipmapLevel, FramesNeededMap* framesNeeded); - void setFramesNeededResult(U64 hash, double time, ViewIdx view, unsigned int mipMapLevel, const FramesNeededMap & framesNeeded); + void setFramesNeededResult(U64 hash, double time, ViewIdx view, unsigned int mipmapLevel, const FramesNeededMap & framesNeeded); bool getTimeDomainResult(U64 hash, double *first, double* last); @@ -280,11 +280,11 @@ class EffectInstance::Implementation - OfxClipInstance::getImage * * We don't provide these datas for the getRegionOfDefinition with these render args because this action can be called way - * prior we have all the other parameters. getRegionOfDefinition only needs the current render view and mipMapLevel if it is + * prior we have all the other parameters. getRegionOfDefinition only needs the current render view and mipmapLevel if it is * called on a render thread or during an analysis. We provide it by setting those 2 parameters directly on a thread-storage * object local to the clip. * - * For getImage, all the ScopedRenderArgs are active (except for analysis). The view and mipMapLevel parameters will be retrieved + * For getImage, all the ScopedRenderArgs are active (except for analysis). The view and mipmapLevel parameters will be retrieved * on the clip that needs the image. All the other parameters will be retrieved in EffectInstance::getImage on the ScopedRenderArgs. * * During an analysis effect we don't set any ScopedRenderArgs and call some actions recursively if needed. @@ -330,8 +330,8 @@ class EffectInstance::Implementation int firstFrame; int lastFrame; int preferredInput; - unsigned int mipMapLevel; - unsigned int renderMappedMipMapLevel; + unsigned int mipmapLevel; + unsigned int renderMappedMipmapLevel; RectD rod; double time; ViewIdx view; @@ -353,8 +353,8 @@ class EffectInstance::Implementation const bool isRenderResponseToUserInteraction, const int firstFrame, const int lastFrame, const int preferredInput, - const unsigned int mipMapLevel, - const unsigned int renderMappedMipMapLevel, + const unsigned int mipmapLevel, + const unsigned int renderMappedMipmapLevel, const RectD & rod, const double time, const ViewIdx view, @@ -389,7 +389,7 @@ class EffectInstance::Implementation /// * renderMappedImage points to fullScaleMappedImage /// * We render in fullScaledMappedImage, then convert into "image" and then downscale into downscaledImage. RenderingFunctorRetEnum renderHandler(const EffectTLSDataPtr& tls, - const unsigned int mipMapLevel, + const unsigned int mipmapLevel, const bool renderFullScaleThenDownscale, const bool isSequentialRender, const bool isRenderResponseToUserInteraction, diff --git a/Engine/EffectInstanceRenderRoI.cpp b/Engine/EffectInstanceRenderRoI.cpp index d6c05e7ec..a9a614135 100644 --- a/Engine/EffectInstanceRenderRoI.cpp +++ b/Engine/EffectInstanceRenderRoI.cpp @@ -183,7 +183,7 @@ EffectInstance::convertPlanesFormatsIfNeeded(const AppInstancePtr& app, ImagePtr tmp( new Image(targetComponents, inputImage->getRoD(), bounds, - inputImage->getMipMapLevel(), + inputImage->getMipmapLevel(), inputImage->getPixelAspectRatio(), targetDepth, inputImage->getPremultiplication(), @@ -193,7 +193,7 @@ EffectInstance::convertPlanesFormatsIfNeeded(const AppInstancePtr& app, ImagePtr tmp = std::make_shared(targetComponents, inputImage->getRoD(), bounds, - inputImage->getMipMapLevel(), + inputImage->getMipmapLevel(), inputImage->getPixelAspectRatio(), targetDepth, inputImage->getPremultiplication(), @@ -374,19 +374,19 @@ EffectInstance::renderRoI(const RenderRoIArgs & args, const double par = getAspectRatio(-1); const ImageFieldingOrderEnum fieldingOrder = getFieldingOrder(); const ImagePremultiplicationEnum thisEffectOutputPremult = getPremult(); - const unsigned int mipMapLevel = args.mipMapLevel; + const unsigned int mipmapLevel = args.mipmapLevel; SupportsEnum supportsRS = supportsRenderScaleMaybe(); - ///This flag is relevant only when the mipMapLevel is different than 0. We use it to determine + ///This flag is relevant only when the mipmapLevel is different than 0. We use it to determine ///whether the plug-in should render in the full scale image, and then we downscale afterwards or ///if the plug-in can just use the downscaled image to render. - bool renderFullScaleThenDownscale = (supportsRS == eSupportsNo && mipMapLevel != 0); - unsigned int renderMappedMipMapLevel; + bool renderFullScaleThenDownscale = (supportsRS == eSupportsNo && mipmapLevel != 0); + unsigned int renderMappedMipmapLevel; if (renderFullScaleThenDownscale) { - renderMappedMipMapLevel = 0; + renderMappedMipmapLevel = 0; } else { - renderMappedMipMapLevel = args.mipMapLevel; + renderMappedMipmapLevel = args.mipmapLevel; } - RenderScale renderMappedScale( RenderScale::fromMipmapLevel(renderMappedMipMapLevel) ); + RenderScale renderMappedScale( RenderScale::fromMipmapLevel(renderMappedMipmapLevel) ); assert(isSupportedRenderScale(supportsRS, renderMappedScale)); @@ -421,13 +421,13 @@ EffectInstance::renderRoI(const RenderRoIArgs & args, //Nothing to render return eRenderRoIRetCodeOk; } - if ( (supportsRS == eSupportsMaybe) && (renderMappedMipMapLevel != 0) ) { + if ( (supportsRS == eSupportsMaybe) && (renderMappedMipmapLevel != 0) ) { // supportsRenderScaleMaybe may have changed, update it supportsRS = supportsRenderScaleMaybe(); - renderFullScaleThenDownscale = (supportsRS == eSupportsNo && mipMapLevel != 0); + renderFullScaleThenDownscale = (supportsRS == eSupportsNo && mipmapLevel != 0); if (renderFullScaleThenDownscale) { renderMappedScale = RenderScale::identity; - renderMappedMipMapLevel = 0; + renderMappedMipmapLevel = 0; } } } @@ -547,7 +547,7 @@ EffectInstance::renderRoI(const RenderRoIArgs & args, ViewIdx inputIdentityView(args.view); assert(isSupportedRenderScale(supportsRS, renderMappedScale)); bool identity; - const RectI pixelRod = rod.toPixelEnclosing(args.mipMapLevel, par); + const RectI pixelRod = rod.toPixelEnclosing(args.mipmapLevel, par); ViewInvarianceLevel viewInvariance = isViewInvariant(); if ( (args.view != 0) && (viewInvariance == eViewInvarianceAllViewsInvariant) ) { @@ -569,11 +569,11 @@ EffectInstance::renderRoI(const RenderRoIArgs & args, } } - if ( (supportsRS == eSupportsMaybe) && (mipMapLevel != 0) ) { + if ( (supportsRS == eSupportsMaybe) && (mipmapLevel != 0) ) { // supportsRenderScaleMaybe may have changed, update it renderFullScaleThenDownscale = true; renderMappedScale = RenderScale::identity; - renderMappedMipMapLevel = 0; + renderMappedMipmapLevel = 0; } if (identity) { @@ -728,14 +728,14 @@ EffectInstance::renderRoI(const RenderRoIArgs & args, //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// ////////////////////////////// Compute RoI depending on render scale /////////////////////////////////////////////////// - RectI downscaledImageBoundsNc = rod.toPixelEnclosing(args.mipMapLevel, par); + RectI downscaledImageBoundsNc = rod.toPixelEnclosing(args.mipmapLevel, par); RectI upscaledImageBoundsNc = rod.toPixelEnclosing(0, par); RectI roi; if (renderFullScaleThenDownscale) { //We cache 'image', hence the RoI should be expressed in its coordinates //renderRoIInternal should check the bitmap of 'image' and not downscaledImage! - roi = args.roi.toNewMipMapLevel(args.mipMapLevel, 0, par, rod); + roi = args.roi.toNewMipmapLevel(args.mipmapLevel, 0, par, rod); if (frameArgs->tilesSupported && !roi.clipIfOverlaps(upscaledImageBoundsNc)) { return eRenderRoIRetCodeOk; @@ -754,14 +754,14 @@ EffectInstance::renderRoI(const RenderRoIArgs & args, * Keep in memory what the user has requested, and change the roi to the full bounds if the effect doesn't support tiles */ const RectI originalRoI = roi; - // Store the mipMapLevel for originalRoI here because renderFullScaleThenDownscale may change later and we'll lose + // Store the mipmapLevel for originalRoI here because renderFullScaleThenDownscale may change later and we'll lose // the ability to recover this information when we potentially need it for a downscale operation later. - const unsigned int originalRoIMipMapLevel = renderFullScaleThenDownscale ? 0 : args.mipMapLevel; + const unsigned int originalRoIMipmapLevel = renderFullScaleThenDownscale ? 0 : args.mipmapLevel; if (frameArgs->tilesSupported) { #ifndef NATRON_ALWAYS_ALLOCATE_FULL_IMAGE_BOUNDS ///just allocate the roi - const RectI upscaledRoI = renderFullScaleThenDownscale ? roi : roi.toNewMipMapLevel(args.mipMapLevel, 0, par, rod); + const RectI upscaledRoI = renderFullScaleThenDownscale ? roi : roi.toNewMipmapLevel(args.mipmapLevel, 0, par, rod); upscaledImageBoundsNc.clipIfOverlaps(upscaledRoI); downscaledImageBoundsNc.clipIfOverlaps(args.roi); #endif @@ -771,7 +771,7 @@ EffectInstance::renderRoI(const RenderRoIArgs & args, const RectI & downscaledImageBounds = downscaledImageBoundsNc; const RectI & upscaledImageBounds = upscaledImageBoundsNc; - const RectD canonicalRoI = roi.toCanonical(renderFullScaleThenDownscale ? 0 : args.mipMapLevel, par, rod); + const RectD canonicalRoI = roi.toCanonical(renderFullScaleThenDownscale ? 0 : args.mipmapLevel, par, rod); //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// ////////////////////////////// End Compute RoI ///////////////////////////////////////////////////////////////////////// @@ -837,8 +837,8 @@ EffectInstance::renderRoI(const RenderRoIArgs & args, // OpenGL renders always support render scale... if (renderFullScaleThenDownscale) { renderFullScaleThenDownscale = false; - renderMappedMipMapLevel = args.mipMapLevel; - renderMappedScale = RenderScale::fromMipmapLevel(renderMappedMipMapLevel); + renderMappedMipmapLevel = args.mipmapLevel; + renderMappedScale = RenderScale::fromMipmapLevel(renderMappedMipmapLevel); if (frameArgs->tilesSupported) { roi = args.roi; if ( !roi.clipIfOverlaps(downscaledImageBoundsNc) ) { @@ -880,7 +880,7 @@ EffectInstance::renderRoI(const RenderRoIArgs & args, args.view, 1., draftModeSupported && frameArgs->draftMode, - renderMappedMipMapLevel == 0 && !renderScaleOneUpstreamIfRenderScaleSupportDisabled) ); + renderMappedMipmapLevel == 0 && !renderScaleOneUpstreamIfRenderScaleSupportDisabled) ); std::unique_ptr nonDraftKey( new ImageKey(getNode().get(), nodeHash, isFrameVaryingOrAnimated, @@ -888,7 +888,7 @@ EffectInstance::renderRoI(const RenderRoIArgs & args, args.view, 1., false, - renderMappedMipMapLevel == 0 && !renderScaleOneUpstreamIfRenderScaleSupportDisabled) ); + renderMappedMipmapLevel == 0 && !renderScaleOneUpstreamIfRenderScaleSupportDisabled) ); bool isDuringPaintStroke = isDuringPaintStrokeCreationThreadLocal(); @@ -940,9 +940,9 @@ EffectInstance::renderRoI(const RenderRoIArgs & args, // If the node doesn't support render scale, first lookup the cache with requested level, if not cached then lookup // with full scale - unsigned int lookupMipMapLevel = (renderMappedMipMapLevel != mipMapLevel && !isDuringPaintStroke)? mipMapLevel : renderMappedMipMapLevel; + unsigned int lookupMipmapLevel = (renderMappedMipmapLevel != mipmapLevel && !isDuringPaintStroke)? mipmapLevel : renderMappedMipmapLevel; for (int n = 0; n < nLookups; ++n) { - getImageFromCacheAndConvertIfNeeded(createInCache, storage, args.returnStorage, n == 0 ? *nonDraftKey : *key, lookupMipMapLevel, + getImageFromCacheAndConvertIfNeeded(createInCache, storage, args.returnStorage, n == 0 ? *nonDraftKey : *key, lookupMipmapLevel, &downscaledImageBounds, &rod, args.roi, args.bitdepth, *it, @@ -956,7 +956,7 @@ EffectInstance::renderRoI(const RenderRoIArgs & args, appPTR->removeFromNodeCache( key->getHash() ); plane.fullscaleImage.reset(); } - } else if (renderMappedMipMapLevel != mipMapLevel) { + } else if (renderMappedMipmapLevel != mipmapLevel) { // Only keep the cached image if it covers the roi std::list restToRender; plane.fullscaleImage->getRestToRender(args.roi, restToRender); @@ -964,17 +964,17 @@ EffectInstance::renderRoI(const RenderRoIArgs & args, plane.fullscaleImage.reset(); } else { renderFullScaleThenDownscale = false; - renderMappedMipMapLevel = mipMapLevel; + renderMappedMipmapLevel = mipmapLevel; roi = args.roi; } } break; } } - if (!plane.fullscaleImage && renderMappedMipMapLevel != lookupMipMapLevel) { + if (!plane.fullscaleImage && renderMappedMipmapLevel != lookupMipmapLevel) { // Not found at requested mipmap level, look at full scale for (int n = 0; n < nLookups; ++n) { - getImageFromCacheAndConvertIfNeeded(createInCache, storage, args.returnStorage, n == 0 ? *nonDraftKey : *key, renderMappedMipMapLevel, + getImageFromCacheAndConvertIfNeeded(createInCache, storage, args.returnStorage, n == 0 ? *nonDraftKey : *key, renderMappedMipmapLevel, &upscaledImageBounds, &rod, roi, args.bitdepth, *it, @@ -1057,7 +1057,7 @@ EffectInstance::renderRoI(const RenderRoIArgs & args, if (requestPassData) { *framesNeeded = requestPassData->globalData.frameViewsNeeded; } else { - *framesNeeded = getFramesNeeded_public(nodeHash, args.time, args.view, renderMappedMipMapLevel); + *framesNeeded = getFramesNeeded_public(nodeHash, args.time, args.view, renderMappedMipmapLevel); } } @@ -1091,7 +1091,7 @@ EffectInstance::renderRoI(const RenderRoIArgs & args, lastStrokeRoD = getApp()->getLastPaintStrokeBbox(); node->clearLastPaintStrokeRoD(); // qDebug() << getScriptName_mt_safe().c_str() << "last stroke RoD: " << lastStrokeRoD.x1 << lastStrokeRoD.y1 << lastStrokeRoD.x2 << lastStrokeRoD.y2; - lastStrokePixelRoD = lastStrokeRoD.toPixelEnclosing(mipMapLevel, par); + lastStrokePixelRoD = lastStrokeRoD.toPixelEnclosing(mipmapLevel, par); } } @@ -1227,7 +1227,7 @@ EffectInstance::renderRoI(const RenderRoIArgs & args, are identity over one of the input effect, thus avoiding pixels to render. */ if ( inputsIntersectionSet && (hasMask || hasDifferentRods) ) { - inputsRoDIntersectionPixel = inputsIntersection.toPixelEnclosing(mipMapLevel, par); + inputsRoDIntersectionPixel = inputsIntersection.toPixelEnclosing(mipmapLevel, par); tryIdentityOptim = true; } } @@ -1298,7 +1298,7 @@ EffectInstance::renderRoI(const RenderRoIArgs & args, } RenderRoIRetCode inputCode; { - const RectD canonicalRoI = it->rect.toCanonical(renderFullScaleThenDownscale ? 0 : args.mipMapLevel, par, rod); + const RectD canonicalRoI = it->rect.toCanonical(renderFullScaleThenDownscale ? 0 : args.mipmapLevel, par, rod); inputCode = renderInputImagesForRoI(requestPassData, useTransforms, @@ -1308,7 +1308,7 @@ EffectInstance::renderRoI(const RenderRoIArgs & args, rod, canonicalRoI, tls->currentRenderArgs.transformRedirections, - args.mipMapLevel, + args.mipmapLevel, renderMappedScale, renderScaleOneUpstreamIfRenderScaleSupportDisabled, byPassCache, @@ -1391,7 +1391,7 @@ EffectInstance::renderRoI(const RenderRoIArgs & args, planesToRender->outputPremult, fieldingOrder, par, - args.mipMapLevel, + args.mipmapLevel, renderFullScaleThenDownscale, storage, createInCache, @@ -1448,19 +1448,19 @@ EffectInstance::renderRoI(const RenderRoIArgs & args, it->second.fullscaleImage->clearBitmap(lastStrokePixelRoD); } - if ( renderFullScaleThenDownscale && (it->second.fullscaleImage->getMipMapLevel() == 0) ) { - const RectI bounds = rod.toPixelEnclosing(args.mipMapLevel, par); + if ( renderFullScaleThenDownscale && (it->second.fullscaleImage->getMipmapLevel() == 0) ) { + const RectI bounds = rod.toPixelEnclosing(args.mipmapLevel, par); it->second.downscaleImage = std::make_shared(*components, rod, downscaledImageBounds, - args.mipMapLevel, + args.mipmapLevel, it->second.fullscaleImage->getPixelAspectRatio(), outputDepth, planesToRender->outputPremult, fieldingOrder, true); - it->second.fullscaleImage->downscaleMipMap( rod, it->second.fullscaleImage->getBounds(), 0, args.mipMapLevel, true, it->second.downscaleImage.get() ); + it->second.fullscaleImage->downscaleMipmap( rod, it->second.fullscaleImage->getBounds(), 0, args.mipmapLevel, true, it->second.downscaleImage.get() ); } } @@ -1470,7 +1470,7 @@ EffectInstance::renderRoI(const RenderRoIArgs & args, ///Subsequently the image and downscaled image are different only if the plug-in ///does not support the render scale and the proxy mode is turned on. assert( (it->second.fullscaleImage == it->second.downscaleImage && !renderFullScaleThenDownscale) || - ( ( it->second.fullscaleImage != it->second.downscaleImage || it->second.fullscaleImage->getMipMapLevel() == it->second.downscaleImage->getMipMapLevel() ) && renderFullScaleThenDownscale ) ); + ( ( it->second.fullscaleImage != it->second.downscaleImage || it->second.fullscaleImage->getMipmapLevel() == it->second.downscaleImage->getMipmapLevel() ) && renderFullScaleThenDownscale ) ); } // for each plane #if NATRON_ENABLE_TRIMAP @@ -1543,7 +1543,7 @@ EffectInstance::renderRoI(const RenderRoIArgs & args, ///For eRenderSafetyFullySafe, don't take any lock, the image already has a lock on itself so we're sure it can't be written to by 2 different threads. if ( frameArgs->stats && frameArgs->stats->isInDepthProfilingEnabled() ) { - frameArgs->stats->setGlobalRenderInfosForNode(getNode(), rod, planesToRender->outputPremult, processChannels, frameArgs->tilesSupported, !renderFullScaleThenDownscale, renderMappedMipMapLevel); + frameArgs->stats->setGlobalRenderInfosForNode(getNode(), rod, planesToRender->outputPremult, processChannels, frameArgs->tilesSupported, !renderFullScaleThenDownscale, renderMappedMipmapLevel); } # ifdef DEBUG @@ -1580,7 +1580,7 @@ EffectInstance::renderRoI(const RenderRoIArgs & args, args.time, frameArgs, safety, - args.mipMapLevel, + args.mipmapLevel, args.view, rod, par, @@ -1660,7 +1660,7 @@ EffectInstance::renderRoI(const RenderRoIArgs & args, if (!frameArgs->tilesSupported) { //assert that bounds are consistent with the RoD if tiles are not supported const RectD & srcRodCanonical = renderFullScaleThenDownscale ? it->second.fullscaleImage->getRoD() : it->second.downscaleImage->getRoD(); - const RectI srcBounds = srcRodCanonical.toPixelEnclosing(renderFullScaleThenDownscale ? it->second.fullscaleImage->getMipMapLevel() : it->second.downscaleImage->getMipMapLevel(), par); + const RectI srcBounds = srcRodCanonical.toPixelEnclosing(renderFullScaleThenDownscale ? it->second.fullscaleImage->getMipmapLevel() : it->second.downscaleImage->getMipmapLevel(), par); const RectI srcRealBounds = renderFullScaleThenDownscale ? it->second.fullscaleImage->getBounds() : it->second.downscaleImage->getBounds(); assert(srcRealBounds.x1 == srcBounds.x1); assert(srcRealBounds.x2 == srcBounds.x2); @@ -1719,14 +1719,14 @@ EffectInstance::renderRoI(const RenderRoIArgs & args, //We have to return the downscale image, so make sure it has been computed if ( (renderRetCode != eRenderRoIStatusRenderFailed) && renderFullScaleThenDownscale && - ( it->second.fullscaleImage->getMipMapLevel() != mipMapLevel && it->second.fullscaleImage->getStorageMode() != eStorageModeGLTex) && + ( it->second.fullscaleImage->getMipmapLevel() != mipmapLevel && it->second.fullscaleImage->getStorageMode() != eStorageModeGLTex) && !hasSomethingToRender ) { - assert(it->second.fullscaleImage->getMipMapLevel() == 0); + assert(it->second.fullscaleImage->getMipmapLevel() == 0); if (it->second.downscaleImage == it->second.fullscaleImage) { it->second.downscaleImage = std::make_shared(it->second.fullscaleImage->getComponents(), it->second.fullscaleImage->getRoD(), downscaledImageBounds, - args.mipMapLevel, + args.mipmapLevel, it->second.fullscaleImage->getPixelAspectRatio(), it->second.fullscaleImage->getBitDepth(), it->second.fullscaleImage->getPremultiplication(), @@ -1735,7 +1735,7 @@ EffectInstance::renderRoI(const RenderRoIArgs & args, it->second.downscaleImage->setKey(it->second.fullscaleImage->getKey()); } - it->second.fullscaleImage->downscaleMipMap( it->second.fullscaleImage->getRoD(), originalRoI, 0, args.mipMapLevel, false, it->second.downscaleImage.get() ); + it->second.fullscaleImage->downscaleMipmap( it->second.fullscaleImage->getRoD(), originalRoI, 0, args.mipmapLevel, false, it->second.downscaleImage.get() ); } const ImagePlaneDesc* comp = 0; @@ -1753,7 +1753,7 @@ EffectInstance::renderRoI(const RenderRoIArgs & args, assert(comp); ///The image might need to be converted to fit the original requested format if (comp) { - const RectI downscaledOriginalRoI = originalRoI.toNewMipMapLevel(originalRoIMipMapLevel, args.mipMapLevel, par, rod); + const RectI downscaledOriginalRoI = originalRoI.toNewMipmapLevel(originalRoIMipmapLevel, args.mipmapLevel, par, rod); it->second.downscaleImage = convertPlanesFormatsIfNeeded(getApp(), it->second.downscaleImage, downscaledOriginalRoI, *comp, args.bitdepth, useAlpha0ForRGBToRGBAConversion, planesToRender->outputPremult, -1); assert(it->second.downscaleImage->getComponents() == *comp && it->second.downscaleImage->getBitDepth() == args.bitdepth); @@ -1782,7 +1782,7 @@ EffectInstance::renderRoI(const RenderRoIArgs & args, } #ifdef DEBUG - const RectI renderedImageBounds = rod.toPixelEnclosing(args.mipMapLevel, par); + const RectI renderedImageBounds = rod.toPixelEnclosing(args.mipmapLevel, par); const RectI expectedContainedRoI = args.roi.intersect(renderedImageBounds); if ( !it->second.downscaleImage->getBounds().contains(expectedContainedRoI) ) { qDebug() << "[WARNING]:" << getScriptName_mt_safe().c_str() << "rendered an image with an RoI that fell outside its bounds."; @@ -1821,7 +1821,7 @@ EffectInstance::renderRoIInternal(EffectInstance* self, double time, const ParallelRenderArgsPtr & frameArgs, RenderSafetyEnum safety, - unsigned int mipMapLevel, + unsigned int mipmapLevel, ViewIdx view, const RectD & rod, //!< effect rod in canonical coords const double par, @@ -1855,16 +1855,16 @@ EffectInstance::renderRoIInternal(EffectInstance* self, self->getApp()->getProject()->setOrAddProjectFormat(frmt); } - unsigned int renderMappedMipMapLevel = 0; + unsigned int renderMappedMipmapLevel = 0; for (std::map::iterator it = planesToRender->planes.begin(); it != planesToRender->planes.end(); ++it) { it->second.renderMappedImage = renderFullScaleThenDownscale ? it->second.fullscaleImage : it->second.downscaleImage; if ( it == planesToRender->planes.begin() ) { - renderMappedMipMapLevel = it->second.renderMappedImage->getMipMapLevel(); + renderMappedMipmapLevel = it->second.renderMappedImage->getMipmapLevel(); } } - RenderScale renderMappedScale( RenderScale::fromMipmapLevel(renderMappedMipMapLevel) ); + RenderScale renderMappedScale( RenderScale::fromMipmapLevel(renderMappedMipmapLevel) ); RenderingFunctorRetEnum renderStatus = eRenderingFunctorRetOK; if ( planesToRender->rectsToRender.empty() ) { retCode = EffectInstance::eRenderRoIStatusImageAlreadyRendered; @@ -1932,8 +1932,8 @@ EffectInstance::renderRoIInternal(EffectInstance* self, tiledArgs->firstFrame = firstFrame; tiledArgs->lastFrame = lastFrame; tiledArgs->preferredInput = preferredInput; - tiledArgs->mipMapLevel = mipMapLevel; - tiledArgs->renderMappedMipMapLevel = renderMappedMipMapLevel; + tiledArgs->mipmapLevel = mipmapLevel; + tiledArgs->renderMappedMipmapLevel = renderMappedMipmapLevel; tiledArgs->rod = rod; tiledArgs->time = time; tiledArgs->view = view; @@ -1981,7 +1981,7 @@ EffectInstance::renderRoIInternal(EffectInstance* self, } } else { for (std::list::const_iterator it = planesToRender->rectsToRender.begin(); it != planesToRender->rectsToRender.end(); ++it) { - RenderingFunctorRetEnum functorRet = self->_imp->tiledRenderingFunctor(*it, renderFullScaleThenDownscale, isSequentialRender, isRenderMadeInResponseToUserInteraction, firstFrame, lastFrame, preferredInput, mipMapLevel, renderMappedMipMapLevel, rod, time, view, par, byPassCache, outputClipPrefDepth, outputClipPrefsComps, compsNeeded, processChannels, planesToRender); + RenderingFunctorRetEnum functorRet = self->_imp->tiledRenderingFunctor(*it, renderFullScaleThenDownscale, isSequentialRender, isRenderMadeInResponseToUserInteraction, firstFrame, lastFrame, preferredInput, mipmapLevel, renderMappedMipmapLevel, rod, time, view, par, byPassCache, outputClipPrefDepth, outputClipPrefsComps, compsNeeded, processChannels, planesToRender); if ( (functorRet == eRenderingFunctorRetFailed) || (functorRet == eRenderingFunctorRetAborted) || (functorRet == eRenderingFunctorRetOutOfGPUMemory) ) { renderStatus = functorRet; diff --git a/Engine/FrameEntrySerialization.h b/Engine/FrameEntrySerialization.h index 1e66e28f7..0f984c4fa 100644 --- a/Engine/FrameEntrySerialization.h +++ b/Engine/FrameEntrySerialization.h @@ -76,7 +76,7 @@ FrameKey::serialize(Archive & ar, ar & ::boost::serialization::make_nvp("Channels", _channels); ar & ::boost::serialization::make_nvp("View", _view); ar & ::boost::serialization::make_nvp("TextureRect", _textureRect); - ar & ::boost::serialization::make_nvp("LoD", _mipMapLevel); + ar & ::boost::serialization::make_nvp("LoD", _mipmapLevel); if (version >= FRAME_KEY_INTRODUCES_INPUT_NAME) { ar & ::boost::serialization::make_nvp("InputName", _inputName); diff --git a/Engine/FrameKey.cpp b/Engine/FrameKey.cpp index 1412d4111..4565651fc 100644 --- a/Engine/FrameKey.cpp +++ b/Engine/FrameKey.cpp @@ -43,7 +43,7 @@ FrameKey::FrameKey() , _channels(0) , _view(0) , _textureRect() - , _mipMapLevel(0) + , _mipmapLevel(0) , _layer() , _alphaChannelFullName() , _useShaders(false) @@ -61,7 +61,7 @@ FrameKey::FrameKey(const CacheEntryHolder* holder, int channels, ViewIdx view, const TextureRect & textureRect, - unsigned int mipMapLevel, + unsigned int mipmapLevel, const std::string & inputName, const ImagePlaneDesc& layer, const std::string& alphaChannelFullName, @@ -77,7 +77,7 @@ FrameKey::FrameKey(const CacheEntryHolder* holder, , _channels(channels) , _view(view) , _textureRect(textureRect) - , _mipMapLevel(mipMapLevel) + , _mipmapLevel(mipmapLevel) , _inputName(inputName) , _layer(layer) , _alphaChannelFullName(alphaChannelFullName) @@ -104,7 +104,7 @@ FrameKey::fillHash(Hash64* hash) const hash->append(_textureRect.x2); hash->append(_textureRect.y2); hash->append(_textureRect.closestPo2); - hash->append(_mipMapLevel); + hash->append(_mipmapLevel); Hash64_appendQString( hash, QString::fromUtf8( _layer.getPlaneID().c_str() ) ); const std::vector& channels = _layer.getChannels(); for (std::size_t i = 0; i < channels.size(); ++i) { @@ -130,7 +130,7 @@ FrameKey::operator==(const FrameKey & other) const _channels == other._channels && _view == other._view && _textureRect == other._textureRect && - _mipMapLevel == other._mipMapLevel && + _mipmapLevel == other._mipmapLevel && _inputName == other._inputName && _layer == other._layer && _alphaChannelFullName == other._alphaChannelFullName && diff --git a/Engine/FrameKey.h b/Engine/FrameKey.h index 3ab0602c1..90c4afb1e 100644 --- a/Engine/FrameKey.h +++ b/Engine/FrameKey.h @@ -52,7 +52,7 @@ class FrameKey int channels, ViewIdx view, const TextureRect & textureRect, - unsigned int mipMapLevel, + unsigned int mipmapLevel, const std::string & inputName, const ImagePlaneDesc& layer, const std::string& alphaChannelFullName, @@ -103,9 +103,9 @@ class FrameKey return _view; } - unsigned int getMipMapLevel() const + unsigned int getMipmapLevel() const { - return _mipMapLevel; + return _mipmapLevel; } const std::string & getInputName() const WARN_UNUSED_RETURN @@ -132,7 +132,7 @@ class FrameKey // picks a new value in dropdown on the GUI int /*ViewIdx*/ _view; // The view of the frame, store it locally as an int for easier serialization TextureRect _textureRect; // texture rectangle definition (bounds in the original image + width and height) - unsigned int _mipMapLevel; // The scale of the image from which this texture was made + unsigned int _mipmapLevel; // The scale of the image from which this texture was made std::string _inputName; // The name of the input node used (to not mix up input 1, 2, 3 etc...) ImagePlaneDesc _layer; // The Layer of the image std::string _alphaChannelFullName; /// e.g: color.a , only used if _channels if A diff --git a/Engine/HistogramCPU.cpp b/Engine/HistogramCPU.cpp index 95d45f568..e58d0702c 100644 --- a/Engine/HistogramCPU.cpp +++ b/Engine/HistogramCPU.cpp @@ -88,7 +88,7 @@ struct FinishedHistogram int binsCount; int pixelsCount; double vmin, vmax; - unsigned int mipMapLevel; + unsigned int mipmapLevel; FinishedHistogram() : histogram1() @@ -99,7 +99,7 @@ struct FinishedHistogram , pixelsCount(0) , vmin(0) , vmax(0) - , mipMapLevel(0) + , mipmapLevel(0) { } }; @@ -199,7 +199,7 @@ HistogramCPU::getMostRecentlyProducedHistogram(std::vector* histogram1, int* mode, double* vmin, double* vmax, - unsigned int* mipMapLevel) + unsigned int* mipmapLevel) { assert(histogram1 && histogram2 && histogram3 && binsCount && pixelsCount && mode && vmin && vmax); @@ -218,7 +218,7 @@ HistogramCPU::getMostRecentlyProducedHistogram(std::vector* histogram1, *mode = h->mode; *vmin = h->vmin; *vmax = h->vmax; - *mipMapLevel = h->mipMapLevel; + *mipmapLevel = h->mipmapLevel; _imp->produced.pop_back(); return true; @@ -417,7 +417,7 @@ HistogramCPU::run() ret->mode = request.mode; ret->vmin = request.vmin; ret->vmax = request.vmax; - ret->mipMapLevel = request.image->getMipMapLevel(); + ret->mipmapLevel = request.image->getMipmapLevel(); switch (request.mode) { diff --git a/Engine/HistogramCPU.h b/Engine/HistogramCPU.h index 7622e9f3d..4a9b961d2 100644 --- a/Engine/HistogramCPU.h +++ b/Engine/HistogramCPU.h @@ -75,7 +75,7 @@ GCC_DIAG_SUGGEST_OVERRIDE_ON unsigned int* binsCount, unsigned int* pixelsCount, int* mode, - double* vmin, double* vmax, unsigned int* mipMapLevel); + double* vmin, double* vmax, unsigned int* mipmapLevel); void quitAnyComputation(); diff --git a/Engine/Image.cpp b/Engine/Image.cpp index ce51db876..0b082107d 100644 --- a/Engine/Image.cpp +++ b/Engine/Image.cpp @@ -694,7 +694,7 @@ Image::Image(const ImageKey & key, Image::Image(const ImagePlaneDesc& components, const RectD & regionOfDefinition, //!< rod in canonical coordinates const RectI & bounds, //!< bounds in pixel coordinates - unsigned int mipMapLevel, + unsigned int mipmapLevel, double par, ImageBitDepthEnum bitdepth, ImagePremultiplicationEnum premult, @@ -709,7 +709,7 @@ Image::Image(const ImagePlaneDesc& components, #ifdef BOOST_NO_CXX11_VARIADIC_TEMPLATES ImageParamsPtr( new ImageParams(regionOfDefinition, par, - mipMapLevel, + mipmapLevel, bounds, bitdepth, fielding, @@ -721,7 +721,7 @@ Image::Image(const ImagePlaneDesc& components, #else std::make_shared(regionOfDefinition, par, - mipMapLevel, + mipmapLevel, bounds, bitdepth, fielding, @@ -793,7 +793,7 @@ Image::makeKey(const CacheEntryHolder* holder, ImageParamsPtr Image::makeParams(const RectD & rod, const double par, - unsigned int mipMapLevel, + unsigned int mipmapLevel, bool isRoDProjectFormat, const ImagePlaneDesc& components, ImageBitDepthEnum bitdepth, @@ -802,12 +802,12 @@ Image::makeParams(const RectD & rod, StorageModeEnum storage, U32 textureTarget) { - const RectI bounds = rod.toPixelEnclosing(mipMapLevel, par); + const RectI bounds = rod.toPixelEnclosing(mipmapLevel, par); #ifdef BOOST_NO_CXX11_VARIADIC_TEMPLATES return ImageParamsPtr( new ImageParams(rod, par, - mipMapLevel, + mipmapLevel, bounds, bitdepth, fielding, @@ -819,7 +819,7 @@ Image::makeParams(const RectD & rod, #else return std::make_shared(rod, par, - mipMapLevel, + mipmapLevel, bounds, bitdepth, fielding, @@ -835,7 +835,7 @@ ImageParamsPtr Image::makeParams(const RectD & rod, // the image rod in canonical coordinates const RectI& bounds, const double par, - unsigned int mipMapLevel, + unsigned int mipmapLevel, bool isRoDProjectFormat, const ImagePlaneDesc& components, ImageBitDepthEnum bitdepth, @@ -846,7 +846,7 @@ Image::makeParams(const RectD & rod, // the image rod in canonical coordinate { #ifdef DEBUG RectI pixelRod; - rod.toPixelEnclosing(mipMapLevel, par, &pixelRod); + rod.toPixelEnclosing(mipmapLevel, par, &pixelRod); assert( bounds.left() >= pixelRod.left() && bounds.right() <= pixelRod.right() && bounds.bottom() >= pixelRod.bottom() && bounds.top() <= pixelRod.top() ); #endif @@ -854,7 +854,7 @@ Image::makeParams(const RectD & rod, // the image rod in canonical coordinate #ifdef BOOST_NO_CXX11_VARIADIC_TEMPLATES return ImageParamsPtr( new ImageParams(rod, par, - mipMapLevel, + mipmapLevel, bounds, bitdepth, fielding, @@ -866,7 +866,7 @@ Image::makeParams(const RectD & rod, // the image rod in canonical coordinate #else return std::make_shared(rod, par, - mipMapLevel, + mipmapLevel, bounds, bitdepth, fielding, @@ -966,7 +966,7 @@ Image::resizeInternal(const Image* srcImg, *outputImage = std::make_shared( srcImg->getComponents(), srcImg->getRoD(), merge, - srcImg->getMipMapLevel(), + srcImg->getMipmapLevel(), srcImg->getPixelAspectRatio(), srcImg->getBitDepth(), srcImg->getPremultiplication(), @@ -2063,7 +2063,7 @@ Image::halve1DImage(const RectI & roi, // code proofread and fixed by @devernay on 8/8/2014 void -Image::downscaleMipMap(const RectD& dstRod, +Image::downscaleMipmap(const RectD& dstRod, const RectI & roi, unsigned int fromLevel, unsigned int toLevel, @@ -2085,7 +2085,7 @@ Image::downscaleMipMap(const RectD& dstRod, RectI dstRoI = roi.downscalePowerOfTwoSmallestEnclosing(downscaleLvls); ImagePtr tmpImg = std::make_shared( getComponents(), dstRod, dstRoI, toLevel, par, getBitDepth(), getPremultiplication(), getFieldingOrder(), true); - buildMipMapLevel( dstRod, roi, downscaleLvls, copyBitMap, tmpImg.get() ); + buildMipmapLevel( dstRod, roi, downscaleLvls, copyBitMap, tmpImg.get() ); // check that the downscaled mipmap is inside the output image (it may not be equal to it) assert(dstRoI.x1 >= output->_bounds.x1); @@ -2165,7 +2165,7 @@ Image::checkForNaNsNoLock(const RectI& roi) const // code proofread and fixed by @devernay on 8/8/2014 template void -Image::upscaleMipMapForDepth(const RectI & roi, +Image::upscaleMipmapForDepth(const RectI & roi, unsigned int fromLevel, unsigned int toLevel, Image* output) const @@ -2181,7 +2181,7 @@ Image::upscaleMipMapForDepth(const RectI & roi, const RectI & srcRoi = roi; // The source rectangle, intersected to this image region of definition in pixels and the output bounds. - RectI dstRoi = roi.toNewMipMapLevel(fromLevel, toLevel, _par, getRoD()); + RectI dstRoi = roi.toNewMipmapLevel(fromLevel, toLevel, _par, getRoD()); dstRoi.clipIfOverlaps(output->_bounds); //output may be a bit smaller than the upscaled RoI int scale = 1 << (fromLevel - toLevel); @@ -2242,11 +2242,11 @@ Image::upscaleMipMapForDepth(const RectI & roi, std::copy(dstLineBatchStart, dstLineBatchStart + dstRowSize, dstLineStart); } } -} // upscaleMipMapForDepth +} // upscaleMipmapForDepth // code proofread and fixed by @devernay on 8/8/2014 void -Image::upscaleMipMap(const RectI & roi, +Image::upscaleMipmap(const RectI & roi, unsigned int fromLevel, unsigned int toLevel, Image* output) const @@ -2255,16 +2255,16 @@ Image::upscaleMipMap(const RectI & roi, switch ( getBitDepth() ) { case eImageBitDepthByte: - upscaleMipMapForDepth(roi, fromLevel, toLevel, output); + upscaleMipmapForDepth(roi, fromLevel, toLevel, output); break; case eImageBitDepthShort: - upscaleMipMapForDepth(roi, fromLevel, toLevel, output); + upscaleMipmapForDepth(roi, fromLevel, toLevel, output); break; case eImageBitDepthHalf: assert(false); break; case eImageBitDepthFloat: - upscaleMipMapForDepth(roi, fromLevel, toLevel, output); + upscaleMipmapForDepth(roi, fromLevel, toLevel, output); break; case eImageBitDepthNone: break; @@ -2273,7 +2273,7 @@ Image::upscaleMipMap(const RectI & roi, // code proofread and fixed by @devernay on 8/8/2014 void -Image::buildMipMapLevel(const RectD& dstRoD, +Image::buildMipmapLevel(const RectD& dstRoD, const RectI & roi, unsigned int level, bool copyBitMap, @@ -2304,7 +2304,7 @@ Image::buildMipMapLevel(const RectD& dstRoD, RectI halvedRoI = previousRoI.downscalePowerOfTwoSmallestEnclosing(1); ///Allocate an image with half the size of the source image - dstImg = new Image( getComponents(), dstRoD, halvedRoI, getMipMapLevel() + i, getPixelAspectRatio(), getBitDepth(), getPremultiplication(), getFieldingOrder(), true); + dstImg = new Image( getComponents(), dstRoD, halvedRoI, getMipmapLevel() + i, getPixelAspectRatio(), getBitDepth(), getPremultiplication(), getFieldingOrder(), true); ///Half the source image into dstImg. ///We pass the closestPo2 roi which might not be the entire size of the source image @@ -2331,7 +2331,7 @@ Image::buildMipMapLevel(const RectD& dstRoD, if (mustFreeSrc) { delete srcImg; } -} // buildMipMapLevel +} // buildMipmapLevel #ifndef M_LN2 #define M_LN2 0.693147180559945309417232121458176568 /* loge(2) */ diff --git a/Engine/Image.h b/Engine/Image.h index e57aeaf25..36469b2d5 100644 --- a/Engine/Image.h +++ b/Engine/Image.h @@ -189,7 +189,7 @@ class Image Image(const ImagePlaneDesc& components, const RectD & regionOfDefinition, //!< rod in canonical coordinates const RectI & bounds, //!< bounds in pixel coordinates - unsigned int mipMapLevel, + unsigned int mipmapLevel, double par, ImageBitDepthEnum bitdepth, ImagePremultiplicationEnum premult, @@ -222,7 +222,7 @@ class Image bool fullScaleWithDownscaleInputs); static ImageParamsPtr makeParams(const RectD & rod, // the image rod in canonical coordinates const double par, - unsigned int mipMapLevel, + unsigned int mipmapLevel, bool isRoDProjectFormat, const ImagePlaneDesc& components, ImageBitDepthEnum bitdepth, @@ -233,7 +233,7 @@ class Image static ImageParamsPtr makeParams(const RectD & rod, // the image rod in canonical coordinates const RectI& bounds, const double par, - unsigned int mipMapLevel, + unsigned int mipmapLevel, bool isRoDProjectFormat, const ImagePlaneDesc& components, ImageBitDepthEnum bitdepth, @@ -289,7 +289,7 @@ class Image /** * @brief Returns the bounds where data is in the image. - * This is equivalent to calling getRoD().mipMapLevel(getMipMapLevel()); + * This is equivalent to calling getRoD().mipmapLevel(getMipmapLevel()); * but slightly faster since it is stored as a member of the image. **/ RectI getBounds() const @@ -317,9 +317,9 @@ class Image return size(); } - unsigned int getMipMapLevel() const + unsigned int getMipmapLevel() const { - return this->_params->getMipMapLevel(); + return this->_params->getMipmapLevel(); } unsigned int getComponentsCount() const; @@ -748,7 +748,7 @@ class Image * given mipmap level, * and then computes the mipmap of the given level of that rectangle. **/ - void downscaleMipMap(const RectD& rod, + void downscaleMipmap(const RectD& rod, const RectI & roi, unsigned int fromLevel, unsigned int toLevel, bool copyBitMap, @@ -758,7 +758,7 @@ class Image * @brief Upscales a portion of this image into output. * If the upscaled roi does not fit into output's bounds, it is cropped first. **/ - void upscaleMipMap(const RectI & roi, unsigned int fromLevel, unsigned int toLevel, Image* output) const; + void upscaleMipmap(const RectI & roi, unsigned int fromLevel, unsigned int toLevel, Image* output) const; static unsigned int getLevelFromScale(double s); @@ -977,7 +977,7 @@ class Image * function computes the mip map of this image in the given roi. * If roi is NOT a power of 2, then it will be rounded to the closest power of 2. **/ - void buildMipMapLevel(const RectD& dstRoD, const RectI & roiCanonical, unsigned int level, bool copyBitMap, + void buildMipmapLevel(const RectD& dstRoD, const RectI & roiCanonical, unsigned int level, bool copyBitMap, Image* output) const; @@ -1003,7 +1003,7 @@ class Image void halve1DImageForDepth(const RectI & roi, Image* output) const; template - void upscaleMipMapForDepth(const RectI & roi, unsigned int fromLevel, unsigned int toLevel, Image* output) const; + void upscaleMipmapForDepth(const RectI & roi, unsigned int fromLevel, unsigned int toLevel, Image* output) const; template void pasteFromForDepth(const Image & src, const RectI & srcRoi, bool copyBitmap = true, bool takeSrcLock = true); diff --git a/Engine/ImageCopyChannels.cpp b/Engine/ImageCopyChannels.cpp index 8da69c8d1..55c017985 100644 --- a/Engine/ImageCopyChannels.cpp +++ b/Engine/ImageCopyChannels.cpp @@ -609,8 +609,8 @@ Image::copyUnProcessedChannels(const RectI& roi, } - if ( originalImage && ( getMipMapLevel() != originalImage->getMipMapLevel() ) ) { - qDebug() << "WARNING: attempting to call copyUnProcessedChannels on images with different mipMapLevel"; + if ( originalImage && ( getMipmapLevel() != originalImage->getMipmapLevel() ) ) { + qDebug() << "WARNING: attempting to call copyUnProcessedChannels on images with different mipmapLevel"; return; } diff --git a/Engine/ImageKey.cpp b/Engine/ImageKey.cpp index 1d7efc6ba..fa5ad8444 100644 --- a/Engine/ImageKey.cpp +++ b/Engine/ImageKey.cpp @@ -36,7 +36,7 @@ ImageKey::ImageKey() : KeyHelper() , _nodeHashKey(0) , _time(0) -//, _mipMapLevel(0) +//, _mipmapLevel(0) , _pixelAspect(1) , _view(0) , _draftMode(false) @@ -49,7 +49,7 @@ ImageKey::ImageKey(const CacheEntryHolder* holder, U64 nodeHashKey, bool frameVaryingOrAnimated, double time, - //unsigned int mipMapLevel, //< Store different mipmapLevels under the same key + //unsigned int mipmapLevel, //< Store different mipmapLevels under the same key ViewIdx view, double pixelAspect, bool draftMode, diff --git a/Engine/ImageParams.h b/Engine/ImageParams.h index 06c8c29e8..0c05593c4 100644 --- a/Engine/ImageParams.h +++ b/Engine/ImageParams.h @@ -111,7 +111,7 @@ class ImageParams , _bitdepth(eImageBitDepthFloat) , _fielding(eImageFieldingOrderNone) , _premult(eImagePremultiplicationPremultiplied) - , _mipMapLevel(0) + , _mipmapLevel(0) , _isRoDProjectFormat(false) { } @@ -124,14 +124,14 @@ class ImageParams , _bitdepth(other._bitdepth) , _fielding(other._fielding) , _premult(other._premult) - , _mipMapLevel(other._mipMapLevel) + , _mipmapLevel(other._mipmapLevel) , _isRoDProjectFormat(other._isRoDProjectFormat) { } ImageParams(const RectD & rod, const double par, - const unsigned int mipMapLevel, + const unsigned int mipmapLevel, const RectI & bounds, ImageBitDepthEnum bitdepth, ImageFieldingOrderEnum fielding, @@ -147,7 +147,7 @@ class ImageParams , _bitdepth(bitdepth) , _fielding(fielding) , _premult(premult) - , _mipMapLevel(mipMapLevel) + , _mipmapLevel(mipmapLevel) , _isRoDProjectFormat(isRoDProjectFormat) { CacheEntryStorageInfo& info = getStorageInfo(); @@ -229,14 +229,9 @@ class ImageParams _par = par; } - unsigned int getMipMapLevel() const + unsigned int getMipmapLevel() const { - return _mipMapLevel; - } - - void setMipMapLevel(unsigned int mmlvl) - { - _mipMapLevel = mmlvl; + return _mipmapLevel; } template @@ -251,7 +246,7 @@ class ImageParams return _rod == other._rod && _components == other._components && _bitdepth == other._bitdepth - && _mipMapLevel == other._mipMapLevel + && _mipmapLevel == other._mipmapLevel && _premult == other._premult && _fielding == other._fielding; } @@ -269,7 +264,7 @@ class ImageParams ImageBitDepthEnum _bitdepth; ImageFieldingOrderEnum _fielding; ImagePremultiplicationEnum _premult; - unsigned int _mipMapLevel; + unsigned int _mipmapLevel; /// if true then when retrieving the associated image from cache /// the caller should update the rod to the current project format. /// This is because the project format might have changed since this image was cached. diff --git a/Engine/ImageParamsSerialization.h b/Engine/ImageParamsSerialization.h index 0dff96dcd..2dad07268 100644 --- a/Engine/ImageParamsSerialization.h +++ b/Engine/ImageParamsSerialization.h @@ -115,7 +115,7 @@ ImageParams::serialize(Archive & ar, // ar & ::boost::serialization::make_nvp("FramesNeeded",f); //} ar & ::boost::serialization::make_nvp("Components", _components); - ar & ::boost::serialization::make_nvp("MMLevel", _mipMapLevel); + ar & ::boost::serialization::make_nvp("MMLevel", _mipmapLevel); ar & ::boost::serialization::make_nvp("Premult", _premult); ar & ::boost::serialization::make_nvp("Fielding", _fielding); } diff --git a/Engine/Knob.h b/Engine/Knob.h index 022a9d33a..0c1e57daf 100644 --- a/Engine/Knob.h +++ b/Engine/Knob.h @@ -1069,7 +1069,6 @@ class KnobI virtual double getScreenPixelRatio() const OVERRIDE = 0; #endif virtual void getBackgroundColour(double &r, double &g, double &b) const OVERRIDE = 0; - virtual unsigned int getCurrentRenderScale() const OVERRIDE FINAL { return 0; } virtual RectD getViewportRect() const OVERRIDE = 0; virtual void getCursorPosition(double& x, double& y) const OVERRIDE = 0; diff --git a/Engine/KnobGuiI.h b/Engine/KnobGuiI.h index b14a6d53a..46791b181 100644 --- a/Engine/KnobGuiI.h +++ b/Engine/KnobGuiI.h @@ -60,7 +60,6 @@ class KnobGuiI virtual bool isGuiFrozenForPlayback() const = 0; virtual void saveOpenGLContext() OVERRIDE = 0; virtual void restoreOpenGLContext() OVERRIDE = 0; - virtual unsigned int getCurrentRenderScale() const OVERRIDE { return 0; } virtual CurvePtr getCurve(ViewSpec view, int dimension) const = 0; virtual bool getAllDimensionsVisible() const = 0; diff --git a/Engine/Node.cpp b/Engine/Node.cpp index c69bf50ad..aa0a905d5 100644 --- a/Engine/Node.cpp +++ b/Engine/Node.cpp @@ -522,7 +522,7 @@ Node::getLastPaintStrokePoints(double time, } ImagePtr -Node::getOrRenderLastStrokeImage(unsigned int mipMapLevel, +Node::getOrRenderLastStrokeImage(unsigned int mipmapLevel, double par, const ImagePlaneDesc& components, ImageBitDepthEnum depth) const @@ -544,7 +544,7 @@ Node::getOrRenderLastStrokeImage(unsigned int mipMapLevel, double distNextIn = 0.; ImagePtr strokeImage; getApp()->getRenderStrokeData(&lastStrokeBbox, &lastStrokePoints, &distNextIn, &strokeImage); - double distToNextOut = stroke->renderSingleStroke(lastStrokeBbox, lastStrokePoints, mipMapLevel, par, components, depth, distNextIn, &strokeImage); + double distToNextOut = stroke->renderSingleStroke(lastStrokeBbox, lastStrokePoints, mipmapLevel, par, components, depth, distNextIn, &strokeImage); getApp()->updateStrokeImage(strokeImage, distToNextOut, true); @@ -3325,12 +3325,12 @@ Node::makePreviewImage(SequenceTime time, double closestPowerOf2X = xZoomFactor >= 1 ? 1 : ipow( 2, (int)-std::ceil( std::log(xZoomFactor) / M_LN2 ) ); double closestPowerOf2Y = yZoomFactor >= 1 ? 1 : ipow( 2, (int)-std::ceil( std::log(yZoomFactor) / M_LN2 ) ); int closestPowerOf2 = std::max(closestPowerOf2X, closestPowerOf2Y); - unsigned int mipMapLevel = std::min(std::log( (double)closestPowerOf2 ) / std::log(2.), 5.); + unsigned int mipmapLevel = std::min(std::log( (double)closestPowerOf2 ) / std::log(2.), 5.); - const RenderScale scale = RenderScale::fromMipmapLevel(mipMapLevel); + const RenderScale scale = RenderScale::fromMipmapLevel(mipmapLevel); const double par = effect->getAspectRatio(-1); - const RectI renderWindow = rod.toPixelEnclosing(mipMapLevel, par); + const RectI renderWindow = rod.toPixelEnclosing(mipmapLevel, par); NodePtr thisNode = shared_from_this(); RenderingFlagSetter flagIsRendering(thisNode); @@ -3357,7 +3357,7 @@ Node::makePreviewImage(SequenceTime time, true, // isDraft RenderStatsPtr() ); FrameRequestMap request; - stat = EffectInstance::computeRequestPass(time, ViewIdx(0), mipMapLevel, rod, thisNode, request); + stat = EffectInstance::computeRequestPass(time, ViewIdx(0), mipmapLevel, rod, thisNode, request); if (stat == eStatusFailed) { return false; } @@ -3379,7 +3379,7 @@ Node::makePreviewImage(SequenceTime time, try { std::unique_ptr renderArgs( new EffectInstance::RenderRoIArgs(time, scale, - mipMapLevel, + mipmapLevel, ViewIdx(0), //< preview only renders view 0 (left) false, renderWindow, @@ -4436,7 +4436,7 @@ Node::unlock(const ImagePtr & image) ImagePtr Node::getImageBeingRendered(double time, - unsigned int mipMapLevel, + unsigned int mipmapLevel, ViewIdx view) { QMutexLocker l(&_imp->imagesBeingRenderedMutex); @@ -4444,7 +4444,7 @@ Node::getImageBeingRendered(double time, for (std::list::iterator it = _imp->imagesBeingRendered.begin(); it != _imp->imagesBeingRendered.end(); ++it) { const ImageKey &key = (*it)->getKey(); - if ( (key._view == view) && ( (*it)->getMipMapLevel() == mipMapLevel ) && (key._time == time) ) { + if ( (key._view == view) && ( (*it)->getMipmapLevel() == mipmapLevel ) && (key._time == time) ) { return *it; } } diff --git a/Engine/Node.h b/Engine/Node.h index 589bf3786..f5e433b75 100644 --- a/Engine/Node.h +++ b/Engine/Node.h @@ -494,7 +494,7 @@ GCC_DIAG_SUGGEST_OVERRIDE_ON unsigned int mipmapLevel, std::list > >* strokes, int* strokeIndex) const; - ImagePtr getOrRenderLastStrokeImage(unsigned int mipMapLevel, + ImagePtr getOrRenderLastStrokeImage(unsigned int mipmapLevel, double par, const ImagePlaneDesc& components, ImageBitDepthEnum depth) const; @@ -904,7 +904,7 @@ GCC_DIAG_SUGGEST_OVERRIDE_ON * @brief DO NOT EVER USE THIS FUNCTION. This is provided for compatibility with plug-ins that * do not respect the OpenFX specification. **/ - ImagePtr getImageBeingRendered(double time, unsigned int mipMapLevel, ViewIdx view); + ImagePtr getImageBeingRendered(double time, unsigned int mipmapLevel, ViewIdx view); void beginInputEdition(); diff --git a/Engine/OfxClipInstance.cpp b/Engine/OfxClipInstance.cpp index 3062fbb4a..f79463156 100644 --- a/Engine/OfxClipInstance.cpp +++ b/Engine/OfxClipInstance.cpp @@ -643,8 +643,8 @@ OfxClipInstance::getRegionOfDefinition(OfxTime time, mipmapLevel = 0; } else { ClipDataTLSPtr tls = _imp->tlsData->getOrCreateTLSData(); - if ( !tls->mipMapLevel.empty() ) { - mipmapLevel = tls->mipMapLevel.back(); + if ( !tls->mipmapLevel.empty() ) { + mipmapLevel = tls->mipmapLevel.back(); } else { mipmapLevel = 0; } @@ -679,8 +679,8 @@ OfxClipInstance::getRegionOfDefinition(OfxTime time) const if ( !tls->view.empty() ) { view = tls->view.back(); } - if ( !tls->mipMapLevel.empty() ) { - mipmapLevel = tls->mipMapLevel.back(); + if ( !tls->mipmapLevel.empty() ) { + mipmapLevel = tls->mipmapLevel.back(); } else { mipmapLevel = 0; } @@ -894,7 +894,7 @@ OfxClipInstance::getInputImageInternal(const OfxTime time, } - unsigned int mipMapLevel = 0; + unsigned int mipmapLevel = 0; // Get mipmaplevel and view from the TLS #ifdef DEBUG if ( !tls || tls->view.empty() ) { @@ -918,10 +918,10 @@ OfxClipInstance::getInputImageInternal(const OfxTime time, view = ViewIdx( viewParam.value() ); } - if ( tls->mipMapLevel.empty() ) { - mipMapLevel = 0; + if ( tls->mipmapLevel.empty() ) { + mipmapLevel = 0; } else { - mipMapLevel = tls->mipMapLevel.back(); + mipmapLevel = tls->mipmapLevel.back(); } } else { if ( viewParam.isCurrent() ) { @@ -946,7 +946,7 @@ OfxClipInstance::getInputImageInternal(const OfxTime time, } bool sameComponents = (mapImageToClipPref && (*it)->getComponentsString() == thisClipComponents) || (!mapImageToClipPref && (*it)->getComponentsString() == *ofxPlane); - if ( sameComponents && (internalImage->getMipMapLevel() == mipMapLevel) && + if ( sameComponents && (internalImage->getMipmapLevel() == mipmapLevel) && ( time == internalImage->getTime() ) && ( view == internalImage->getKey().getView() ) ) { if (retImage) { @@ -971,7 +971,7 @@ OfxClipInstance::getInputImageInternal(const OfxTime time, } - const RenderScale renderScale = RenderScale::fromMipmapLevel(mipMapLevel); + const RenderScale renderScale = RenderScale::fromMipmapLevel(mipmapLevel); RectD bounds; if (optionalBounds) { bounds.x1 = optionalBounds->x1; @@ -1368,8 +1368,8 @@ OfxImageCommon::OfxImageCommon(OFX::Host::ImageEffect::ImageBase* ofxImageBase, assert(internalImage); - const unsigned int mipMapLevel = internalImage->getMipMapLevel(); - const OfxPointD scale = RenderScale::fromMipmapLevel(mipMapLevel).toOfxPointD(); + const unsigned int mipmapLevel = internalImage->getMipmapLevel(); + const OfxPointD scale = RenderScale::fromMipmapLevel(mipmapLevel).toOfxPointD(); ofxImageBase->setDoubleProperty(kOfxImageEffectPropRenderScale, scale.x, 0); ofxImageBase->setDoubleProperty(kOfxImageEffectPropRenderScale, scale.y, 1); @@ -1466,7 +1466,7 @@ OfxImageCommon::OfxImageCommon(OFX::Host::ImageEffect::ImageBase* ofxImageBase, // " An image's region of definition, in *PixelCoordinates,* is the full frame area of the image plane that the image covers." // Image::getRoD() is in *CANONICAL* coordinates // OFX::Image RoD is in *PIXEL* coordinates - const RectI pixelRod = rod.toPixelEnclosing(mipMapLevel, internalImage->getPixelAspectRatio()); + const RectI pixelRod = rod.toPixelEnclosing(mipmapLevel, internalImage->getPixelAspectRatio()); ofxImageBase->setIntProperty(kOfxImagePropRegionOfDefinition, pixelRod.left(), 0); ofxImageBase->setIntProperty(kOfxImagePropRegionOfDefinition, pixelRod.bottom(), 1); ofxImageBase->setIntProperty(kOfxImagePropRegionOfDefinition, pixelRod.right(), 2); @@ -1580,7 +1580,7 @@ OfxClipInstance::setClipTLS(ViewIdx view, assert(tls); tls->view.push_back(view); - tls->mipMapLevel.push_back(mipmapLevel); + tls->mipmapLevel.push_back(mipmapLevel); RenderActionDataPtr d( new RenderActionData() ); d->clipComponents = components; tls->renderData.push_back(d); @@ -1599,9 +1599,9 @@ OfxClipInstance::invalidateClipTLS() if ( !tls->view.empty() ) { tls->view.pop_back(); } - assert( !tls->mipMapLevel.empty() ); - if ( !tls->mipMapLevel.empty() ) { - tls->mipMapLevel.pop_back(); + assert( !tls->mipmapLevel.empty() ); + if ( !tls->mipmapLevel.empty() ) { + tls->mipmapLevel.pop_back(); } assert( !tls->renderData.empty() ); if ( !tls->renderData.empty() ) { diff --git a/Engine/OfxClipInstance.h b/Engine/OfxClipInstance.h index a4f95e7a9..4b016025e 100644 --- a/Engine/OfxClipInstance.h +++ b/Engine/OfxClipInstance.h @@ -261,7 +261,7 @@ class OfxClipInstance //View may be involved in a recursive action std::list view; //mipmaplevel may be involved in a recursive action - std::list mipMapLevel; + std::list mipmapLevel; ////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////// @@ -279,7 +279,7 @@ class OfxClipInstance ClipTLSData() : view() - , mipMapLevel() + , mipmapLevel() , componentsPresent() , unmappedComponents() { @@ -287,7 +287,7 @@ class OfxClipInstance ClipTLSData(const ClipTLSData& other) : view(other.view) - , mipMapLevel(other.mipMapLevel) + , mipmapLevel(other.mipmapLevel) , renderData() , componentsPresent(other.componentsPresent) , unmappedComponents(other.unmappedComponents) diff --git a/Engine/OfxEffectInstance.cpp b/Engine/OfxEffectInstance.cpp index 2c786c538..6defbc2cb 100644 --- a/Engine/OfxEffectInstance.cpp +++ b/Engine/OfxEffectInstance.cpp @@ -1394,7 +1394,7 @@ OfxEffectInstance::getRegionOfDefinition(U64 /*hash*/, assert(_imp->effect); - unsigned int mipMapLevel = scale.toMipmapLevel(); + unsigned int mipmapLevel = scale.toMipmapLevel(); // getRegionOfDefinition may be the first action with renderscale called on any effect. // it may have to check for render scale support. @@ -1412,7 +1412,7 @@ OfxEffectInstance::getRegionOfDefinition(U64 /*hash*/, { ClipsThreadStorageSetter clipSetter(effectInstance(), view, - mipMapLevel); + mipmapLevel); assert(_imp->effect); if (getRecursionLevel() > 1) { @@ -1534,7 +1534,7 @@ OfxEffectInstance::calcDefaultRegionOfDefinition(U64 /*hash*/, throw std::runtime_error("OfxEffectInstance not initialized"); } - unsigned int mipMapLevel = scale.toMipmapLevel(); + unsigned int mipmapLevel = scale.toMipmapLevel(); OfxRectD ofxRod; { @@ -1545,7 +1545,7 @@ OfxEffectInstance::calcDefaultRegionOfDefinition(U64 /*hash*/, if (getRecursionLevel() == 0) { ClipsThreadStorageSetter clipSetter(effectInstance(), view, - mipMapLevel); + mipmapLevel); // from http://openfx.sourceforge.net/Documentation/1.3/ofxProgrammingReference.html#kOfxImageEffectActionGetRegionOfDefinition @@ -1600,13 +1600,13 @@ OfxEffectInstance::getRegionsOfInterest(double time, OfxStatus stat; ///before calling getRoIaction set the relevant info on the clips - unsigned int mipMapLevel = scale.toMipmapLevel(); + unsigned int mipmapLevel = scale.toMipmapLevel(); { SET_CAN_SET_VALUE(false); ClipsThreadStorageSetter clipSetter(effectInstance(), view, - mipMapLevel); + mipmapLevel); OfxRectD roi; rectToOfxRectD(renderWindow, &roi); @@ -1831,7 +1831,7 @@ OfxEffectInstance::isIdentity(double time, throw std::logic_error("isIdentity called with an unsupported RenderScale"); } - unsigned int mipMapLevel = scale.toMipmapLevel(); + unsigned int mipmapLevel = scale.toMipmapLevel(); OfxStatus stat; { @@ -1840,7 +1840,7 @@ OfxEffectInstance::isIdentity(double time, ClipsThreadStorageSetter clipSetter(effectInstance(), view, - mipMapLevel); + mipmapLevel); OfxRectI ofxRoI; ofxRoI.x1 = renderWindow.left(); ofxRoI.x2 = renderWindow.right(); @@ -1943,11 +1943,11 @@ OfxEffectInstance::beginSequenceRender(double first, assert(isSupportedRenderScale(supportsRenderScaleMaybe(), scale)); OfxStatus stat; - unsigned int mipMapLevel = scale.toMipmapLevel(); + unsigned int mipmapLevel = scale.toMipmapLevel(); { ClipsThreadStorageSetter clipSetter(effectInstance(), view, - mipMapLevel); + mipmapLevel); SET_CAN_SET_VALUE(false); @@ -1985,11 +1985,11 @@ OfxEffectInstance::endSequenceRender(double first, assert(isSupportedRenderScale(supportsRenderScaleMaybe(), scale)); OfxStatus stat; - unsigned int mipMapLevel = scale.toMipmapLevel(); + unsigned int mipmapLevel = scale.toMipmapLevel(); { ClipsThreadStorageSetter clipSetter(effectInstance(), view, - mipMapLevel); + mipmapLevel); SET_CAN_SET_VALUE(false); OfxGLContextEffectData* isOfxGLData = dynamic_cast( glContextData.get() ); diff --git a/Engine/OfxImageEffectInstance.cpp b/Engine/OfxImageEffectInstance.cpp index e73ed6d14..e5bda6ad3 100644 --- a/Engine/OfxImageEffectInstance.cpp +++ b/Engine/OfxImageEffectInstance.cpp @@ -442,8 +442,7 @@ OfxImageEffectInstance::getRenderScaleRecursive(double &x, ///get the render scale of the 1st viewer if ( !attachedViewers.empty() ) { ViewerInstance* first = attachedViewers.front(); - int mipmapLevel = first->getMipMapLevel(); - const auto scale = RenderScale::fromMipmapLevel((unsigned int)mipmapLevel).toOfxPointD(); + const auto scale = RenderScale::fromMipmapLevel(first->getMipmapLevel()).toOfxPointD(); x = scale.x; y = scale.y; } else { diff --git a/Engine/OpenGLViewerI.h b/Engine/OpenGLViewerI.h index 45a0ebded..6ef7a9de9 100644 --- a/Engine/OpenGLViewerI.h +++ b/Engine/OpenGLViewerI.h @@ -75,10 +75,10 @@ class OpenGLViewerI * @brief Given the region of definition of an image, must return the portion of that image which is * actually displayed on the viewport. (It cannot be bigger than the rod) **/ - virtual RectI getImageRectangleDisplayed(const RectI & pixelRod, const double par, unsigned int mipMapLevel) = 0; - virtual RectI getImageRectangleDisplayedRoundedToTileSize(int texIndex, const RectD & rod, const double par, unsigned int mipMapLevel, + virtual RectI getImageRectangleDisplayed(const RectI & pixelRod, const double par, unsigned int mipmapLevel) = 0; + virtual RectI getImageRectangleDisplayedRoundedToTileSize(int texIndex, const RectD & rod, const double par, unsigned int mipmapLevel, std::vector* tiles, std::vector* tilesRounded, int *tileSize, RectI* roiNotRounded) = 0; - virtual RectI getExactImageRectangleDisplayed(int texIndex, const RectD & rod, const double par, unsigned int mipMapLevel) = 0; + virtual RectI getExactImageRectangleDisplayed(int texIndex, const RectD & rod, const double par, unsigned int mipmapLevel) = 0; /** * @brief Must return the bit depth of the texture used to render. (Byte, half or float) @@ -123,7 +123,7 @@ class OpenGLViewerI const RectD& rod, double par, ImageBitDepthEnum depth, - unsigned int mipMapLevel, + unsigned int mipmapLevel, ImagePremultiplicationEnum premult, double gain, double gamma, diff --git a/Engine/OutputEffectInstance.cpp b/Engine/OutputEffectInstance.cpp index 1df1d2c20..00a591483 100644 --- a/Engine/OutputEffectInstance.cpp +++ b/Engine/OutputEffectInstance.cpp @@ -491,7 +491,7 @@ OutputEffectInstance::reportStats(int time, ofile << std::endl; ofile << "Mipmap level(s) rendered: "; - for (std::set::const_iterator it2 = it->second.getMipMapLevelsRendered().begin(); it2 != it->second.getMipMapLevelsRendered().end(); ++it2) { + for (std::set::const_iterator it2 = it->second.getMipmapLevelsRendered().begin(); it2 != it->second.getMipmapLevelsRendered().end(); ++it2) { ofile << *it2 << ' '; } ofile << std::endl; diff --git a/Engine/OverlaySupport.h b/Engine/OverlaySupport.h index cc78dba58..e03fe0616 100644 --- a/Engine/OverlaySupport.h +++ b/Engine/OverlaySupport.h @@ -98,7 +98,7 @@ class OverlaySupport /** * @brief Get the current mipmapLevel applied by the viewer **/ - virtual unsigned int getCurrentRenderScale() const = 0; + virtual unsigned int getCurrentMipmapLevel() const { return 0; } /** * @brief Returns whether the given rectangle in canonical coords is visible in the viewport diff --git a/Engine/ParallelRenderArgs.cpp b/Engine/ParallelRenderArgs.cpp index 4d3f062c4..8d9093520 100644 --- a/Engine/ParallelRenderArgs.cpp +++ b/Engine/ParallelRenderArgs.cpp @@ -51,7 +51,7 @@ EffectInstance::treeRecurseFunctor(bool isRenderFunctor, const InputMatrixMapPtr& reroutesMap, bool useTransforms, // roi functor specific StorageModeEnum renderStorageMode, // if the render of this node is in OpenGL - unsigned int originalMipMapLevel, // roi functor specific + unsigned int originalMipmapLevel, // roi functor specific double time, ViewIdx view, const NodePtr& treeRoot, @@ -232,7 +232,7 @@ EffectInstance::treeRecurseFunctor(bool isRenderFunctor, StatusEnum stat = EffectInstance::getInputsRoIsFunctor(useTransforms, f, viewIt->first, - originalMipMapLevel, + originalMipmapLevel, inputNode, node, treeRoot, @@ -257,16 +257,16 @@ EffectInstance::treeRecurseFunctor(bool isRenderFunctor, frameArgs->request->getFrameViewCanonicalRoI(f, viewIt->first, &roi); } - const unsigned int upstreamMipMapLevel = useScaleOneInputs ? 0 : originalMipMapLevel; - const RenderScale upstreamScale = useScaleOneInputs ? RenderScale::identity : RenderScale::fromMipmapLevel(originalMipMapLevel); - const RectI inputRoIPixelCoords = roi.toPixelEnclosing(upstreamMipMapLevel, inputPar); + const unsigned int upstreamMipmapLevel = useScaleOneInputs ? 0 : originalMipmapLevel; + const RenderScale upstreamScale = useScaleOneInputs ? RenderScale::identity : RenderScale::fromMipmapLevel(originalMipmapLevel); + const RectI inputRoIPixelCoords = roi.toPixelEnclosing(upstreamMipmapLevel, inputPar); std::map inputImgs; { std::unique_ptr renderArgs; renderArgs.reset( new EffectInstance::RenderRoIArgs( f, //< time upstreamScale, //< scale - upstreamMipMapLevel, //< mipmapLevel (redundant with the scale) + upstreamMipmapLevel, //< mipmapLevel (redundant with the scale) viewIt->first, //< view byPassCache, inputRoIPixelCoords, //< roi in pixel coordinates @@ -311,7 +311,7 @@ StatusEnum EffectInstance::getInputsRoIsFunctor(bool useTransforms, double time, ViewIdx view, - unsigned originalMipMapLevel, + unsigned originalMipmapLevel, const NodePtr& node, const NodePtr& /*callerNode*/, const NodePtr& treeRoot, @@ -333,7 +333,7 @@ EffectInstance::getInputsRoIsFunctor(bool useTransforms, assert(effect->supportsRenderScaleMaybe() == EffectInstance::eSupportsNo || effect->supportsRenderScaleMaybe() == EffectInstance::eSupportsYes); bool supportsRs = effect->supportsRenderScale(); - unsigned int mappedLevel = supportsRs ? originalMipMapLevel : 0; + unsigned int mappedLevel = supportsRs ? originalMipmapLevel : 0; FrameRequestMap::iterator foundNode = requests.find(node); if ( foundNode != requests.end() ) { nodeRequest = foundNode->second; @@ -441,7 +441,7 @@ EffectInstance::getInputsRoIsFunctor(bool useTransforms, StatusEnum stat = getInputsRoIsFunctor(useTransforms, fvRequest->globalData.inputIdentityTime, inputView, - originalMipMapLevel, + originalMipmapLevel, node, node, treeRoot, @@ -462,7 +462,7 @@ EffectInstance::getInputsRoIsFunctor(bool useTransforms, StatusEnum stat = getInputsRoIsFunctor(useTransforms, fvRequest->globalData.inputIdentityTime, fvRequest->globalData.identityView, - originalMipMapLevel, + originalMipmapLevel, inputIdentityNode, node, treeRoot, @@ -520,7 +520,7 @@ EffectInstance::getInputsRoIsFunctor(bool useTransforms, fvRequest->globalData.transforms, useTransforms, eStorageModeRAM /*returnStorage*/, - originalMipMapLevel, + originalMipmapLevel, time, view, treeRoot, @@ -539,7 +539,7 @@ EffectInstance::getInputsRoIsFunctor(bool useTransforms, StatusEnum EffectInstance::computeRequestPass(double time, ViewIdx view, - unsigned int mipMapLevel, + unsigned int mipmapLevel, const RectD& renderWindow, const NodePtr& treeRoot, FrameRequestMap& request) @@ -548,7 +548,7 @@ EffectInstance::computeRequestPass(double time, StatusEnum stat = getInputsRoIsFunctor(doTransforms, time, view, - mipMapLevel, + mipmapLevel, treeRoot, treeRoot, treeRoot, diff --git a/Engine/RectD.cpp b/Engine/RectD.cpp index 1a2666123..f6718859c 100644 --- a/Engine/RectD.cpp +++ b/Engine/RectD.cpp @@ -42,10 +42,10 @@ RectD::toPixelEnclosing(const RenderScale& renderScale, } RectI -RectD::toPixelEnclosing(unsigned int mipMapLevel, +RectD::toPixelEnclosing(unsigned int mipmapLevel, double par) const { - const double scale = 1. / (1 << mipMapLevel); + const double scale = 1. / (1 << mipmapLevel); return RectI(std::floor(x1 * scale / par), std::floor(y1 * scale), std::ceil(x2 * scale / par), diff --git a/Engine/RectD.h b/Engine/RectD.h index e33778ea8..2309654c6 100644 --- a/Engine/RectD.h +++ b/Engine/RectD.h @@ -337,7 +337,7 @@ class RectD RectI toPixelEnclosing(const RenderScale & scale, double par) const; - RectI toPixelEnclosing(unsigned int mipMapLevel, + RectI toPixelEnclosing(unsigned int mipmapLevel, double par) const; static void ofxRectDToRectD(const OfxRectD & r, diff --git a/Engine/RectI.cpp b/Engine/RectI.cpp index 27a80e190..406f0ec2f 100644 --- a/Engine/RectI.cpp +++ b/Engine/RectI.cpp @@ -135,7 +135,7 @@ RectI::toCanonical_noClipping(unsigned int thisLevel, } RectI -RectI::toNewMipMapLevel(unsigned int fromLevel, unsigned int toLevel, double par, const RectD& rod) const +RectI::toNewMipmapLevel(unsigned int fromLevel, unsigned int toLevel, double par, const RectD& rod) const { return toCanonical(fromLevel, par, rod).toPixelEnclosing(toLevel, par); } diff --git a/Engine/RectI.h b/Engine/RectI.h index 6220d5a64..6b6fab9c7 100644 --- a/Engine/RectI.h +++ b/Engine/RectI.h @@ -190,7 +190,7 @@ class RectI * @param rod The region of definition to clip this rectangle to when converting it to canonical coordinates. * **/ - RectI toNewMipMapLevel(unsigned int fromLevel, unsigned int toLevel, double par, const RectD& rod) const; + RectI toNewMipmapLevel(unsigned int fromLevel, unsigned int toLevel, double par, const RectD& rod) const; // the following should never be used: only canonical coordinates may be downscaled /** diff --git a/Engine/RenderStats.cpp b/Engine/RenderStats.cpp index 8c34785f9..4f6b77956 100644 --- a/Engine/RenderStats.cpp +++ b/Engine/RenderStats.cpp @@ -207,13 +207,13 @@ NodeRenderStats::getIdentityRectangles() const } void -NodeRenderStats::addMipMapLevelRendered(unsigned int level) +NodeRenderStats::addMipmapLevelRendered(unsigned int level) { _imp->mipmapLevelsAccessed.insert(level); } const std::set& -NodeRenderStats::getMipMapLevelsRendered() const +NodeRenderStats::getMipmapLevelsRendered() const { return _imp->mipmapLevelsAccessed; } @@ -397,7 +397,7 @@ RenderStats::setGlobalRenderInfosForNode(const NodePtr& node, stats.setOutputPremult(outputPremult); stats.setTilesSupported(tilesSupported); stats.setRenderScaleSupported(renderScaleSupported); - stats.addMipMapLevelRendered(mipmapLevel); + stats.addMipmapLevelRendered(mipmapLevel); stats.setChannelsRendered(channelsRendered); stats.setRoD(rod); } diff --git a/Engine/RenderStats.h b/Engine/RenderStats.h index 562eb9a97..57553f091 100644 --- a/Engine/RenderStats.h +++ b/Engine/RenderStats.h @@ -73,8 +73,8 @@ class NodeRenderStats void addIdentityRectangle(const NodePtr& identity, const RectI& rectangle); std::list > getIdentityRectangles() const; - void addMipMapLevelRendered(unsigned int level); - const std::set& getMipMapLevelsRendered() const; + void addMipmapLevelRendered(unsigned int level); + const std::set& getMipmapLevelsRendered() const; void addPlaneRendered(const std::string& plane); const std::set& getPlanesRendered() const; diff --git a/Engine/RotoContext.cpp b/Engine/RotoContext.cpp index 8be90e4fc..d1f850fc4 100644 --- a/Engine/RotoContext.cpp +++ b/Engine/RotoContext.cpp @@ -2546,7 +2546,7 @@ RotoStrokeItem::renderSingleStroke(const RectD& pointsBbox, ImageFieldingOrderEnum fielding = node->getEffectInstance()->getFieldingOrder(); ImagePremultiplicationEnum premult = node->getEffectInstance()->getPremult(); bool copyFromImage = false; - bool mipMapLevelChanged = false; + bool mipmapLevelChanged = false; if (!source) { source.reset( new Image(components, pointsBbox, @@ -2559,11 +2559,11 @@ RotoStrokeItem::renderSingleStroke(const RectD& pointsBbox, false) ); *image = source; } else { - if ( (*image)->getMipMapLevel() > mipmapLevel ) { - mipMapLevelChanged = true; + if ( (*image)->getMipmapLevel() > mipmapLevel ) { + mipmapLevelChanged = true; RectD otherRoD = (*image)->getRoD(); - const RectI oldBounds = otherRoD.toPixelEnclosing( (*image)->getMipMapLevel(), par); + const RectI oldBounds = otherRoD.toPixelEnclosing( (*image)->getMipmapLevel(), par); RectD mergeRoD = pointsBbox; mergeRoD.merge(otherRoD); const RectI mergeBounds = mergeRoD.toPixelEnclosing(mipmapLevel, par); @@ -2579,13 +2579,13 @@ RotoStrokeItem::renderSingleStroke(const RectD& pointsBbox, fielding, false) ); source->fillZero(pixelPointsBbox); - (*image)->upscaleMipMap( oldBounds, (*image)->getMipMapLevel(), source->getMipMapLevel(), source.get() ); + (*image)->upscaleMipmap( oldBounds, (*image)->getMipmapLevel(), source->getMipmapLevel(), source.get() ); *image = source; - } else if ( (*image)->getMipMapLevel() < mipmapLevel ) { - mipMapLevelChanged = true; + } else if ( (*image)->getMipmapLevel() < mipmapLevel ) { + mipmapLevelChanged = true; RectD otherRoD = (*image)->getRoD(); - const RectI oldBounds = otherRoD.toPixelEnclosing( (*image)->getMipMapLevel(), par ); + const RectI oldBounds = otherRoD.toPixelEnclosing( (*image)->getMipmapLevel(), par ); RectD mergeRoD = pointsBbox; mergeRoD.merge(otherRoD); const RectI mergeBounds = mergeRoD.toPixelEnclosing(mipmapLevel, par); @@ -2601,7 +2601,7 @@ RotoStrokeItem::renderSingleStroke(const RectD& pointsBbox, fielding, false) ); source->fillZero(pixelPointsBbox); - (*image)->downscaleMipMap( pointsBbox, oldBounds, (*image)->getMipMapLevel(), source->getMipMapLevel(), false, source.get() ); + (*image)->downscaleMipmap( pointsBbox, oldBounds, (*image)->getMipmapLevel(), source->getMipmapLevel(), false, source.get() ); *image = source; } else { RectD otherRoD = (*image)->getRoD(); @@ -2676,7 +2676,7 @@ RotoStrokeItem::renderSingleStroke(const RectD& pointsBbox, QMutexLocker k(&_imp->strokeDotPatternsMutex); std::vector dotPatterns = getPatternCache(); - if (mipMapLevelChanged) { + if (mipmapLevelChanged) { for (std::size_t i = 0; i < dotPatterns.size(); ++i) { if (dotPatterns[i]) { cairo_pattern_destroy(dotPatterns[i]); diff --git a/Engine/RotoPaint.cpp b/Engine/RotoPaint.cpp index c51e40c8c..61f965861 100644 --- a/Engine/RotoPaint.cpp +++ b/Engine/RotoPaint.cpp @@ -1531,10 +1531,10 @@ RotoPaint::render(const RenderActionArgs& args) copyChannels[i] = _imp->enabledKnobs[i].lock()->getValue(); } - unsigned int mipMapLevel = args.mappedScale.toMipmapLevel(); + unsigned int mipmapLevel = args.mappedScale.toMipmapLevel(); RenderRoIArgs rotoPaintArgs(args.time, args.mappedScale, - mipMapLevel, + mipmapLevel, args.view, args.byPassCache, args.roi, diff --git a/Engine/RotoSmear.cpp b/Engine/RotoSmear.cpp index 400730a88..b6dbc2d89 100644 --- a/Engine/RotoSmear.cpp +++ b/Engine/RotoSmear.cpp @@ -310,7 +310,7 @@ RotoSmear::render(const RenderActionArgs& args) for (std::list >::const_iterator plane = args.outputPlanes.begin(); plane != args.outputPlanes.end(); ++plane) { - assert(plane->second->getMipMapLevel() == mipmapLevel); + assert(plane->second->getMipmapLevel() == mipmapLevel); distToNext = 0.; int nComps = plane->first.getNumComponents(); diff --git a/Engine/RotoStrokeItem.cpp b/Engine/RotoStrokeItem.cpp index dda3ac6a8..12cf842e9 100644 --- a/Engine/RotoStrokeItem.cpp +++ b/Engine/RotoStrokeItem.cpp @@ -122,7 +122,7 @@ evaluateStrokeInternal(const KeyFrameSet& xCurve, const KeyFrameSet& yCurve, const KeyFrameSet& pCurve, const Transform::Matrix3x3& transform, - unsigned int mipMapLevel, + unsigned int mipmapLevel, double halfBrushSize, bool pressureAffectsSize, std::list >* points, @@ -156,7 +156,7 @@ evaluateStrokeInternal(const KeyFrameSet& xCurve, } - int pot = 1 << mipMapLevel; + int pot = 1 << mipmapLevel; if ( (xCurve.size() == 1) && ( xIt != xCurve.end() ) && ( yIt != yCurve.end() ) && ( pIt != pCurve.end() ) ) { assert( xNext == xCurve.end() && yNext == yCurve.end() && pNext == pCurve.end() ); @@ -839,7 +839,7 @@ RotoStrokeItem::getYControlPoints() const } void -RotoStrokeItem::evaluateStroke(unsigned int mipMapLevel, +RotoStrokeItem::evaluateStroke(unsigned int mipmapLevel, double time, std::list > >* strokes, RectD* bbox) const @@ -864,7 +864,7 @@ RotoStrokeItem::evaluateStroke(unsigned int mipMapLevel, std::list > points; RectD strokeBbox; - evaluateStrokeInternal(xSet, ySet, pSet, transform, mipMapLevel, brushSize, pressureAffectsSize, &points, &strokeBbox); + evaluateStrokeInternal(xSet, ySet, pSet, transform, mipmapLevel, brushSize, pressureAffectsSize, &points, &strokeBbox); if (bbox) { if (bboxSet) { bbox->merge(strokeBbox); diff --git a/Engine/RotoStrokeItem.h b/Engine/RotoStrokeItem.h index c7da170f1..b816fe10e 100644 --- a/Engine/RotoStrokeItem.h +++ b/Engine/RotoStrokeItem.h @@ -136,7 +136,7 @@ class RotoStrokeItem ///bbox is in canonical coords - void evaluateStroke(unsigned int mipMapLevel, double time, + void evaluateStroke(unsigned int mipmapLevel, double time, std::list > >* strokes, RectD* bbox = 0) const; diff --git a/Engine/Settings.cpp b/Engine/Settings.cpp index 7435a3e53..02c52afec 100644 --- a/Engine/Settings.cpp +++ b/Engine/Settings.cpp @@ -2491,7 +2491,7 @@ Settings::isAutoProxyEnabled() const } unsigned int -Settings::getAutoProxyMipMapLevel() const +Settings::getAutoProxyMipmapLevel() const { return (unsigned int)_autoProxyLevel->getValue() + 1; } diff --git a/Engine/Settings.h b/Engine/Settings.h index 731ae7b31..61fa7b582 100644 --- a/Engine/Settings.h +++ b/Engine/Settings.h @@ -252,7 +252,7 @@ GCC_DIAG_SUGGEST_OVERRIDE_ON void getCheckerboardColor2(double* r, double* g, double* b, double* a) const; bool isAutoWipeEnabled() const; bool isAutoProxyEnabled() const; - unsigned int getAutoProxyMipMapLevel() const; + unsigned int getAutoProxyMipmapLevel() const; int getMaxOpenedNodesViewerContext() const; bool viewerNumberKeys() const; bool viewerOverlaysPath() const; diff --git a/Engine/TrackerFrameAccessor.cpp b/Engine/TrackerFrameAccessor.cpp index 572682232..3f2b3a633 100644 --- a/Engine/TrackerFrameAccessor.cpp +++ b/Engine/TrackerFrameAccessor.cpp @@ -52,7 +52,7 @@ namespace { struct FrameAccessorCacheKey { int frame; - int mipMapLevel; + unsigned int mipmapLevel; mv::FrameAccessor::InputMode mode; }; @@ -66,9 +66,9 @@ struct CacheKey_compare_less } else if (lhs.frame > rhs.frame) { return false; } else { - if (lhs.mipMapLevel < rhs.mipMapLevel) { + if (lhs.mipmapLevel < rhs.mipmapLevel) { return true; - } else if (lhs.mipMapLevel > rhs.mipMapLevel) { + } else if (lhs.mipmapLevel > rhs.mipmapLevel) { return false; } else { if ( (int)lhs.mode < (int)rhs.mode ) { @@ -292,10 +292,10 @@ TrackerFrameAccessor::GetImage(int /*clip*/, // other case(s) when they get integrated into libmv. assert(input_mode == mv::FrameAccessor::MONO); - + const unsigned int mipmapLevel = static_cast(downscale); FrameAccessorCacheKey key; key.frame = frame; - key.mipMapLevel = downscale; + key.mipmapLevel = mipmapLevel; key.mode = input_mode; /* @@ -335,7 +335,7 @@ TrackerFrameAccessor::GetImage(int /*clip*/, } // Not in accessor cache, call renderRoI - const RenderScale scale = RenderScale::fromMipmapLevel( (unsigned int)downscale ); + const RenderScale scale = RenderScale::fromMipmapLevel(mipmapLevel); RectD precomputedRoD; @@ -346,7 +346,7 @@ TrackerFrameAccessor::GetImage(int /*clip*/, return (mv::FrameAccessor::Key)0; } double par = effect->getAspectRatio(-1); - roi = precomputedRoD.toPixelEnclosing( (unsigned int)downscale, par); + roi = precomputedRoD.toPixelEnclosing(mipmapLevel, par); } std::list components; @@ -374,7 +374,7 @@ TrackerFrameAccessor::GetImage(int /*clip*/, RenderStatsPtr() ); // Stats EffectInstance::RenderRoIArgs args( frame, scale, - downscale, + mipmapLevel, ViewIdx(0), false, roi, diff --git a/Engine/UpdateViewerParams.h b/Engine/UpdateViewerParams.h index 695719879..87a954cb5 100644 --- a/Engine/UpdateViewerParams.h +++ b/Engine/UpdateViewerParams.h @@ -74,7 +74,7 @@ class UpdateViewerParams , gain(1.) , gamma(1.) , offset(0.) - , mipMapLevel(0) + , mipmapLevel(0) , lut(eViewerColorSpaceSRGB) , layer() , alphaLayer() @@ -122,7 +122,7 @@ class UpdateViewerParams double gain; // viewer gain double gamma; // viewer gamma double offset; // viewer offset - unsigned int mipMapLevel; // viewer mipmaplevel + unsigned int mipmapLevel; // viewer mipmaplevel ViewerColorSpaceEnum lut; // the viewer colorspace lut ImagePlaneDesc layer; // the image layer ImagePlaneDesc alphaLayer; // the alpha layer diff --git a/Engine/ViewerInstance.cpp b/Engine/ViewerInstance.cpp index 3296e1431..e8b5b5166 100644 --- a/Engine/ViewerInstance.cpp +++ b/Engine/ViewerInstance.cpp @@ -450,7 +450,7 @@ ViewerInstance::getViewerArgsAndRenderViewer(SequenceTime time, roi.x2 = args[i]->params->textureRect.x2; roi.y2 = args[i]->params->textureRect.y2; } - status[i] = EffectInstance::computeRequestPass(time, view, args[i]->params->mipMapLevel, roi, thisNode, request); + status[i] = EffectInstance::computeRequestPass(time, view, args[i]->params->mipmapLevel, roi, thisNode, request); if (status[i] == eStatusFailed) { continue; }*/ @@ -834,7 +834,7 @@ ViewerInstance::setupMinimalUpdateViewerParams(const SequenceTime time, { QMutexLocker l(&_imp->viewerParamsMutex); - outArgs->mipmapLevelWithoutDraft = (unsigned int)_imp->viewerMipMapLevel; + outArgs->mipmapLevelWithoutDraft = _imp->viewerMipmapLevel; } assert(_imp->uiContext); @@ -851,20 +851,20 @@ ViewerInstance::setupMinimalUpdateViewerParams(const SequenceTime time, if (isFullFrameProcessingEnabled()) { outArgs->mipmapLevelWithoutDraft = 0; } else { - int zoomMipMapLevel; + unsigned int zoomMipmapLevel; { double closestPowerOf2 = zoomFactor >= 1 ? 1 : ipow( 2, (int)-std::ceil(std::log(zoomFactor) / M_LN2) ); - zoomMipMapLevel = std::log(closestPowerOf2) / M_LN2; + zoomMipmapLevel = std::log(closestPowerOf2) / M_LN2; } - outArgs->mipmapLevelWithoutDraft = (unsigned int)std::max( (int)outArgs->mipmapLevelWithoutDraft, (int)zoomMipMapLevel ); + outArgs->mipmapLevelWithoutDraft = std::max(outArgs->mipmapLevelWithoutDraft, zoomMipmapLevel); } - outArgs->mipMapLevelWithDraft = outArgs->mipmapLevelWithoutDraft; + outArgs->mipmapLevelWithDraft = outArgs->mipmapLevelWithoutDraft; outArgs->draftModeEnabled = getApp()->isDraftRenderEnabled(); // If draft mode is enabled, compute the mipmap level according to the auto-proxy setting in the preferences if ( outArgs->draftModeEnabled && appPTR->getCurrentSettings()->isAutoProxyEnabled() ) { - unsigned int autoProxyLevel = appPTR->getCurrentSettings()->getAutoProxyMipMapLevel(); + unsigned int autoProxyLevel = appPTR->getCurrentSettings()->getAutoProxyMipmapLevel(); if (zoomFactor > 1) { //Decrease draft mode at each inverse mipmaplevel level taken unsigned int invLevel = Image::getLevelFromScale(1. / zoomFactor); @@ -874,7 +874,7 @@ ViewerInstance::setupMinimalUpdateViewerParams(const SequenceTime time, autoProxyLevel = 0; } } - outArgs->mipMapLevelWithDraft = (unsigned int)std::max( (int)outArgs->mipmapLevelWithoutDraft, (int)autoProxyLevel ); + outArgs->mipmapLevelWithDraft = std::max(outArgs->mipmapLevelWithoutDraft, autoProxyLevel); } @@ -1059,7 +1059,7 @@ ViewerInstance::getViewerRoIAndTexture(const RectD& rod, outArgs->params->rod = rod; - outArgs->params->mipMapLevel = mipmapLevel; + outArgs->params->mipmapLevel = mipmapLevel; std::string inputToRenderName = outArgs->activeInputToRender->getNode()->getScriptName_mt_safe(); @@ -1156,7 +1156,7 @@ ViewerInstance::getRoDAndLookupCache(const bool useOnlyRoDCache, // zillions of textures in the cache, each a few pixels different. const bool useTextureCache = !outArgs->userRoIEnabled && !outArgs->autoContrast && !rotoPaintNode.get() && !outArgs->isDoingPartialUpdates; - // If it's eSupportsMaybe and mipMapLevel!=0, don't forget to update + // If it's eSupportsMaybe and mipmapLevel!=0, don't forget to update // this after the first call to getRegionOfDefinition(). // This may be eSupportsMaybe EffectInstance::SupportsEnum supportsRS = outArgs->activeInputToRender->supportsRenderScaleMaybe(); @@ -1166,8 +1166,8 @@ ViewerInstance::getRoDAndLookupCache(const bool useOnlyRoDCache, const int nLookups = outArgs->draftModeEnabled ? 2 : 1; for (int lookup = 0; lookup < nLookups; ++lookup) { - const unsigned mipMapLevel = lookup == 0 ? outArgs->mipmapLevelWithoutDraft : outArgs->mipMapLevelWithDraft; - RenderScale scale = RenderScale::fromMipmapLevel(mipMapLevel); + const unsigned mipmapLevel = lookup == 0 ? outArgs->mipmapLevelWithoutDraft : outArgs->mipmapLevelWithDraft; + RenderScale scale = RenderScale::fromMipmapLevel(mipmapLevel); RectD rod; @@ -1201,7 +1201,7 @@ ViewerInstance::getRoDAndLookupCache(const bool useOnlyRoDCache, } // update scale after the first call to getRegionOfDefinition - if ( (supportsRS == eSupportsMaybe) && (mipMapLevel != 0) ) { + if ( (supportsRS == eSupportsMaybe) && (mipmapLevel != 0) ) { supportsRS = (outArgs->activeInputToRender)->supportsRenderScaleMaybe(); } @@ -1212,7 +1212,7 @@ ViewerInstance::getRoDAndLookupCache(const bool useOnlyRoDCache, Q_UNUSED(isRodProjectFormat); // Ok we go the RoD, we can actually compute the RoI and look-up the cache - ViewerRenderRetCode retCode = getViewerRoIAndTexture(rod, viewerHash, useTextureCache, lookup == 1, mipMapLevel, stats, outArgs); + ViewerRenderRetCode retCode = getViewerRoIAndTexture(rod, viewerHash, useTextureCache, lookup == 1, mipmapLevel, stats, outArgs); if (retCode != eViewerRenderRetCodeRender) { return retCode; } @@ -1396,10 +1396,10 @@ ViewerInstance::renderViewer_internal(ViewIdx view, if (useTLS) { - const RectD canonicalRoi = roi.toCanonical(inArgs.params->mipMapLevel, inArgs.params->pixelAspectRatio, inArgs.params->rod); + const RectD canonicalRoi = roi.toCanonical(inArgs.params->mipmapLevel, inArgs.params->pixelAspectRatio, inArgs.params->rod); FrameRequestMap requestPassData; - StatusEnum stat = EffectInstance::computeRequestPass(inArgs.params->time, view, inArgs.params->mipMapLevel, canonicalRoi, getNode(), requestPassData); + StatusEnum stat = EffectInstance::computeRequestPass(inArgs.params->time, view, inArgs.params->mipmapLevel, canonicalRoi, getNode(), requestPassData); if (stat == eStatusFailed) { return eViewerRenderRetCodeFail; } @@ -1495,7 +1495,7 @@ ViewerInstance::renderViewer_internal(ViewIdx view, channelsRendered[3] = true; break; } - stats->setGlobalRenderInfosForNode(getNode(), inArgs.params->rod, inArgs.params->srcPremult, channelsRendered, true, true, inArgs.params->mipMapLevel); + stats->setGlobalRenderInfosForNode(getNode(), inArgs.params->rod, inArgs.params->srcPremult, channelsRendered, true, true, inArgs.params->mipmapLevel); } //#pragma message WARN("Implement Viewer so it accepts OpenGL Textures in input") @@ -1514,8 +1514,8 @@ ViewerInstance::renderViewer_internal(ViewIdx view, { std::unique_ptr renderArgs; renderArgs.reset( new EffectInstance::RenderRoIArgs(inArgs.params->time, - RenderScale::fromMipmapLevel(inArgs.params->mipMapLevel), - inArgs.params->mipMapLevel, + RenderScale::fromMipmapLevel(inArgs.params->mipmapLevel), + inArgs.params->mipmapLevel, view, inArgs.forceRender, splitRoi[rectIndex], @@ -1656,7 +1656,7 @@ ViewerInstance::renderViewer_internal(ViewIdx view, bool canUseOldTex = _imp->lastRenderParams[updateParams->textureIndex] && - updateParams->mipMapLevel == _imp->lastRenderParams[updateParams->textureIndex]->mipMapLevel && + updateParams->mipmapLevel == _imp->lastRenderParams[updateParams->textureIndex]->mipmapLevel && tile.rect.contains(_imp->lastRenderParams[updateParams->textureIndex]->tiles.front().rect); if (!canUseOldTex) { @@ -1668,7 +1668,7 @@ ViewerInstance::renderViewer_internal(ViewIdx view, //Overwrite the RoI to only the last portion rendered RectD lastPaintBbox = getApp()->getLastPaintStrokeBbox(); - lastPaintBboxPixel = lastPaintBbox.toPixelEnclosing(updateParams->mipMapLevel, par); + lastPaintBboxPixel = lastPaintBbox.toPixelEnclosing(updateParams->mipmapLevel, par); //The last buffer must be valid @@ -1718,7 +1718,7 @@ ViewerInstance::renderViewer_internal(ViewIdx view, // For the viewer, we need the enclosing rectangle to avoid black borders. // Do this here to avoid infinity values. - const RectI bounds = updateParams->rod.toPixelEnclosing(updateParams->mipMapLevel, updateParams->pixelAspectRatio); + const RectI bounds = updateParams->rod.toPixelEnclosing(updateParams->mipmapLevel, updateParams->pixelAspectRatio); const RectI tileBounds(0, 0, inArgs.params->tileSize, inArgs.params->tileSize); assert(!tileBounds.isNull()); @@ -1743,7 +1743,7 @@ ViewerInstance::renderViewer_internal(ViewIdx view, inArgs.channels, inArgs.params->view, it->rect, - inArgs.params->mipMapLevel, + inArgs.params->mipmapLevel, inputToRenderName, inArgs.params->layer, inArgs.params->alphaLayer.getPlaneID() + inArgs.params->alphaChannelName, @@ -2924,7 +2924,7 @@ ViewerInstance::ViewerInstancePrivate::updateViewer(UpdateViewerParamsPtr params } } - uiContext->endTransferBufferFromRAMToGPU(params->textureIndex, texture, originalImage, params->time, params->rod, params->pixelAspectRatio, depth, params->mipMapLevel, params->srcPremult, params->gain, params->gamma, params->offset, params->lut, params->recenterViewport, params->viewportCenter, params->isPartialRect); + uiContext->endTransferBufferFromRAMToGPU(params->textureIndex, texture, originalImage, params->time, params->rod, params->pixelAspectRatio, depth, params->mipmapLevel, params->srcPremult, params->gain, params->gamma, params->offset, params->lut, params->recenterViewport, params->viewportCenter, params->isPartialRect); if (!isDrawing) { uiContext->updateColorPicker(params->textureIndex); @@ -3014,25 +3014,17 @@ ViewerInstance::onGainChanged(double exp) } } -unsigned int -ViewerInstance::getViewerMipMapLevel() const -{ - QMutexLocker l(&_imp->viewerParamsMutex); - - return _imp->viewerMipMapLevel; -} - void -ViewerInstance::onMipMapLevelChanged(int level) +ViewerInstance::onMipmapLevelChanged(unsigned int level) { // always running in the main thread assert( qApp && qApp->thread() == QThread::currentThread() ); { QMutexLocker l(&_imp->viewerParamsMutex); - if (_imp->viewerMipMapLevel == (unsigned int)level) { + if (_imp->viewerMipmapLevel == level) { return; } - _imp->viewerMipMapLevel = level; + _imp->viewerMipmapLevel = level; } } @@ -3217,14 +3209,14 @@ ViewerInstance::getGain() const return _imp->viewerParamsGain; } -int -ViewerInstance::getMipMapLevel() const +unsigned int +ViewerInstance::getMipmapLevel() const { // MT-SAFE: called from main thread and Serialization (pooled) thread QMutexLocker l(&_imp->viewerParamsMutex); - return _imp->viewerMipMapLevel; + return _imp->viewerMipmapLevel; } DisplayChannelsEnum @@ -3402,8 +3394,8 @@ ViewerInstance::getTimelineBounds(int* first, } } -int -ViewerInstance::getMipMapLevelFromZoomFactor() const +unsigned int +ViewerInstance::getMipmapLevelFromZoomFactor() const { double zoomFactor = _imp->uiContext->getZoomFactor(); double closestPowerOf2 = zoomFactor >= 1 ? 1 : std::pow( 2, -std::ceil(std::log(zoomFactor) / M_LN2) ); diff --git a/Engine/ViewerInstance.h b/Engine/ViewerInstance.h index 5b3483383..acf6caa7c 100644 --- a/Engine/ViewerInstance.h +++ b/Engine/ViewerInstance.h @@ -50,7 +50,7 @@ class ViewerArgs UpdateViewerParamsPtr params; RenderingFlagSetterPtr isRenderingFlag; bool draftModeEnabled; - unsigned int mipMapLevelWithDraft, mipmapLevelWithoutDraft; + unsigned int mipmapLevelWithDraft, mipmapLevelWithoutDraft; bool autoContrast; DisplayChannelsEnum channels; bool userRoIEnabled; @@ -148,7 +148,7 @@ GCC_DIAG_SUGGEST_OVERRIDE_ON /** - * @brief Get the RoI from the Viewer and lookup the cache for a texture at the given mipMapLevel. + * @brief Get the RoI from the Viewer and lookup the cache for a texture at the given mipmapLevel. * setupMinimalUpdateViewerParams(...) MUST have been called before. * When returning this function, the UpdateViewerParams will have been filled entirely * and if the texture was found in the cache, the shared pointer outArgs->params->cachedFrame will be valid. @@ -231,9 +231,9 @@ GCC_DIAG_SUGGEST_OVERRIDE_ON double getGain() const WARN_UNUSED_RETURN; - int getMipMapLevel() const WARN_UNUSED_RETURN; + unsigned int getMipmapLevel() const WARN_UNUSED_RETURN; - int getMipMapLevelFromZoomFactor() const WARN_UNUSED_RETURN; + unsigned int getMipmapLevelFromZoomFactor() const WARN_UNUSED_RETURN; DisplayChannelsEnum getChannels(int texIndex) const WARN_UNUSED_RETURN; @@ -326,12 +326,10 @@ GCC_DIAG_SUGGEST_OVERRIDE_ON bool isViewerPaused(int texIndex) const; - unsigned int getViewerMipMapLevel() const; - public Q_SLOTS: - void onMipMapLevelChanged(int level); + void onMipmapLevelChanged(unsigned int level); /** diff --git a/Engine/ViewerInstancePrivate.h b/Engine/ViewerInstancePrivate.h index 768fa16e1..7fa3ec0ca 100644 --- a/Engine/ViewerInstancePrivate.h +++ b/Engine/ViewerInstancePrivate.h @@ -140,7 +140,7 @@ GCC_DIAG_SUGGEST_OVERRIDE_ON , viewerParamsLayer( ImagePlaneDesc::getRGBAComponents() ) , viewerParamsAlphaLayer( ImagePlaneDesc::getRGBAComponents() ) , viewerParamsAlphaChannelName("a") - , viewerMipMapLevel(0) + , viewerMipmapLevel(0) , fullFrameProcessingEnabled(false) , activateInputChangedFromViewer(false) , gammaLookupMutex() @@ -387,7 +387,7 @@ public Q_SLOTS: ImagePlaneDesc viewerParamsLayer; ImagePlaneDesc viewerParamsAlphaLayer; std::string viewerParamsAlphaChannelName; - unsigned int viewerMipMapLevel; //< the mipmap level the viewer should render at (0 == no downscaling) + unsigned int viewerMipmapLevel; //< the mipmap level the viewer should render at (0 == no downscaling) bool fullFrameProcessingEnabled; ///Only accessed from MT diff --git a/Gui/CurveWidget.h b/Gui/CurveWidget.h index f6a935c08..084298309 100644 --- a/Gui/CurveWidget.h +++ b/Gui/CurveWidget.h @@ -136,7 +136,6 @@ GCC_DIAG_SUGGEST_OVERRIDE_ON * @brief Returns the colour of the background (i.e: clear color) of the viewport. **/ virtual void getBackgroundColour(double &r, double &g, double &b) const OVERRIDE FINAL; - virtual unsigned int getCurrentRenderScale() const OVERRIDE FINAL { return 0; } virtual RectD getViewportRect() const OVERRIDE FINAL WARN_UNUSED_RETURN; virtual void getCursorPosition(double& x, double& y) const OVERRIDE FINAL; diff --git a/Gui/CustomParamInteract.h b/Gui/CustomParamInteract.h index 4f3c50ab5..c1511c804 100644 --- a/Gui/CustomParamInteract.h +++ b/Gui/CustomParamInteract.h @@ -84,7 +84,6 @@ class CustomParamInteract virtual void getBackgroundColour(double &r, double &g, double &b) const OVERRIDE FINAL; virtual void saveOpenGLContext() OVERRIDE FINAL; virtual void restoreOpenGLContext() OVERRIDE FINAL; - virtual unsigned int getCurrentRenderScale() const OVERRIDE FINAL { return 0; } virtual RectD getViewportRect() const OVERRIDE FINAL WARN_UNUSED_RETURN; virtual void getCursorPosition(double& x, double& y) const OVERRIDE FINAL; diff --git a/Gui/DopeSheetView.cpp b/Gui/DopeSheetView.cpp index ba3e34393..8e40a05df 100644 --- a/Gui/DopeSheetView.cpp +++ b/Gui/DopeSheetView.cpp @@ -2817,17 +2817,6 @@ DopeSheetView::restoreOpenGLContext() running_in_main_thread(); } -/** - * @brief DopeSheetView::getCurrentRenderScale - * - * - */ -unsigned int -DopeSheetView::getCurrentRenderScale() const -{ - return 0; -} - void DopeSheetView::onSelectedAllTriggered() { diff --git a/Gui/DopeSheetView.h b/Gui/DopeSheetView.h index 933255f5b..d6283ac06 100644 --- a/Gui/DopeSheetView.h +++ b/Gui/DopeSheetView.h @@ -137,7 +137,6 @@ GCC_DIAG_SUGGEST_OVERRIDE_ON void getBackgroundColour(double &r, double &g, double &b) const OVERRIDE FINAL; void saveOpenGLContext() OVERRIDE FINAL; void restoreOpenGLContext() OVERRIDE FINAL; - unsigned int getCurrentRenderScale() const OVERRIDE FINAL; virtual RectD getViewportRect() const OVERRIDE FINAL WARN_UNUSED_RETURN; virtual void getCursorPosition(double& x, double& y) const OVERRIDE FINAL; diff --git a/Gui/Histogram.cpp b/Gui/Histogram.cpp index a4271f25c..9c5f713c8 100644 --- a/Gui/Histogram.cpp +++ b/Gui/Histogram.cpp @@ -138,7 +138,7 @@ struct HistogramPrivate , vmin(0) , vmax(0) , binsCount(0) - , mipMapLevel(0) + , mipmapLevel(0) , hasImage(false) #endif , sizeH() @@ -279,7 +279,7 @@ struct HistogramPrivate unsigned int pixelsCount; double vmin, vmax; //< the x range of the histogram unsigned int binsCount; - unsigned int mipMapLevel; + unsigned int mipmapLevel; bool hasImage; #endif // !NATRON_HISTOGRAM_USING_OPENGL @@ -510,20 +510,20 @@ ImagePtr HistogramPrivate::getHistogramImage(RectI* imagePortion) const ImagePtr image; if (viewer) { - image = viewer->getViewer()->getLastRenderedImageByMipMapLevel( textureIndex, viewer->getInternalNode()->getMipMapLevelFromZoomFactor() ); + image = viewer->getViewer()->getLastRenderedImageByMipmapLevel( textureIndex, viewer->getInternalNode()->getMipmapLevelFromZoomFactor() ); } if (!useImageRoD) { if (viewer) { RectI bounds; double par = 1.; - unsigned int mipMapLevel = 0; + unsigned int mipmapLevel = 0; if (image) { bounds = image->getBounds(); par = image->getPixelAspectRatio(); - mipMapLevel = image->getMipMapLevel(); + mipmapLevel = image->getMipmapLevel(); } - *imagePortion = viewer->getViewer()->getImageRectangleDisplayed(bounds, par, mipMapLevel); + *imagePortion = viewer->getViewer()->getImageRectangleDisplayed(bounds, par, mipmapLevel); } } else { if (image) { @@ -1575,7 +1575,7 @@ Histogram::onCPUHistogramComputed() assert( qApp && qApp->thread() == QThread::currentThread() ); int mode; - bool success = _imp->histogramThread.getMostRecentlyProducedHistogram(&_imp->histogram1, &_imp->histogram2, &_imp->histogram3, &_imp->binsCount, &_imp->pixelsCount, &mode, &_imp->vmin, &_imp->vmax, &_imp->mipMapLevel); + bool success = _imp->histogramThread.getMostRecentlyProducedHistogram(&_imp->histogram1, &_imp->histogram2, &_imp->histogram3, &_imp->binsCount, &_imp->pixelsCount, &mode, &_imp->vmin, &_imp->vmax, &_imp->mipmapLevel); assert(success); if (success) { _imp->hasImage = true; @@ -1703,7 +1703,7 @@ HistogramPrivate::drawWarnings() // always running in the main thread assert( qApp && qApp->thread() == QThread::currentThread() ); assert( QOpenGLContext::currentContext() == widget->context() ); - if (mipMapLevel > 0) { + if (mipmapLevel > 0) { QFontMetrics fm(*_textFont); QString str( tr("Image downscaled") ); #if QT_VERSION >= QT_VERSION_CHECK(5, 11, 0) diff --git a/Gui/ProjectGui.cpp b/Gui/ProjectGui.cpp index 1278e9e5f..8640f946b 100644 --- a/Gui/ProjectGui.cpp +++ b/Gui/ProjectGui.cpp @@ -380,7 +380,7 @@ loadNodeGuiSerialization(Gui* gui, tab->setUserRoI(found->second.userRoI); tab->setClipToProject(found->second.isClippedToProject); tab->setRenderScaleActivated(found->second.renderScaleActivated); - tab->setMipMapLevel(found->second.mipMapLevel); + tab->setMipmapLevel(found->second.mipmapLevel); tab->setCompositingOperator( (ViewerCompositingOperatorEnum)found->second.wipeCompositingOp ); tab->setZoomOrPannedSinceLastFit(found->second.zoomOrPanSinceLastFit); tab->setTopToolbarVisible(found->second.topToolbarVisible); diff --git a/Gui/ProjectGuiSerialization.cpp b/Gui/ProjectGuiSerialization.cpp index 2382c8037..f596877cf 100644 --- a/Gui/ProjectGuiSerialization.cpp +++ b/Gui/ProjectGuiSerialization.cpp @@ -103,7 +103,7 @@ ProjectGuiSerialization::initialize(const ProjectGui* projectGui) viewerData.colorSpace = tab->getColorSpace(); viewerData.channels = tab->getChannelsString(); viewerData.renderScaleActivated = tab->getRenderScaleActivated(); - viewerData.mipMapLevel = tab->getMipMapLevel(); + viewerData.mipmapLevel = tab->getMipmapLevel(); viewerData.zoomOrPanSinceLastFit = tab->getZoomOrPannedSinceLastFit(); viewerData.wipeCompositingOp = (int)tab->getCompositingOperator(); viewerData.leftToolbarVisible = tab->isLeftToolbarVisible(); diff --git a/Gui/ProjectGuiSerialization.h b/Gui/ProjectGuiSerialization.h index baabf086b..5354c41ce 100644 --- a/Gui/ProjectGuiSerialization.h +++ b/Gui/ProjectGuiSerialization.h @@ -113,7 +113,7 @@ struct ViewerData double gain; double gamma; bool renderScaleActivated; - int mipMapLevel; + unsigned int mipmapLevel; std::string colorSpace; std::string channels; std::string layerName, alphaLayerName; @@ -164,7 +164,7 @@ struct ViewerData } ar & ::boost::serialization::make_nvp("Channels", channels); ar & ::boost::serialization::make_nvp("RenderScaleActivated", renderScaleActivated); - ar & ::boost::serialization::make_nvp("MipMapLevel", mipMapLevel); + ar & ::boost::serialization::make_nvp("MipMapLevel", mipmapLevel); if (version >= VIEWER_DATA_INTRODUCES_WIPE_COMPOSITING) { ar & ::boost::serialization::make_nvp("ZoomOrPanSinceFit", zoomOrPanSinceLastFit); diff --git a/Gui/PyGuiApp.cpp b/Gui/PyGuiApp.cpp index 5704c1d4e..d5f01a117 100644 --- a/Gui/PyGuiApp.cpp +++ b/Gui/PyGuiApp.cpp @@ -849,7 +849,7 @@ PyViewer::setProxyIndex(int index) if ( !getInternalNode()->isActivated() ) { return; } - _viewer->setMipMapLevel(index + 1); + _viewer->setMipmapLevel(index + 1); } int @@ -859,7 +859,7 @@ PyViewer::getProxyIndex() const return 0; } - return _viewer->getMipMapLevel() - 1; + return _viewer->getMipmapLevel() - 1; } void diff --git a/Gui/RenderStatsDialog.cpp b/Gui/RenderStatsDialog.cpp index 4b6dd58f0..f8901044f 100644 --- a/Gui/RenderStatsDialog.cpp +++ b/Gui/RenderStatsDialog.cpp @@ -321,7 +321,7 @@ class StatsTableModel item->setFlags(Qt::ItemIsSelectable | Qt::ItemIsEnabled); } assert(item); - const std::set& mm = stats.getMipMapLevelsRendered(); + const std::set& mm = stats.getMipmapLevelsRendered(); for (std::set::const_iterator it = mm.begin(); it != mm.end(); ++it) { str.append( QString::number(*it) ); str.append( QLatin1Char(' ') ); diff --git a/Gui/ViewerGL.cpp b/Gui/ViewerGL.cpp index a0b3dfd3b..70ceaba3c 100644 --- a/Gui/ViewerGL.cpp +++ b/Gui/ViewerGL.cpp @@ -404,7 +404,7 @@ ViewerGL::paintGL() case eViewerCompositingOperatorNone: { if (drawTexture[0]) { BlendSetter b(checkerboard ? premultA : eImagePremultiplicationOpaque); - _imp->drawRenderingVAO(_imp->displayTextures[0].mipMapLevel, 0, eDrawPolygonModeWhole, true); + _imp->drawRenderingVAO(_imp->displayTextures[0].mipmapLevel, 0, eDrawPolygonModeWhole, true); } break; } @@ -412,16 +412,16 @@ ViewerGL::paintGL() case eViewerCompositingOperatorStackUnder: { if (drawTexture[0] && !stack) { BlendSetter b(checkerboard ? premultA : eImagePremultiplicationOpaque); - _imp->drawRenderingVAO(_imp->displayTextures[0].mipMapLevel, 0, eDrawPolygonModeWipeLeft, true); + _imp->drawRenderingVAO(_imp->displayTextures[0].mipmapLevel, 0, eDrawPolygonModeWipeLeft, true); } if (drawTexture[0]) { BlendSetter b(premultA); - _imp->drawRenderingVAO(_imp->displayTextures[0].mipMapLevel, 0, stack ? eDrawPolygonModeWhole : eDrawPolygonModeWipeRight, false); + _imp->drawRenderingVAO(_imp->displayTextures[0].mipmapLevel, 0, stack ? eDrawPolygonModeWhole : eDrawPolygonModeWipeRight, false); } if (drawTexture[1]) { glEnable(GL_BLEND); glBlendFunc(GL_CONSTANT_ALPHA, GL_ONE_MINUS_CONSTANT_ALPHA); - _imp->drawRenderingVAO(_imp->displayTextures[1].mipMapLevel, 1, stack ? eDrawPolygonModeWhole : eDrawPolygonModeWipeRight, false); + _imp->drawRenderingVAO(_imp->displayTextures[1].mipmapLevel, 1, stack ? eDrawPolygonModeWhole : eDrawPolygonModeWipeRight, false); glDisable(GL_BLEND); } @@ -431,17 +431,17 @@ ViewerGL::paintGL() case eViewerCompositingOperatorStackOver: { if (drawTexture[0] && !stack) { BlendSetter b(checkerboard ? premultA : eImagePremultiplicationOpaque); - _imp->drawRenderingVAO(_imp->displayTextures[0].mipMapLevel, 0, eDrawPolygonModeWipeLeft, true); + _imp->drawRenderingVAO(_imp->displayTextures[0].mipmapLevel, 0, eDrawPolygonModeWipeLeft, true); } if (drawTexture[1]) { glEnable(GL_BLEND); glBlendFunc(GL_CONSTANT_ALPHA, GL_ONE_MINUS_CONSTANT_ALPHA); - _imp->drawRenderingVAO(_imp->displayTextures[1].mipMapLevel, 1, stack ? eDrawPolygonModeWhole : eDrawPolygonModeWipeRight, false); + _imp->drawRenderingVAO(_imp->displayTextures[1].mipmapLevel, 1, stack ? eDrawPolygonModeWhole : eDrawPolygonModeWipeRight, false); glDisable(GL_BLEND); } if (drawTexture[0]) { BlendSetter b(premultA); - _imp->drawRenderingVAO(_imp->displayTextures[0].mipMapLevel, 0, stack ? eDrawPolygonModeWhole : eDrawPolygonModeWipeRight, false); + _imp->drawRenderingVAO(_imp->displayTextures[0].mipmapLevel, 0, stack ? eDrawPolygonModeWhole : eDrawPolygonModeWipeRight, false); } break; @@ -450,17 +450,17 @@ ViewerGL::paintGL() case eViewerCompositingOperatorStackMinus: { if (drawTexture[0] && !stack) { BlendSetter b(checkerboard ? premultA : eImagePremultiplicationOpaque); - _imp->drawRenderingVAO(_imp->displayTextures[0].mipMapLevel, 0, eDrawPolygonModeWipeLeft, true); + _imp->drawRenderingVAO(_imp->displayTextures[0].mipmapLevel, 0, eDrawPolygonModeWipeLeft, true); } if (drawTexture[0]) { BlendSetter b(premultA); - _imp->drawRenderingVAO(_imp->displayTextures[0].mipMapLevel, 0, stack ? eDrawPolygonModeWhole : eDrawPolygonModeWipeRight, false); + _imp->drawRenderingVAO(_imp->displayTextures[0].mipmapLevel, 0, stack ? eDrawPolygonModeWhole : eDrawPolygonModeWipeRight, false); } if (drawTexture[1]) { glEnable(GL_BLEND); glBlendFunc(GL_CONSTANT_ALPHA, GL_ONE); glBlendEquation(GL_FUNC_REVERSE_SUBTRACT); - _imp->drawRenderingVAO(_imp->displayTextures[1].mipMapLevel, 1, stack ? eDrawPolygonModeWhole : eDrawPolygonModeWipeRight, false); + _imp->drawRenderingVAO(_imp->displayTextures[1].mipmapLevel, 1, stack ? eDrawPolygonModeWhole : eDrawPolygonModeWipeRight, false); glDisable(GL_BLEND); } break; @@ -469,17 +469,17 @@ ViewerGL::paintGL() case eViewerCompositingOperatorStackOnionSkin: { if (drawTexture[0] && !stack) { BlendSetter b(checkerboard ? premultA : eImagePremultiplicationOpaque); - _imp->drawRenderingVAO(_imp->displayTextures[0].mipMapLevel, 0, eDrawPolygonModeWipeLeft, true); + _imp->drawRenderingVAO(_imp->displayTextures[0].mipmapLevel, 0, eDrawPolygonModeWipeLeft, true); } if (drawTexture[0]) { BlendSetter b(premultA); - _imp->drawRenderingVAO(_imp->displayTextures[0].mipMapLevel, 0, stack ? eDrawPolygonModeWhole : eDrawPolygonModeWipeRight, false); + _imp->drawRenderingVAO(_imp->displayTextures[0].mipmapLevel, 0, stack ? eDrawPolygonModeWhole : eDrawPolygonModeWipeRight, false); } if (drawTexture[1]) { glEnable(GL_BLEND); glBlendFunc(GL_CONSTANT_ALPHA, GL_ONE); //glBlendEquation(GL_FUNC_REVERSE_SUBTRACT); - _imp->drawRenderingVAO(_imp->displayTextures[1].mipMapLevel, 1, stack ? eDrawPolygonModeWhole : eDrawPolygonModeWipeRight, false); + _imp->drawRenderingVAO(_imp->displayTextures[1].mipmapLevel, 1, stack ? eDrawPolygonModeWhole : eDrawPolygonModeWipeRight, false); glDisable(GL_BLEND); } break; @@ -490,7 +490,7 @@ ViewerGL::paintGL() const TextureRect &r = _imp->partialUpdateTextures[i].texture->getTextureRect(); RectI texRect(r.x1, r.y1, r.x2, r.y2); const double par = r.par; - const RectD canonicalTexRect = texRect.toCanonical_noClipping(_imp->partialUpdateTextures[i].mipMapLevel, par); + const RectD canonicalTexRect = texRect.toCanonical_noClipping(_imp->partialUpdateTextures[i].mipmapLevel, par); glActiveTexture(GL_TEXTURE0); glBindTexture( GL_TEXTURE_2D, _imp->partialUpdateTextures[i].texture->getTexID() ); @@ -511,7 +511,7 @@ ViewerGL::paintGL() glCheckError(); if (_imp->overlay) { - drawOverlay( getCurrentRenderScale() ); + drawOverlay(getCurrentMipmapLevel()); } else { const QFont& f = font(); QFontMetrics fm(f); @@ -1076,10 +1076,10 @@ ViewerGL::drawPickerPixel(double screenPixelRatio) } QPointF pos = _imp->lastPickerPos; - unsigned int mipMapLevel = getInternalNode()->getMipMapLevel(); + unsigned int mipmapLevel = getInternalNode()->getMipmapLevel(); - if (mipMapLevel != 0) { - pos *= (1 << mipMapLevel); + if (mipmapLevel != 0) { + pos *= (1 << mipmapLevel); } glColor3f(0.9, 0.7, 0.); glPointSize(zoomFactor * screenPixelRatio); @@ -1294,7 +1294,7 @@ ViewerGL::getZoomFactor() const RectI ViewerGL::getImageRectangleDisplayed(const RectI & imageRoDPixel, // in pixel coordinates const double par, - unsigned int mipMapLevel) + unsigned int mipmapLevel) { // MT-SAFE RectD visibleArea; @@ -1312,9 +1312,9 @@ ViewerGL::getImageRectangleDisplayed(const RectI & imageRoDPixel, // in pixel co visibleArea.y1 = bottomRight.y(); } - if (mipMapLevel != 0) { + if (mipmapLevel != 0) { // for the viewer, we need the smallest enclosing rectangle at the mipmap level, in order to avoid black borders - ret = visibleArea.toPixelEnclosing(mipMapLevel, par); + ret = visibleArea.toPixelEnclosing(mipmapLevel, par); } else { ret.x1 = std::floor(visibleArea.x1 / par); ret.x2 = std::ceil(visibleArea.x2 / par); @@ -1337,7 +1337,7 @@ ViewerGL::getImageRectangleDisplayed(const RectI & imageRoDPixel, // in pixel co } if (userRoiEnabled) { ///If the user roi is enabled, we want to render the smallest enclosing rectangle in order to avoid black borders. - const RectI userRoIpixel = userRoI.toPixelEnclosing(mipMapLevel, par); + const RectI userRoIpixel = userRoI.toPixelEnclosing(mipmapLevel, par); ///If the user roi doesn't intersect the actually visible portion on the viewer, return an empty rectangle. ret = ret.intersect(userRoIpixel); @@ -1350,19 +1350,19 @@ RectI ViewerGL::getExactImageRectangleDisplayed(int texIndex, const RectD & rod, const double par, - unsigned int mipMapLevel) + unsigned int mipmapLevel) { bool clipToFormat = isClippingImageToFormat(); const RectD clippedRod = clipToFormat ? rod.intersect(_imp->displayTextures[texIndex].format) : rod; - const RectI bounds = clippedRod.toPixelEnclosing(mipMapLevel, par); - return getImageRectangleDisplayed(bounds, par, mipMapLevel); + const RectI bounds = clippedRod.toPixelEnclosing(mipmapLevel, par); + return getImageRectangleDisplayed(bounds, par, mipmapLevel); } RectI ViewerGL::getImageRectangleDisplayedRoundedToTileSize(int texIndex, const RectD & rod, const double par, - unsigned int mipMapLevel, + unsigned int mipmapLevel, std::vector* tiles, std::vector* tilesRounded, int *viewerTileSize, @@ -1370,8 +1370,8 @@ ViewerGL::getImageRectangleDisplayedRoundedToTileSize(int texIndex, { bool clipToProject = isClippingImageToFormat(); const RectD clippedRod = clipToProject ? rod.intersect(_imp->displayTextures[texIndex].format) : rod; - const RectI bounds = clippedRod.toPixelEnclosing(mipMapLevel, par); - const RectI roi = getImageRectangleDisplayed(bounds, par, mipMapLevel); + const RectI bounds = clippedRod.toPixelEnclosing(mipmapLevel, par); + const RectI roi = getImageRectangleDisplayed(bounds, par, mipmapLevel); ////Texrect is the coordinates of the 4 corners of the texture in the bounds with the current zoom ////factor taken into account. @@ -1508,7 +1508,7 @@ ViewerGL::endTransferBufferFromRAMToGPU(int textureIndex, const RectD& rod, double par, ImageBitDepthEnum depth, - unsigned int mipMapLevel, + unsigned int mipmapLevel, ImagePremultiplicationEnum premult, double gain, double gamma, @@ -1531,7 +1531,7 @@ ViewerGL::endTransferBufferFromRAMToGPU(int textureIndex, info.gain = gain; info.gamma = gamma; info.offset = offset; - info.mipMapLevel = mipMapLevel; + info.mipmapLevel = mipmapLevel; info.premult = premult; info.time = time; info.memoryHeldByLastRenderedImages = 0; @@ -1547,7 +1547,7 @@ ViewerGL::endTransferBufferFromRAMToGPU(int textureIndex, _imp->displayTextures[textureIndex].gain = gain; _imp->displayTextures[textureIndex].gamma = gamma; _imp->displayTextures[textureIndex].offset = offset; - _imp->displayTextures[textureIndex].mipMapLevel = mipMapLevel; + _imp->displayTextures[textureIndex].mipmapLevel = mipmapLevel; _imp->displayingImageLut = (ViewerColorSpaceEnum)lut; _imp->displayTextures[textureIndex].premult = premult; _imp->displayTextures[textureIndex].time = time; @@ -1562,7 +1562,7 @@ ViewerGL::endTransferBufferFromRAMToGPU(int textureIndex, _imp->viewerTab->setImageFormat(textureIndex, image->getComponents(), depth); { QMutexLocker k(&_imp->lastRenderedImageMutex); - _imp->displayTextures[textureIndex].lastRenderedTiles[mipMapLevel] = image; + _imp->displayTextures[textureIndex].lastRenderedTiles[mipmapLevel] = image; } _imp->displayTextures[textureIndex].memoryHeldByLastRenderedImages = 0; _imp->displayTextures[textureIndex].memoryHeldByLastRenderedImages += image->size(); @@ -1570,7 +1570,7 @@ ViewerGL::endTransferBufferFromRAMToGPU(int textureIndex, internalNode->registerPluginMemory(_imp->displayTextures[textureIndex].memoryHeldByLastRenderedImages); Q_EMIT imageChanged(textureIndex, true); } else { - if ( !_imp->displayTextures[textureIndex].lastRenderedTiles[mipMapLevel] ) { + if ( !_imp->displayTextures[textureIndex].lastRenderedTiles[mipmapLevel] ) { Q_EMIT imageChanged(textureIndex, false); } else { Q_EMIT imageChanged(textureIndex, true); @@ -1880,7 +1880,7 @@ ViewerGL::mousePressEvent(QMouseEvent* e) if (!overlaysCaught && (_imp->ms == eMouseStateUndefined) && _imp->overlay) { - overlaysCaught = _imp->viewerTab->notifyOverlaysPenDown( RenderScale::fromMipmapLevel(getCurrentRenderScale()), _imp->pointerTypeOnPress, QMouseEventLocalPos(e), zoomPos, _imp->pressureOnPress, currentTimeForEvent(e) ); + overlaysCaught = _imp->viewerTab->notifyOverlaysPenDown(RenderScale::fromMipmapLevel(getCurrentMipmapLevel()), _imp->pointerTypeOnPress, QMouseEventLocalPos(e), zoomPos, _imp->pressureOnPress, currentTimeForEvent(e)); if (overlaysCaught) { mustRedraw = true; } @@ -2080,7 +2080,7 @@ ViewerGL::mouseReleaseEvent(QMouseEvent* e) QMutexLocker l(&_imp->zoomCtxMutex); zoomPos = _imp->zoomCtx.toZoomCoordinates( e->x(), e->y() ); } - if ( _imp->viewerTab->notifyOverlaysPenUp(RenderScale::fromMipmapLevel(getCurrentRenderScale()), QMouseEventLocalPos(e), zoomPos, currentTimeForEvent(e), _imp->pressureOnRelease) ) { + if ( _imp->viewerTab->notifyOverlaysPenUp(RenderScale::fromMipmapLevel(getCurrentMipmapLevel()), QMouseEventLocalPos(e), zoomPos, currentTimeForEvent(e), _imp->pressureOnRelease) ) { mustRedraw = true; } if (mustRedraw) { @@ -2504,7 +2504,7 @@ ViewerGL::penMotionInternal(int x, default: { QPointF localPos(x, y); if ( _imp->overlay && - _imp->viewerTab->notifyOverlaysPenMotion(RenderScale::fromMipmapLevel(getCurrentRenderScale()), localPos, zoomPos, pressure, timestamp) ) { + _imp->viewerTab->notifyOverlaysPenMotion(RenderScale::fromMipmapLevel(getCurrentMipmapLevel()), localPos, zoomPos, pressure, timestamp)) { mustRedraw = true; overlaysCaughtByPlugin = true; } @@ -2537,7 +2537,7 @@ ViewerGL::mouseDoubleClickEvent(QMouseEvent* e) QMutexLocker l(&_imp->zoomCtxMutex); pos_opengl = _imp->zoomCtx.toZoomCoordinates( e->x(), e->y() ); } - if ( _imp->viewerTab->notifyOverlaysPenDoubleClick(RenderScale::fromMipmapLevel(getCurrentRenderScale()), QMouseEventLocalPos(e), pos_opengl) ) { + if ( _imp->viewerTab->notifyOverlaysPenDoubleClick(RenderScale::fromMipmapLevel(getCurrentMipmapLevel()), QMouseEventLocalPos(e), pos_opengl) ) { update(); } QOpenGLWidget::mouseDoubleClickEvent(e); @@ -2712,13 +2712,13 @@ bool ViewerGL::checkIfViewPortRoIValidOrRenderForInput(int texIndex) { - unsigned int mipMapLevel = (unsigned int)std::max((int)getInternalNode()->getMipMapLevelFromZoomFactor(), (int)getInternalNode()->getViewerMipMapLevel()); - int closestPo2 = 1 << mipMapLevel; + unsigned int mipmapLevel = std::max(getInternalNode()->getMipmapLevelFromZoomFactor(), getInternalNode()->getMipmapLevel()); + int closestPo2 = 1 << mipmapLevel; if (closestPo2 != _imp->displayTextures[texIndex].texture->getTextureRect().closestPo2) { return false; } RectI roiNotRounded; - RectI roi = getImageRectangleDisplayedRoundedToTileSize(texIndex, _imp->displayTextures[texIndex].rod, _imp->displayTextures[texIndex].texture->getTextureRect().par, mipMapLevel, 0, 0, 0, &roiNotRounded); + RectI roi = getImageRectangleDisplayedRoundedToTileSize(texIndex, _imp->displayTextures[texIndex].rod, _imp->displayTextures[texIndex].texture->getTextureRect().par, mipmapLevel, 0, 0, 0, &roiNotRounded); const RectI& currentTexRoi = _imp->displayTextures[texIndex].texture->getTextureRect(); if (!currentTexRoi.contains(roi)) { return false; @@ -2805,7 +2805,7 @@ ViewerGL::wheelEvent(QWheelEvent* e) gui->selectNode(nodeGui); double zoomFactor; - unsigned int oldMipMapLevel, newMipMapLevel; + unsigned int oldMipmapLevel, newMipmapLevel; #if QT_VERSION >= QT_VERSION_CHECK(5, 0, 0) double scaleFactor = std::pow( NATRON_WHEEL_ZOOM_PER_DELTA, e->angleDelta().y() ); #else @@ -2820,14 +2820,14 @@ ViewerGL::wheelEvent(QWheelEvent* e) #endif zoomFactor = _imp->zoomCtx.factor(); - //oldMipMapLevel = std::log( zoomFactor >= 1 ? 1 : ipow( 2, -std::ceil(std::log(zoomFactor) / M_LN2) ) ) / M_LN2; - oldMipMapLevel = zoomFactor >= 1 ? 0 : -std::ceil(std::log(zoomFactor) / M_LN2); + //oldMipmapLevel = std::log( zoomFactor >= 1 ? 1 : ipow( 2, -std::ceil(std::log(zoomFactor) / M_LN2) ) ) / M_LN2; + oldMipmapLevel = zoomFactor >= 1 ? 0 : -std::ceil(std::log(zoomFactor) / M_LN2); _imp->zoomCtx.zoom(zoomCenter.x(), zoomCenter.y(), scaleFactor); zoomFactor = _imp->zoomCtx.factor(); } - //newMipMapLevel = std::log( zoomFactor >= 1 ? 1 : std::pow( 2, -std::ceil(std::log(zoomFactor) / M_LN2) ) ) / M_LN2; - newMipMapLevel = zoomFactor >= 1 ? 0 : -std::ceil(std::log(zoomFactor) / M_LN2); + //newMipmapLevel = std::log( zoomFactor >= 1 ? 1 : std::pow( 2, -std::ceil(std::log(zoomFactor) / M_LN2) ) ) / M_LN2; + newMipmapLevel = zoomFactor >= 1 ? 0 : -std::ceil(std::log(zoomFactor) / M_LN2); _imp->zoomOrPannedSinceLastFit = true; int zoomValue = (int)(100 * zoomFactor); if (zoomValue == 0) { @@ -2845,7 +2845,7 @@ ViewerGL::wheelEvent(QWheelEvent* e) ///Clear green cached line so the user doesn't expect to see things in the cache ///since we're changing the zoom factor - if (oldMipMapLevel != newMipMapLevel) { + if (oldMipmapLevel != newMipmapLevel) { _imp->viewerTab->clearTimelineCacheLine(); } update(); @@ -2865,15 +2865,15 @@ ViewerGL::zoomSlot(int v) assert(v > 0); double newZoomFactor = v / 100.; - unsigned int oldMipMapLevel, newMipMapLevel; - //newMipMapLevel = std::log( newZoomFactor >= 1 ? 1 : + unsigned int oldMipmapLevel, newMipmapLevel; + //newMipmapLevel = std::log( newZoomFactor >= 1 ? 1 : // std::pow( 2, -std::ceil(std::log(newZoomFactor) / M_LN2) ) ) / M_LN2; - newMipMapLevel = newZoomFactor >= 1 ? 0 : -std::ceil(std::log(newZoomFactor) / M_LN2); + newMipmapLevel = newZoomFactor >= 1 ? 0 : -std::ceil(std::log(newZoomFactor) / M_LN2); { QMutexLocker l(&_imp->zoomCtxMutex); - //oldMipMapLevel = std::log( _imp->zoomCtx.factor() >= 1 ? 1 : + //oldMipmapLevel = std::log( _imp->zoomCtx.factor() >= 1 ? 1 : // std::pow( 2, -std::ceil(std::log( _imp->zoomCtx.factor() ) / M_LN2) ) ) / M_LN2; - oldMipMapLevel = _imp->zoomCtx.factor() >= 1 ? 0 : -std::ceil(std::log( _imp->zoomCtx.factor() ) / M_LN2); + oldMipmapLevel = _imp->zoomCtx.factor() >= 1 ? 0 : -std::ceil(std::log( _imp->zoomCtx.factor() ) / M_LN2); double scale = newZoomFactor / _imp->zoomCtx.factor(); double centerX = ( _imp->zoomCtx.left() + _imp->zoomCtx.right() ) / 2.; double centerY = ( _imp->zoomCtx.top() + _imp->zoomCtx.bottom() ) / 2.; @@ -2882,7 +2882,7 @@ ViewerGL::zoomSlot(int v) } ///Clear green cached line so the user doesn't expect to see things in the cache ///since we're changing the zoom factor - if (newMipMapLevel != oldMipMapLevel) { + if (newMipmapLevel != oldMipmapLevel) { _imp->viewerTab->clearTimelineCacheLine(); } @@ -2909,13 +2909,13 @@ ViewerGL::fitImageToFormat() double old_zoomFactor; double zoomFactor; - unsigned int oldMipMapLevel, newMipMapLevel; + unsigned int oldMipmapLevel, newMipmapLevel; { QMutexLocker(&_imp->zoomCtxMutex); old_zoomFactor = _imp->zoomCtx.factor(); - //oldMipMapLevel = std::log( old_zoomFactor >= 1 ? 1 : + //oldMipmapLevel = std::log( old_zoomFactor >= 1 ? 1 : // std::pow( 2, -std::ceil(std::log(old_zoomFactor) / M_LN2) ) ) / M_LN2; - oldMipMapLevel = old_zoomFactor >= 1 ? 0 : -std::ceil(std::log(old_zoomFactor) / M_LN2); + oldMipmapLevel = old_zoomFactor >= 1 ? 0 : -std::ceil(std::log(old_zoomFactor) / M_LN2); // set the PAR first //_imp->zoomCtx.setZoom(0., 0., 1., 1.); @@ -2924,9 +2924,9 @@ ViewerGL::fitImageToFormat() zoomFactor = _imp->zoomCtx.factor(); } _imp->zoomOrPannedSinceLastFit = false; - //newMipMapLevel = std::log( zoomFactor >= 1 ? 1 : + //newMipmapLevel = std::log( zoomFactor >= 1 ? 1 : // std::pow( 2, -std::ceil(std::log(zoomFactor) / M_LN2) ) ) / M_LN2; - newMipMapLevel = zoomFactor >= 1 ? 0 : -std::ceil(std::log(zoomFactor) / M_LN2); + newMipmapLevel = zoomFactor >= 1 ? 0 : -std::ceil(std::log(zoomFactor) / M_LN2); _imp->oldClick = QPoint(); // reset mouse posn @@ -2942,7 +2942,7 @@ ViewerGL::fitImageToFormat() _imp->viewerTab->synchronizeOtherViewersProjection(); } - if (newMipMapLevel != oldMipMapLevel) { + if (newMipmapLevel != oldMipmapLevel) { ///Clear green cached line so the user doesn't expect to see things in the cache ///since we're changing the zoom factor _imp->viewerTab->clearTimelineCacheLine(); @@ -3129,7 +3129,7 @@ ViewerGL::focusInEvent(QFocusEvent* e) if ( !_imp->viewerTab->getGui() ) { return; } - if ( _imp->viewerTab->notifyOverlaysFocusGained( RenderScale::fromMipmapLevel(getCurrentRenderScale()) ) ) { + if ( _imp->viewerTab->notifyOverlaysFocusGained(RenderScale::fromMipmapLevel(getCurrentMipmapLevel())) ) { update(); } QOpenGLWidget::focusInEvent(e); @@ -3145,7 +3145,7 @@ ViewerGL::focusOutEvent(QFocusEvent* e) return; } - if ( _imp->viewerTab->notifyOverlaysFocusLost( RenderScale::fromMipmapLevel(getCurrentRenderScale()) ) ) { + if ( _imp->viewerTab->notifyOverlaysFocusLost(RenderScale::fromMipmapLevel(getCurrentMipmapLevel())) ) { update(); } QOpenGLWidget::focusOutEvent(e); @@ -4187,8 +4187,8 @@ ViewerGL::getLastRenderedImage(int textureIndex) const } ImagePtr -ViewerGL::getLastRenderedImageByMipMapLevel(int textureIndex, - unsigned int mipMapLevel) const +ViewerGL::getLastRenderedImageByMipmapLevel(int textureIndex, + unsigned int mipmapLevel) const { // always running in the main thread assert( qApp && qApp->thread() == QThread::currentThread() ); @@ -4198,16 +4198,16 @@ ViewerGL::getLastRenderedImageByMipMapLevel(int textureIndex, } QMutexLocker l(&_imp->lastRenderedImageMutex); - assert(_imp->displayTextures[textureIndex].lastRenderedTiles.size() > mipMapLevel); + assert(_imp->displayTextures[textureIndex].lastRenderedTiles.size() > mipmapLevel); - ImagePtr mipmap = _imp->displayTextures[textureIndex].lastRenderedTiles[mipMapLevel]; + ImagePtr mipmap = _imp->displayTextures[textureIndex].lastRenderedTiles[mipmapLevel]; if (mipmap) { return mipmap; } //Find an image at higher scale - if (mipMapLevel > 0) { - for (int i = (int)mipMapLevel - 1; i >= 0; --i) { + if (mipmapLevel > 0) { + for (int i = (int)mipmapLevel - 1; i >= 0; --i) { mipmap = _imp->displayTextures[textureIndex].lastRenderedTiles[i]; if (mipmap) { return mipmap; @@ -4216,7 +4216,7 @@ ViewerGL::getLastRenderedImageByMipMapLevel(int textureIndex, } //Find an image at lower scale - for (U32 i = mipMapLevel + 1; i < _imp->displayTextures[textureIndex].lastRenderedTiles.size(); ++i) { + for (U32 i = mipmapLevel + 1; i < _imp->displayTextures[textureIndex].lastRenderedTiles.size(); ++i) { mipmap = _imp->displayTextures[textureIndex].lastRenderedTiles[i]; if (mipmap) { return mipmap; @@ -4229,13 +4229,13 @@ ViewerGL::getLastRenderedImageByMipMapLevel(int textureIndex, #ifndef M_LN2 #define M_LN2 0.693147180559945309417232121458176568 /* loge(2) */ #endif -int -ViewerGL::getMipMapLevelCombinedToZoomFactor() const +unsigned int +ViewerGL::getMipmapLevelCombinedToZoomFactor() const { if (!getInternalNode()) { return 0; } - int mmLvl = getInternalNode()->getMipMapLevel(); + unsigned int mmLvl = getInternalNode()->getMipmapLevel(); double factor = getZoomFactor(); if (factor > 1) { @@ -4247,9 +4247,9 @@ ViewerGL::getMipMapLevelCombinedToZoomFactor() const } unsigned int -ViewerGL::getCurrentRenderScale() const +ViewerGL::getCurrentMipmapLevel() const { - return getMipMapLevelCombinedToZoomFactor(); + return getMipmapLevelCombinedToZoomFactor(); } template @@ -4339,8 +4339,8 @@ ViewerGL::getColorAt(double x, assert(textureIndex == 0 || textureIndex == 1); - unsigned int mipMapLevel = (unsigned int)getMipMapLevelCombinedToZoomFactor(); - ImagePtr image = getLastRenderedImageByMipMapLevel(textureIndex, mipMapLevel); + unsigned int mipmapLevel = (unsigned int)getMipmapLevelCombinedToZoomFactor(); + ImagePtr image = getLastRenderedImageByMipmapLevel(textureIndex, mipmapLevel); if (!image) { @@ -4382,7 +4382,7 @@ ViewerGL::getColorAt(double x, } const double par = image->getPixelAspectRatio(); - double scale = 1. / ( 1 << image->getMipMapLevel() ); + double scale = 1. / ( 1 << image->getMipmapLevel() ); ///Convert to pixel coords int xPixel = std::floor(x * scale / par); @@ -4417,7 +4417,7 @@ ViewerGL::getColorAt(double x, gotval = false; break; } - *imgMmlevel = image->getMipMapLevel(); + *imgMmlevel = image->getMipmapLevel(); return gotval; } // getColorAt @@ -4437,20 +4437,20 @@ ViewerGL::getColorAtRect(const RectD &rect, // rectangle in canonical coordinate assert(r && g && b && a); assert(textureIndex == 0 || textureIndex == 1); - unsigned int mipMapLevel = (unsigned int)getMipMapLevelCombinedToZoomFactor(); - ImagePtr image = getLastRenderedImageByMipMapLevel(textureIndex, mipMapLevel); + unsigned int mipmapLevel = (unsigned int)getMipmapLevelCombinedToZoomFactor(); + ImagePtr image = getLastRenderedImageByMipmapLevel(textureIndex, mipmapLevel); if (image) { - mipMapLevel = image->getMipMapLevel(); - *imgMm = mipMapLevel; + mipmapLevel = image->getMipmapLevel(); + *imgMm = mipmapLevel; } ///Convert to pixel coords RectI rectPixel; - rectPixel.x1 = int( std::floor( rect.left() ) ) >> mipMapLevel; - rectPixel.y1 = int( std::floor( rect.bottom() ) ) >> mipMapLevel; - rectPixel.x2 = int( std::floor( rect.right() ) ) >> mipMapLevel; - rectPixel.y2 = int( std::floor( rect.top() ) ) >> mipMapLevel; + rectPixel.x1 = int( std::floor( rect.left() ) ) >> mipmapLevel; + rectPixel.y1 = int( std::floor( rect.bottom() ) ) >> mipmapLevel; + rectPixel.x2 = int( std::floor( rect.right() ) ) >> mipmapLevel; + rectPixel.y2 = int( std::floor( rect.top() ) ) >> mipmapLevel; assert( rect.bottom() <= rect.top() && rect.left() <= rect.right() ); assert( rectPixel.y1 <= rectPixel.y2 && rectPixel.x1 <= rectPixel.x2 ); double rSum = 0.; diff --git a/Gui/ViewerGL.h b/Gui/ViewerGL.h index 374d88435..1dc11c04d 100644 --- a/Gui/ViewerGL.h +++ b/Gui/ViewerGL.h @@ -128,9 +128,9 @@ GCC_DIAG_SUGGEST_OVERRIDE_ON /** * @brief Returns the rectangle of the image displayed by the viewer **/ - virtual RectI getImageRectangleDisplayed(const RectI & imageRoD, const double par, unsigned int mipMapLevel) OVERRIDE FINAL; - virtual RectI getExactImageRectangleDisplayed(int texIndex, const RectD & rod, const double par, unsigned int mipMapLevel) OVERRIDE FINAL; - virtual RectI getImageRectangleDisplayedRoundedToTileSize(int texIndex, const RectD & rod, const double par, unsigned int mipMapLevel, std::vector* tiles, std::vector* tilesRounded, int *tileSize, RectI* roiNotRounded) OVERRIDE FINAL WARN_UNUSED_RETURN; + virtual RectI getImageRectangleDisplayed(const RectI & imageRoD, const double par, unsigned int mipmapLevel) OVERRIDE FINAL; + virtual RectI getExactImageRectangleDisplayed(int texIndex, const RectD & rod, const double par, unsigned int mipmapLevel) OVERRIDE FINAL; + virtual RectI getImageRectangleDisplayedRoundedToTileSize(int texIndex, const RectD & rod, const double par, unsigned int mipmapLevel, std::vector* tiles, std::vector* tilesRounded, int *tileSize, RectI* roiNotRounded) OVERRIDE FINAL WARN_UNUSED_RETURN; /** *@brief Set the pointer to the InfoViewerWidget. This is called once after creation * of the ViewerGL. @@ -181,7 +181,7 @@ GCC_DIAG_SUGGEST_OVERRIDE_ON const RectD& rod, double par, ImageBitDepthEnum depth, - unsigned int mipMapLevel, + unsigned int mipmapLevel, ImagePremultiplicationEnum premult, double gain, double gamma, @@ -426,7 +426,7 @@ public Q_SLOTS: **/ ImagePtr getLastRenderedImage(int textureIndex) const; - ImagePtr getLastRenderedImageByMipMapLevel(int textureIndex, unsigned int mipMapLevel) const; + ImagePtr getLastRenderedImageByMipmapLevel(int textureIndex, unsigned int mipmapLevel) const; /** * @brief Get the color of the currently displayed image at position x,y. @@ -437,17 +437,17 @@ public Q_SLOTS: * @return true if the point is inside the image and colors were set **/ bool getColorAt(double x, double y, bool forceLinear, int textureIndex, float* r, - float* g, float* b, float* a, unsigned int* mipMapLevel) WARN_UNUSED_RETURN; + float* g, float* b, float* a, unsigned int* mipmapLevel) WARN_UNUSED_RETURN; // same as getColor, but computes the mean over a given rectangle bool getColorAtRect(const RectD &rect, // rectangle in canonical coordinates - bool forceLinear, int textureIndex, float* r, float* g, float* b, float* a, unsigned int* mipMapLevel); + bool forceLinear, int textureIndex, float* r, float* g, float* b, float* a, unsigned int* mipmapLevel); - virtual unsigned int getCurrentRenderScale() const OVERRIDE FINAL; + virtual unsigned int getCurrentMipmapLevel() const OVERRIDE FINAL; - ///same as getMipMapLevel but with the zoomFactor taken into account - int getMipMapLevelCombinedToZoomFactor() const WARN_UNUSED_RETURN; + ///same as getMipmapLevel but with the zoomFactor taken into account + unsigned int getMipmapLevelCombinedToZoomFactor() const WARN_UNUSED_RETURN; virtual int getCurrentlyDisplayedTime() const OVERRIDE FINAL WARN_UNUSED_RETURN; @@ -562,7 +562,7 @@ public Q_SLOTS: /** *@brief Called inside paintGL(). It will draw all the overlays. **/ - void drawOverlay(unsigned int mipMapLevel); + void drawOverlay(unsigned int mipmapLevel); /** * @brief Called by drawOverlay to draw the user region of interest. diff --git a/Gui/ViewerGLPrivate.cpp b/Gui/ViewerGLPrivate.cpp index 6ec3d5b9a..94ca0709b 100644 --- a/Gui/ViewerGLPrivate.cpp +++ b/Gui/ViewerGLPrivate.cpp @@ -230,7 +230,7 @@ static const GLubyte triangleStrip[28] = { // |/ |/ |/ | // 12--13--14--15 void -ViewerGL::Implementation::drawRenderingVAO(unsigned int mipMapLevel, +ViewerGL::Implementation::drawRenderingVAO(unsigned int mipmapLevel, int textureIndex, ViewerGL::DrawPolygonModeEnum polygonMode, bool background) @@ -250,8 +250,8 @@ ViewerGL::Implementation::drawRenderingVAO(unsigned int mipMapLevel, ///This is the coordinates in the image being rendered where datas are valid, this is in pixel coordinates ///at the time we initialize it but we will convert it later to canonical coordinates. See 1) const double par = roiRounded.par; - const RectD canonicalRoIRoundedToTileSize = roiRounded.toCanonical_noClipping(mipMapLevel, par); - const RectD canonicalRoINotRounded = roiNotRounded.toCanonical_noClipping(mipMapLevel, par); + const RectD canonicalRoIRoundedToTileSize = roiRounded.toCanonical_noClipping(mipmapLevel, par); + const RectD canonicalRoINotRounded = roiNotRounded.toCanonical_noClipping(mipmapLevel, par); ///the RoD of the image in canonical coords. RectD rod = _this->getRoD(textureIndex); diff --git a/Gui/ViewerGLPrivate.h b/Gui/ViewerGLPrivate.h index 4acf4e9cb..5e034df35 100644 --- a/Gui/ViewerGLPrivate.h +++ b/Gui/ViewerGLPrivate.h @@ -109,7 +109,7 @@ struct TextureInfo , gain(1.) , gamma(1.) , offset(0.) - , mipMapLevel(0) + , mipmapLevel(0) , premult(eImagePremultiplicationOpaque) , time(0) , rod() @@ -127,7 +127,7 @@ struct TextureInfo double gain; double gamma; double offset; - unsigned int mipMapLevel; + unsigned int mipmapLevel; ImagePremultiplicationEnum premult; SequenceTime time; RectD rod; @@ -240,7 +240,7 @@ struct ViewerGL::Implementation *@brief Fill the rendering VAO with vertices and texture coordinates * that depends upon the currently displayed texture. **/ - void drawRenderingVAO(unsigned int mipMapLevel, int textureIndex, DrawPolygonModeEnum polygonMode, bool background); + void drawRenderingVAO(unsigned int mipmapLevel, int textureIndex, DrawPolygonModeEnum polygonMode, bool background); void initializeGL(); diff --git a/Gui/ViewerTab.h b/Gui/ViewerTab.h index da50aff7c..d6480031d 100644 --- a/Gui/ViewerTab.h +++ b/Gui/ViewerTab.h @@ -162,9 +162,9 @@ GCC_DIAG_SUGGEST_OVERRIDE_ON void setAutoContrastEnabled(bool b); - void setMipMapLevel(int level); + void setMipmapLevel(unsigned int level); - int getMipMapLevel() const; + unsigned int getMipmapLevel() const; void setRenderScaleActivated(bool act); diff --git a/Gui/ViewerTab10.cpp b/Gui/ViewerTab10.cpp index 6139b3879..4a6b15328 100644 --- a/Gui/ViewerTab10.cpp +++ b/Gui/ViewerTab10.cpp @@ -618,10 +618,10 @@ ViewerTab::keyPressEvent(QKeyEvent* e) Qt::KeyboardModifiers modifiers = e->modifiers(); Qt::Key key = (Qt::Key)Gui::handleNativeKeys( e->key(), e->nativeScanCode(), e->nativeVirtualKey() ); - const unsigned int mipMapLevel = _imp->viewer->getCurrentRenderScale(); - if ( e->isAutoRepeat() && notifyOverlaysKeyRepeat(RenderScale::fromMipmapLevel(mipMapLevel), e) ) { + const unsigned int mipmapLevel = _imp->viewer->getCurrentMipmapLevel(); + if ( e->isAutoRepeat() && notifyOverlaysKeyRepeat(RenderScale::fromMipmapLevel(mipmapLevel), e) ) { update(); - } else if ( notifyOverlaysKeyDown(RenderScale::fromMipmapLevel(mipMapLevel), e) ) { + } else if ( notifyOverlaysKeyDown(RenderScale::fromMipmapLevel(mipmapLevel), e) ) { update(); } else if ( isKeybind(kShortcutGroupViewer, kShortcutIDActionLuminance, modifiers, key) ) { int currentIndex = _imp->viewerChannels->activeIndex(); @@ -901,8 +901,8 @@ ViewerTab::keyReleaseEvent(QKeyEvent* e) if ( !getGui() ) { return QWidget::keyPressEvent(e); } - const unsigned int mipMapLevel = _imp->viewer->getCurrentRenderScale(); - if ( notifyOverlaysKeyUp(RenderScale::fromMipmapLevel(mipMapLevel), e) ) { + const unsigned int mipmapLevel = _imp->viewer->getCurrentMipmapLevel(); + if ( notifyOverlaysKeyUp(RenderScale::fromMipmapLevel(mipmapLevel), e) ) { _imp->viewer->redraw(); } else { handleUnCaughtKeyUpEvent(e); diff --git a/Gui/ViewerTab30.cpp b/Gui/ViewerTab30.cpp index f60c6a4bc..7e3d9c0a1 100644 --- a/Gui/ViewerTab30.cpp +++ b/Gui/ViewerTab30.cpp @@ -194,20 +194,20 @@ ViewerTab::getGamma() const } void -ViewerTab::setMipMapLevel(int level) +ViewerTab::setMipmapLevel(unsigned int level) { if (level > 0) { _imp->renderScaleCombo->setCurrentIndex(level - 1); } - _imp->viewerNode->onMipMapLevelChanged(level); + _imp->viewerNode->onMipmapLevelChanged(level); _imp->viewer->checkIfViewPortRoIValidOrRender(); } -int -ViewerTab::getMipMapLevel() const +unsigned int +ViewerTab::getMipmapLevel() const { - return _imp->viewerNode->getMipMapLevel(); + return _imp->viewerNode->getMipmapLevel(); } void @@ -219,7 +219,7 @@ ViewerTab::setRenderScaleActivated(bool act) bool ViewerTab::getRenderScaleActivated() const { - return _imp->viewerNode->getMipMapLevel() != 0; + return _imp->viewerNode->getMipmapLevel() != 0; } void @@ -327,14 +327,14 @@ ViewerTab::onAutoContrastChanged(bool b) void ViewerTab::onRenderScaleComboIndexChanged(int index) { - int level; + unsigned int level; if (_imp->renderScaleActive) { level = index + 1; } else { level = 0; } - _imp->viewerNode->onMipMapLevelChanged(level); + _imp->viewerNode->onMipmapLevelChanged(level); _imp->viewer->checkIfViewPortRoIValidOrRender(); } From ff1243c546f8abbf24b936142d81e22b0a2fab92 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20Devernay?= Date: Wed, 20 Sep 2023 19:23:54 +0200 Subject: [PATCH 03/31] build: fix python embedded zip versions --- tools/MacPorts/graphics/openimageio18/work | 1 - tools/jenkins/build-OSX-installer.sh | 1 + tools/jenkins/common.sh | 4 +++- tools/jenkins/zip-python.sh | 8 ++++++-- 4 files changed, 10 insertions(+), 4 deletions(-) delete mode 120000 tools/MacPorts/graphics/openimageio18/work diff --git a/tools/MacPorts/graphics/openimageio18/work b/tools/MacPorts/graphics/openimageio18/work deleted file mode 120000 index 9399d5abf..000000000 --- a/tools/MacPorts/graphics/openimageio18/work +++ /dev/null @@ -1 +0,0 @@ -/Volumes/opt/local-libc++/var/macports/build/_Volumes_opt_MacPorts-Natron_graphics_openimageio/openimageio/work \ No newline at end of file diff --git a/tools/jenkins/build-OSX-installer.sh b/tools/jenkins/build-OSX-installer.sh index e9d6d1e99..d95490f7b 100755 --- a/tools/jenkins/build-OSX-installer.sh +++ b/tools/jenkins/build-OSX-installer.sh @@ -42,6 +42,7 @@ updateBuildOptions echo "*** macOS version:" macosx=$(uname -r | sed 's|\([0-9][0-9]*\)\.[0-9][0-9]*\.[0-9][0-9]*|\1|') case "${macosx}" in +23) echo "macOS 14.x Sonoma";; 22) echo "macOS 13.x Ventura";; 21) echo "macOS 12.x Monterey";; 20) echo "macOS 11.x Big Sur";; diff --git a/tools/jenkins/common.sh b/tools/jenkins/common.sh index f85973f75..496c3ef9b 100644 --- a/tools/jenkins/common.sh +++ b/tools/jenkins/common.sh @@ -380,7 +380,9 @@ else OSMESA_PATH="$SDK_HOME/osmesa" fi -if [ -d "$SDK_HOME/llvm" ]; then +if [ -n "${LLVM_PREFIX:-}" ]; then + LLVM_PATH="${LLVM_PREFIX}" +elif [ -d "$SDK_HOME/llvm" ]; then LLVM_PATH="$SDK_HOME/llvm" elif [ -d "/opt/llvm" ]; then LLVM_PATH="/opt/llvm" diff --git a/tools/jenkins/zip-python.sh b/tools/jenkins/zip-python.sh index 74edf4943..906f0f683 100755 --- a/tools/jenkins/zip-python.sh +++ b/tools/jenkins/zip-python.sh @@ -14,10 +14,14 @@ if [ "$PYV" = 3 ]; then mv site-packages lib-dynload config-${PYVER}-* _sysconfigdata*.py* .. cd .. PYVERFULL="$(python3 -c "import platform; print('.'.join(platform.python_version_tuple()))")" - if [ "$PYVERFULL" = 3.9.14 ] || [ "$PYVERFULL" = 3.9.15 ]; then - # 3.9.14 and 3.9.15 don't have embedded zips + if [ "$PYVER" = 3.9 ] && version_gt "$PYVERFULL" 3.9.13; then + # 3.9.14 and later don't have embedded zips PYVERFULL=3.9.13 fi + if [ "$PYVER" = 3.10 ] && version_gt "$PYVERFULL" 3.10.11; then + # 3.10.12 and later don't have embedded zips + PYVERFULL=3.10.11 + fi wget "https://www.python.org/ftp/python/${PYVERFULL}/python-${PYVERFULL}-embed-amd64.zip" unzip "python-${PYVERFULL}-embed-amd64.zip" "python${PYVERNODOT}.zip" rm "python-${PYVERFULL}-embed-amd64.zip" From 0912a53308c5fee2660565092e1e8d90625a5bfa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20Devernay?= Date: Wed, 20 Sep 2023 21:24:34 +0200 Subject: [PATCH 04/31] MacPorts update --- tools/MacPorts/graphics/ImageMagick/Portfile | 2 +- .../graphics/ImageMagick/Portfile.orig | 2 +- tools/MacPorts/graphics/openimageio/Portfile | 8 +- .../graphics/openimageio/Portfile.orig | 4 +- .../graphics/openimageio/Portfile.patch | 52 +++++------ tools/MacPorts/net/curl/Portfile | 15 ++-- tools/MacPorts/net/curl/Portfile.orig | 15 ++-- tools/MacPorts/net/curl/files/configure.patch | 6 +- .../net/curl/files/patch-sonoma.patch | 20 +++++ tools/MacPorts/print/ghostscript/Portfile | 89 ++++++++++--------- .../MacPorts/print/ghostscript/Portfile.orig | 89 ++++++++++--------- .../files/patch-base_unixinst.mak.diff | 34 ++++--- 12 files changed, 190 insertions(+), 146 deletions(-) create mode 100644 tools/MacPorts/net/curl/files/patch-sonoma.patch diff --git a/tools/MacPorts/graphics/ImageMagick/Portfile b/tools/MacPorts/graphics/ImageMagick/Portfile index 4fcfe2d9c..3ba8f860a 100644 --- a/tools/MacPorts/graphics/ImageMagick/Portfile +++ b/tools/MacPorts/graphics/ImageMagick/Portfile @@ -13,7 +13,7 @@ name ImageMagick # 6.9.11-61 changes the major version of libMagickCore which will # require increasing the revision of all ports that link with it. version 6.9.11-60 -revision 10 +revision 11 checksums rmd160 1c293ba06fd43833be35efb4476e559bf137ccef \ sha256 ba0fa683b0721d1f22b0ccb364e4092e9a7a34ffd3bd6348c82b50fd93b1d7ba \ size 9167220 diff --git a/tools/MacPorts/graphics/ImageMagick/Portfile.orig b/tools/MacPorts/graphics/ImageMagick/Portfile.orig index 2659c6888..2ec061881 100644 --- a/tools/MacPorts/graphics/ImageMagick/Portfile.orig +++ b/tools/MacPorts/graphics/ImageMagick/Portfile.orig @@ -12,7 +12,7 @@ name ImageMagick # 6.9.11-61 changes the major version of libMagickCore which will # require increasing the revision of all ports that link with it. version 6.9.11-60 -revision 10 +revision 11 checksums rmd160 1c293ba06fd43833be35efb4476e559bf137ccef \ sha256 ba0fa683b0721d1f22b0ccb364e4092e9a7a34ffd3bd6348c82b50fd93b1d7ba \ size 9167220 diff --git a/tools/MacPorts/graphics/openimageio/Portfile b/tools/MacPorts/graphics/openimageio/Portfile index c999f44d4..4f0a05e8b 100644 --- a/tools/MacPorts/graphics/openimageio/Portfile +++ b/tools/MacPorts/graphics/openimageio/Portfile @@ -16,11 +16,11 @@ long_description OpenImageIO is a library for reading and writing images, related classes, utilities, and applications. platforms darwin -github.setup OpenImageIO oiio 2.4.14.0 v +github.setup OpenImageIO oiio 2.4.15.0 v revision 100 -checksums rmd160 f0c51d041627f1867b3de2b322edaef21ba8ca0e \ - sha256 92ad4b107394b273397baa1abe90207e1f8ef9fd52ffbfc23b46e3b0005d4439 \ - size 47890322 +checksums rmd160 31292919a0cb4f9fb4ee92d08add97349280874a \ + sha256 b2d76e3880d25d3b005f7c694811a991ccebb6e396965959d194f79c369ff390 \ + size 47894535 github.tarball_from archive diff --git a/tools/MacPorts/graphics/openimageio/Portfile.orig b/tools/MacPorts/graphics/openimageio/Portfile.orig index a1266c038..5685a8b99 100644 --- a/tools/MacPorts/graphics/openimageio/Portfile.orig +++ b/tools/MacPorts/graphics/openimageio/Portfile.orig @@ -26,13 +26,13 @@ if {${os.platform} eq "darwin" && ${os.major} >= 20} { if {${port_latest}} { github.setup OpenImageIO oiio 2.4.5.0 v - revision 7 + revision 8 checksums rmd160 32b2b0f0b01268a91fc98cfca948a71e89d8e54b \ sha256 21177a9665021a99123885cd8383116d15013b6610b4b09bcf209612423fedc5 \ size 31938357 } else { github.setup OpenImageIO oiio 2.1.20.0 v - revision 12 + revision 13 checksums rmd160 d10c488b93ab2335d53545d8a1b35ba4c1babb98 \ sha256 75222543286d3a12473aa03fdb4e6c9f98760c5ad1ad89d3cf82a5da41385ae0 \ size 29115990 diff --git a/tools/MacPorts/graphics/openimageio/Portfile.patch b/tools/MacPorts/graphics/openimageio/Portfile.patch index d3699d10d..42a46c5d8 100644 --- a/tools/MacPorts/graphics/openimageio/Portfile.patch +++ b/tools/MacPorts/graphics/openimageio/Portfile.patch @@ -1,5 +1,5 @@ ---- Portfile.orig 2023-08-10 19:07:00.000000000 +0200 -+++ Portfile 2023-08-10 19:51:16.000000000 +0200 +--- Portfile.orig 2023-09-20 19:26:42 ++++ Portfile 2023-09-20 21:23:35 @@ -2,7 +2,6 @@ PortSystem 1.0 @@ -8,7 +8,7 @@ PortGroup cmake 1.1 PortGroup active_variants 1.1 PortGroup compiler_blacklist_versions 1.0 -@@ -15,50 +14,24 @@ +@@ -15,51 +14,25 @@ description a library for reading and writing images long_description OpenImageIO is a library for reading and writing images, and a bunch of \ related classes, utilities, and applications. @@ -21,58 +21,59 @@ -} else { - set port_latest no -} -- ++github.setup OpenImageIO oiio 2.4.15.0 v ++revision 100 ++checksums rmd160 31292919a0cb4f9fb4ee92d08add97349280874a \ ++ sha256 b2d76e3880d25d3b005f7c694811a991ccebb6e396965959d194f79c369ff390 \ ++ size 47894535 + -if {${port_latest}} { - github.setup OpenImageIO oiio 2.4.5.0 v -- revision 7 +- revision 8 - checksums rmd160 32b2b0f0b01268a91fc98cfca948a71e89d8e54b \ - sha256 21177a9665021a99123885cd8383116d15013b6610b4b09bcf209612423fedc5 \ - size 31938357 -} else { - github.setup OpenImageIO oiio 2.1.20.0 v -- revision 12 +- revision 13 - checksums rmd160 d10c488b93ab2335d53545d8a1b35ba4c1babb98 \ - sha256 75222543286d3a12473aa03fdb4e6c9f98760c5ad1ad89d3cf82a5da41385ae0 \ - size 29115990 - - livecheck.type none -} -+github.setup OpenImageIO oiio 2.4.14.0 v -+revision 100 -+checksums rmd160 f0c51d041627f1867b3de2b322edaef21ba8ca0e \ -+ sha256 92ad4b107394b273397baa1abe90207e1f8ef9fd52ffbfc23b46e3b0005d4439 \ -+ size 47890322 - +- github.tarball_from archive -if {${port_latest}} { - patchfiles-append patch-enforce-clang14.diff - patchfiles-append patch-2.4.5-cmake-disable-wall-werror.diff -- ++depends_lib-append port:imath \ ++ port:openexr + - depends_lib-append port:imath \ - port:openexr -} else { - patchfiles-append patch-FindOpenJpeg.cmake.diff - patchfiles-append patch-libraw-0.21.0.diff - patchfiles-append patch-2.1.20-cmake-disable-wall-werror.diff -- -- depends_lib-append port:field3d \ -- port:openexr2 -+depends_lib-append port:imath \ -+ port:openexr - -- configure.pkg_config_path-prepend \ -- ${prefix}/libexec/openexr2/lib/pkgconfig --} +patchfiles-append oiio-2.0.8-invalidatespec.patch +patchfiles-append oiio-2.0.8-atomic-load.patch +patchfiles-append oiio-2.3.20-strnlen.patch +patchfiles-append oiio-2.4.6-sysutil.patch +patchfiles-append oiio-2.4.6-filesystem.patch +- depends_lib-append port:field3d \ +- port:openexr2 +- +- configure.pkg_config_path-prepend \ +- ${prefix}/libexec/openexr2/lib/pkgconfig +-} +- # error: multiple overloads of 'address' instantiate to the same signature 'const_pointer (const_reference) const noexcept' # http://lists.llvm.org/pipermail/llvm-bugs/2013-November/031552.html -@@ -101,11 +74,78 @@ + # Seen on OSX 10.9 and older. +@@ -101,12 +74,79 @@ port:squish \ port:${port_libfmt} @@ -146,14 +147,15 @@ -# -DUSE_QT=OFF -qt5.min_version 5.6 +default_variants +opencolorio +openjpeg +freetype -+ + +variant natron conflicts ffmpeg qt5 dicom openvdb ptex dicom requires opencolorio openjpeg freetype description {Natron version} { + if {${configure.cxx_stdlib} eq "libstdc++"} { + } +} - ++ configure.args-append -DUSE_PYTHON=OFF + set pythons_suffixes {27 36 37 38 39 310 311} @@ -147,26 +187,46 @@ } diff --git a/tools/MacPorts/net/curl/Portfile b/tools/MacPorts/net/curl/Portfile index 126b707d8..0df4d7ffd 100644 --- a/tools/MacPorts/net/curl/Portfile +++ b/tools/MacPorts/net/curl/Portfile @@ -6,10 +6,10 @@ PortGroup clang_dependency 1.0 # Increase the revision of p5-www-curl whenever the version of curl gets updated. name curl -version 8.2.1 -checksums rmd160 b8486b2903708f892bdff05a4f9a593c776a3ec6 \ - sha256 dd322f6bd0a20e6cebdfd388f69e98c3d183bed792cf4713c8a7ef498cba4894 \ - size 2631932 +version 8.3.0 +checksums rmd160 f5f0aa07f0783cc331fb86c50249037d3524e33f \ + sha256 376d627767d6c4f05105ab6d497b0d9aba7111770dd9d995225478209c37ea63 \ + size 2641764 categories net www platforms darwin freebsd @@ -46,7 +46,12 @@ if {${name} eq ${subport}} { port:zstd patchfiles configure.patch - patchfiles-append SCDynamicStoreCopyProxies.patch + + # see https://github.com/curl/curl/issues/11893 + if {${os.platform} eq "darwin" && ${os.major} >= 23} { + incr revision + patchfiles-append patch-sonoma.patch + } configure.args --disable-silent-rules \ --enable-ipv6 \ diff --git a/tools/MacPorts/net/curl/Portfile.orig b/tools/MacPorts/net/curl/Portfile.orig index 76ee022c9..0ee35533f 100644 --- a/tools/MacPorts/net/curl/Portfile.orig +++ b/tools/MacPorts/net/curl/Portfile.orig @@ -6,10 +6,10 @@ PortGroup clang_dependency 1.0 # Increase the revision of p5-www-curl whenever the version of curl gets updated. name curl -version 8.2.1 -checksums rmd160 b8486b2903708f892bdff05a4f9a593c776a3ec6 \ - sha256 dd322f6bd0a20e6cebdfd388f69e98c3d183bed792cf4713c8a7ef498cba4894 \ - size 2631932 +version 8.3.0 +checksums rmd160 f5f0aa07f0783cc331fb86c50249037d3524e33f \ + sha256 376d627767d6c4f05105ab6d497b0d9aba7111770dd9d995225478209c37ea63 \ + size 2641764 categories net www platforms darwin freebsd @@ -46,7 +46,12 @@ if {${name} eq ${subport}} { port:zstd patchfiles configure.patch - patchfiles-append SCDynamicStoreCopyProxies.patch + + # see https://github.com/curl/curl/issues/11893 + if {${os.platform} eq "darwin" && ${os.major} >= 23} { + incr revision + patchfiles-append patch-sonoma.patch + } configure.args --disable-silent-rules \ --enable-ipv6 \ diff --git a/tools/MacPorts/net/curl/files/configure.patch b/tools/MacPorts/net/curl/files/configure.patch index 03887d25a..53ce8a7d2 100644 --- a/tools/MacPorts/net/curl/files/configure.patch +++ b/tools/MacPorts/net/curl/files/configure.patch @@ -1,8 +1,8 @@ Prevent curl-config from telling curl's dependents that they have to link with all of curl's dependencies as well. ---- configure.orig 2023-07-23 16:00:43.000000000 -0500 -+++ configure 2023-07-27 00:52:12.000000000 -0500 -@@ -14497,7 +14497,7 @@ +--- configure.orig 2023-09-13 08:41:45 ++++ configure 2023-09-13 08:42:48 +@@ -14479,7 +14479,7 @@ else whole_archive_flag_spec='' fi diff --git a/tools/MacPorts/net/curl/files/patch-sonoma.patch b/tools/MacPorts/net/curl/files/patch-sonoma.patch new file mode 100644 index 000000000..5e0381da2 --- /dev/null +++ b/tools/MacPorts/net/curl/files/patch-sonoma.patch @@ -0,0 +1,20 @@ +--- configure ++++ configure +@@ -21732,7 +21732,7 @@ rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + if test "x$build_for_macos" != xno; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 + printf "%s\n" "yes" >&6; } +- LDFLAGS="$LDFLAGS -framework CoreFoundation -framework SystemConfiguration" ++ LDFLAGS="$LDFLAGS -framework CoreFoundation -framework CoreServices -framework SystemConfiguration" + else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 + printf "%s\n" "no" >&6; } +@@ -26234,7 +26234,7 @@ printf "%s\n" "#define USE_SECTRANSP 1" >>confdefs.h + ssl_msg="Secure Transport" + test secure-transport != "$DEFAULT_SSL_BACKEND" || VALID_DEFAULT_SSL_BACKEND=yes + SECURETRANSPORT_ENABLED=1 +- LDFLAGS="$LDFLAGS -framework CoreFoundation -framework Security" ++ LDFLAGS="$LDFLAGS -framework CoreFoundation -framework CoreServices -framework Security" + else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 + printf "%s\n" "no" >&6; } diff --git a/tools/MacPorts/print/ghostscript/Portfile b/tools/MacPorts/print/ghostscript/Portfile index 7f8f64cfa..5056d763e 100644 --- a/tools/MacPorts/print/ghostscript/Portfile +++ b/tools/MacPorts/print/ghostscript/Portfile @@ -4,8 +4,9 @@ PortSystem 1.0 PortGroup muniversal 1.0 name ghostscript -version 10.01.2 -revision 1 +version 10.02.0 +revision 0 + categories print license AGPL-3 BSD maintainers nomaintainer @@ -13,8 +14,8 @@ description GPL Ghostscript, An interpreter for PostScript and PDF long_description Ghostscript is the well-known PostScript interpreter which \ is available for all common and most esoteric platforms and \ supports many different printers and some displays. - homepage https://www.ghostscript.com/ + master_sites https://github.com/ArtifexSoftware/ghostpdl-downloads/releases/download/gs[strsed ${version} {g/\.//}]:source \ sourceforge:project/gs-fonts/gs-fonts/6.0%20%28misc%2C%20AFPL%29/:otherfonts \ sourceforge:project/gs-fonts/gs-fonts/8.11%20%28base%2035%2C%20GPL%29/:stdfonts \ @@ -32,15 +33,10 @@ distfiles ${distname}.tar.gz:source \ ghostscript-fonts-std-8.11.tar.gz:stdfonts \ ${mappingresources_commit}.zip:misc -patchfiles patch-base_unix-dll.mak.diff \ - patch-base_unixinst.mak.diff \ - patch-base_gspaint.diff \ - patch-psi_imainarg.c.diff - checksums ${distname}.tar.gz \ - rmd160 1a21460fb6ec98858a723cd6570a1b98e9f2124a \ - sha256 ee76cb526f5b6683e2adcb65398a1f333f7972289cec960b67aaa227c0d72e88 \ - size 96848797 \ + rmd160 4b09840d7f2c029d807d4bf9f730d2364b87ba74 \ + sha256 15662eb7cc0aba5ef260ba83e40bb062a04c96c78ef717c80e8f983ebab3cce9 \ + size 98136363 \ ghostscript-fonts-other-6.0.tar.gz \ rmd160 ab60dbf71e7d91283a106c3df381cadfe173082f \ sha256 4fa051e341167008d37fe34c19d241060cd17b13909932cd7ca7fe759243c2de \ @@ -54,27 +50,6 @@ checksums ${distname}.tar.gz \ sha256 e3971985977cee4b75f6b49f6e43842d3b699c4255d010adb82796073e98fbfe \ size 1601563 -depends_lib port:fontconfig \ - port:freetype \ - port:jbig2dec \ - path:include/turbojpeg.h:libjpeg-turbo \ - port:libiconv \ - port:libidn \ - port:libpaper \ - port:libpng \ - port:openjpeg \ - port:tiff \ - port:zlib \ - port:lcms2 - -depends_build port:pkgconfig - -# tell ghostscript it's OK to use the system pkg-config even when cross-compiling -# see https://trac.macports.org/ticket/66627 -configure.env-append PKGCONFIG=${prefix}/bin/pkg-config - -depends_run port:perl5 - extract.only ${distname}.tar.gz \ ghostscript-fonts-other-6.0.tar.gz \ ghostscript-fonts-std-8.11.tar.gz @@ -95,9 +70,14 @@ post-extract { copy -force {*}[glob ${workpath}/mapping-resources-pdf-${mappingresources_commit}/pdf2other/*] ${worksrcpath}/Resource/CMap } +patchfiles-append patch-base_unix-dll.mak.diff +patchfiles-append patch-base_unixinst.mak.diff + post-patch { - reinplace s|__PREFIX__|${prefix}| ${worksrcpath}/base/unix-dll.mak - reinplace s|ZLIBDIR=src|ZLIBDIR=${prefix}/include| ${worksrcpath}/configure.ac + reinplace "s|__PREFIX__|${prefix}|" \ + ${worksrcpath}/base/unix-dll.mak + reinplace "s|ZLIBDIR=src|ZLIBDIR=${prefix}/include|" \ + ${worksrcpath}/configure.ac # Ensure that MacPorts perl is used everywhere fs-traverse f ${worksrcpath} { @@ -107,28 +87,55 @@ post-patch { } } -# https://trac.macports.org/ticket/56137 -configure.ldflags-prepend \ - -Lsobin +depends_build-append \ + port:pkgconfig + +depends_lib-append \ + port:fontconfig \ + port:freetype \ + port:jbig2dec \ + port:lcms2 \ + port:libiconv \ + port:libidn \ + path:include/turbojpeg.h:libjpeg-turbo \ + port:libpaper \ + port:libpng \ + port:openjpeg \ + port:tiff \ + port:zlib + +depends_run-append \ + port:perl5 use_autoreconf yes autoreconf.args -fv configure.checks.implicit_function_declaration.whitelist-append strchr +# tell ghostscript it's OK to use the system pkg-config even when cross-compiling +# see https://trac.macports.org/ticket/66627 +configure.env-append \ + PKGCONFIG=${prefix}/bin/pkg-config + +# https://trac.macports.org/ticket/56137 +configure.ldflags-prepend \ + -Lsobin + # Make included OpenJPEG uses its own headers rather than the system ones configure.cppflags-replace \ -I${prefix}/include \ -isystem${prefix}/include -configure.args --disable-compile-inits \ +configure.args-append \ + --disable-compile-inits \ --disable-cups \ --disable-dbus \ --disable-gtk \ - --without-pcl \ - --without-xps \ + --with-system-libtiff \ --without-gpdl \ + --without-pcl \ + --without-tesseract \ --without-x \ - --with-system-libtiff + --without-xps build.target so diff --git a/tools/MacPorts/print/ghostscript/Portfile.orig b/tools/MacPorts/print/ghostscript/Portfile.orig index 958d860d9..4218c76ce 100644 --- a/tools/MacPorts/print/ghostscript/Portfile.orig +++ b/tools/MacPorts/print/ghostscript/Portfile.orig @@ -4,8 +4,9 @@ PortSystem 1.0 PortGroup muniversal 1.0 name ghostscript -version 10.01.2 -revision 1 +version 10.02.0 +revision 0 + categories print license AGPL-3 BSD maintainers nomaintainer @@ -13,8 +14,8 @@ description GPL Ghostscript, An interpreter for PostScript and PDF long_description Ghostscript is the well-known PostScript interpreter which \ is available for all common and most esoteric platforms and \ supports many different printers and some displays. - homepage https://www.ghostscript.com/ + master_sites https://github.com/ArtifexSoftware/ghostpdl-downloads/releases/download/gs[strsed ${version} {g/\.//}]:source \ sourceforge:project/gs-fonts/gs-fonts/6.0%20%28misc%2C%20AFPL%29/:otherfonts \ sourceforge:project/gs-fonts/gs-fonts/8.11%20%28base%2035%2C%20GPL%29/:stdfonts \ @@ -32,15 +33,10 @@ distfiles ${distname}.tar.gz:source \ ghostscript-fonts-std-8.11.tar.gz:stdfonts \ ${mappingresources_commit}.zip:misc -patchfiles patch-base_unix-dll.mak.diff \ - patch-base_unixinst.mak.diff \ - patch-base_gspaint.diff \ - patch-psi_imainarg.c.diff - checksums ${distname}.tar.gz \ - rmd160 1a21460fb6ec98858a723cd6570a1b98e9f2124a \ - sha256 ee76cb526f5b6683e2adcb65398a1f333f7972289cec960b67aaa227c0d72e88 \ - size 96848797 \ + rmd160 4b09840d7f2c029d807d4bf9f730d2364b87ba74 \ + sha256 15662eb7cc0aba5ef260ba83e40bb062a04c96c78ef717c80e8f983ebab3cce9 \ + size 98136363 \ ghostscript-fonts-other-6.0.tar.gz \ rmd160 ab60dbf71e7d91283a106c3df381cadfe173082f \ sha256 4fa051e341167008d37fe34c19d241060cd17b13909932cd7ca7fe759243c2de \ @@ -54,27 +50,6 @@ checksums ${distname}.tar.gz \ sha256 e3971985977cee4b75f6b49f6e43842d3b699c4255d010adb82796073e98fbfe \ size 1601563 -depends_lib port:fontconfig \ - port:freetype \ - port:jbig2dec \ - path:include/turbojpeg.h:libjpeg-turbo \ - port:libiconv \ - port:libidn \ - port:libpaper \ - port:libpng \ - port:openjpeg \ - port:tiff \ - port:zlib \ - port:lcms2 - -depends_build port:pkgconfig - -# tell ghostscript it's OK to use the system pkg-config even when cross-compiling -# see https://trac.macports.org/ticket/66627 -configure.env-append PKGCONFIG=${prefix}/bin/pkg-config - -depends_run port:perl5 - extract.only ${distname}.tar.gz \ ghostscript-fonts-other-6.0.tar.gz \ ghostscript-fonts-std-8.11.tar.gz @@ -95,9 +70,14 @@ post-extract { copy -force {*}[glob ${workpath}/mapping-resources-pdf-${mappingresources_commit}/pdf2other/*] ${worksrcpath}/Resource/CMap } +patchfiles-append patch-base_unix-dll.mak.diff +patchfiles-append patch-base_unixinst.mak.diff + post-patch { - reinplace s|__PREFIX__|${prefix}| ${worksrcpath}/base/unix-dll.mak - reinplace s|ZLIBDIR=src|ZLIBDIR=${prefix}/include| ${worksrcpath}/configure.ac + reinplace "s|__PREFIX__|${prefix}|" \ + ${worksrcpath}/base/unix-dll.mak + reinplace "s|ZLIBDIR=src|ZLIBDIR=${prefix}/include|" \ + ${worksrcpath}/configure.ac # Ensure that MacPorts perl is used everywhere fs-traverse f ${worksrcpath} { @@ -107,28 +87,55 @@ post-patch { } } -# https://trac.macports.org/ticket/56137 -configure.ldflags-prepend \ - -Lsobin +depends_build-append \ + port:pkgconfig + +depends_lib-append \ + port:fontconfig \ + port:freetype \ + port:jbig2dec \ + port:lcms2 \ + port:libiconv \ + port:libidn \ + path:include/turbojpeg.h:libjpeg-turbo \ + port:libpaper \ + port:libpng \ + port:openjpeg \ + port:tiff \ + port:zlib + +depends_run-append \ + port:perl5 use_autoreconf yes autoreconf.args -fv configure.checks.implicit_function_declaration.whitelist-append strchr +# tell ghostscript it's OK to use the system pkg-config even when cross-compiling +# see https://trac.macports.org/ticket/66627 +configure.env-append \ + PKGCONFIG=${prefix}/bin/pkg-config + +# https://trac.macports.org/ticket/56137 +configure.ldflags-prepend \ + -Lsobin + # Make included OpenJPEG uses its own headers rather than the system ones configure.cppflags-replace \ -I${prefix}/include \ -isystem${prefix}/include -configure.args --disable-compile-inits \ +configure.args-append \ + --disable-compile-inits \ --disable-cups \ --disable-dbus \ --disable-gtk \ - --without-pcl \ - --without-xps \ + --with-system-libtiff \ --without-gpdl \ + --without-pcl \ + --without-tesseract \ --without-x \ - --with-system-libtiff + --without-xps build.target so diff --git a/tools/MacPorts/print/ghostscript/files/patch-base_unixinst.mak.diff b/tools/MacPorts/print/ghostscript/files/patch-base_unixinst.mak.diff index 9cfb41c02..d5c490828 100644 --- a/tools/MacPorts/print/ghostscript/files/patch-base_unixinst.mak.diff +++ b/tools/MacPorts/print/ghostscript/files/patch-base_unixinst.mak.diff @@ -1,5 +1,5 @@ ---- base/unixinst.mak.orig 2019-03-26 09:13:42.000000000 +0000 -+++ base/unixinst.mak 2020-04-28 01:05:01.000000000 -0700 +--- base/unixinst.mak.orig 2023-09-12 14:40:30 ++++ base/unixinst.mak 2023-09-14 17:45:24 @@ -78,6 +78,8 @@ PSEXDIR=$(PSLIBDIR)/../examples PSMANDIR=$(PSLIBDIR)/../man @@ -9,19 +9,17 @@ install-data: install-libdata install-resdata$(COMPILE_INITS) install-iccdata$(COMPILE_INITS) install-doc install-man # There's no point in providing a complete dependency list: we include -@@ -157,7 +159,9 @@ - - DOC_PAGE_IMAGES=Artifex_logo.png favicon.png ghostscript_logo.png hamburger-light.png x-light.png - --install-doc: $(PSDOCDIR)/News.htm +@@ -148,13 +150,30 @@ + # install html documentation + DOC_PAGES=index.html News.html COPYING Ghostscript.pdf \ + GS9_Color_Management.pdf +GPDL_DOC_PAGES=ghostpdl.pdf ghostpdl.txt -+ -+install-doc: $(PSDOCDIR)/News.htm install-doc-$(PCL_TARGET) install-doc-$(XPS_TARGET) install-doc-$(GPDL_TARGET) + +-install-doc: $(PSDOCDIR)/News.html ++install-doc: $(PSDOCDIR)/News.html install-doc-$(PCL_TARGET) install-doc-$(XPS_TARGET) install-doc-$(GPDL_TARGET) -mkdir -p $(DESTDIR)$(docdir) - -mkdir -p $(DESTDIR)$(docdir)/images $(SH) -c 'for f in $(DOC_PAGES) ;\ -@@ -167,6 +171,22 @@ - do if ( test -f $(PSDOCDIR)/images/$$f ); then $(INSTALL_DATA) $(PSDOCDIR)/images/$$f $(DESTDIR)$(docdir)/images; fi;\ + do if ( test -f $(PSDOCDIR)/$$f ); then $(INSTALL_DATA) $(PSDOCDIR)/$$f $(DESTDIR)$(docdir); fi;\ done' +install-doc-gpcl6: install-doc-gpdl @@ -41,9 +39,9 @@ + $(NO_OP) + # install the man pages for each locale - MAN_LCDIRS=. de + MAN_LCDIRS=. MAN1_LINKS_PS2PS=eps2eps -@@ -201,7 +221,7 @@ +@@ -189,7 +208,7 @@ done' # install the example files @@ -52,10 +50,11 @@ -mkdir -p $(DESTDIR)$(exdir) for f in \ alphabet.ps colorcir.ps escher.ps grayalph.ps snowflak.ps \ -@@ -217,6 +237,20 @@ +@@ -204,6 +223,20 @@ + all_ag1.ps all_aj2.ps article9.ps gscjk_ag.ps gscjk_ak.ps iso2022v.ps ;\ do $(INSTALL_DATA) $(PSEXDIR)/cjk/$$f $(DESTDIR)$(exdir)/cjk ;\ done - ++ +install-examples-gpcl6: + -mkdir -p $(DESTDIR)$(exdir)/pcl + for f in \ @@ -69,7 +68,6 @@ +# Dummy target +install-examples-: + $(NO_OP) -+ + install-shared: $(GS_SHARED_OBJS) -mkdir -p $(DESTDIR)$(gssharedir) - $(SH) -c 'for obj in $(GS_SHARED_OBJS); do \ From 3f1f7beafef349aabe7781d8904b8550a5faffd9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20Devernay?= Date: Wed, 27 Sep 2023 18:23:38 +0200 Subject: [PATCH 05/31] MacPorts update --- tools/MacPorts/multimedia/ffmpeg/Portfile | 64 ++++++++----------- .../MacPorts/multimedia/ffmpeg/Portfile.orig | 64 ++++++++----------- 2 files changed, 54 insertions(+), 74 deletions(-) diff --git a/tools/MacPorts/multimedia/ffmpeg/Portfile b/tools/MacPorts/multimedia/ffmpeg/Portfile index 6270de8f0..68b3b68b0 100644 --- a/tools/MacPorts/multimedia/ffmpeg/Portfile +++ b/tools/MacPorts/multimedia/ffmpeg/Portfile @@ -19,7 +19,7 @@ conflicts ffmpeg-devel # Please increase the revision of mpv whenever ffmpeg's version is updated. version 4.4.4 -revision 1 +revision 2 epoch 1 license LGPL-2.1+ @@ -308,14 +308,10 @@ platform darwin { port:svt-av1 } - # Available on 10.6+ - if {(${os.major} >= 10) && (${configure.build_arch} ne "ppc")} { - # Only enable 'rav1e', for non-slim installation - if {![variant_isset slim]} { - configure.args-append \ - --enable-librav1e - depends_lib-append \ - port:rav1e + # rav1e available on 10.6+ + if {(${os.major} < 10) || (${configure.build_arch} eq "ppc")} { + if {[variant_isset rav1e]} { + error "Variant rav1e not supported for macOS 10.5 and earlier, or PPC" } } } @@ -576,50 +572,44 @@ variant nonfree description {enable nonfree code, libraries and binaries will no port:libfdk-aac } -variant slim description {Trim dependencies slightly, without significantly impacting overall feature set} {} +variant rav1e description {Enable codec rav1e} { + configure.args-append \ + --enable-librav1e + depends_lib-append \ + port:rav1e +} + +if {![variant_isset rav1e]} { + notes-append "Support for rav1e now disabled by default; enable via +rav1e" +} if {[variant_isset nonfree]} { -notes " +notes-append " This build of ${name} includes nonfree code as follows: libfdk-aac The following libraries and binaries may not be redistributed: - ffmpeg - libavcodec - libavdevice - libavfilter - libavformat - libavutil + ffmpeg libavcodec libavdevice libavfilter libavformat libavutil To remove this restriction remove the variant +nonfree " } elseif {[variant_isset gpl3]} { -notes " -This build of ${name} includes GPLed code and is therefore licensed under GPL v3 or later. +notes-append " +This build of ${name} includes GPLed code and is therefore licensed under GPL v3 or later.\ The following modules are GPLed: - postproc - libsambaclient - libvidstab - libx264 - libx265 - libxvid -To include all nonfree, GPLed and LGPL code use variant +nonfree. + libsambaclient libvidstab libx264 libx265 libxvid postproc +To include all nonfree, GPLed and LGPL code use variant +nonfree.\ To remove nonfree and GPLed code leaving only LGPL code remove the +gpl2 and +gpl3 variants. " } elseif {[variant_isset gpl2]} { -notes " -This build of ${name} includes GPLed code and is therefore licensed under GPL v2 or later. +notes-append " +This build of ${name} includes GPLed code and is therefore licensed under GPL v2 or later.\ The following modules are GPLed: - postproc - libvidstab - libx264 - libx265 - libxvid -To include all nonfree, GPLed and LGPL code use variant +nonfree. + libvidstab libx264 libx265 libxvid postproc +To include all nonfree, GPLed and LGPL code use variant +nonfree.\ To remove nonfree and GPLed code leaving only LGPL code remove the +gpl2 variant. " } else { -notes " -This build of ${name} includes no GPLed or nonfree code\ -and is therefore licensed under LGPL v2.1 or later. +notes-append " +This build of ${name} includes no GPLed or nonfree code and is therefore licensed under LGPL v2.1 or later. " } diff --git a/tools/MacPorts/multimedia/ffmpeg/Portfile.orig b/tools/MacPorts/multimedia/ffmpeg/Portfile.orig index d2fbb4aae..bc8b82851 100644 --- a/tools/MacPorts/multimedia/ffmpeg/Portfile.orig +++ b/tools/MacPorts/multimedia/ffmpeg/Portfile.orig @@ -19,7 +19,7 @@ conflicts ffmpeg-devel # Please increase the revision of mpv whenever ffmpeg's version is updated. version 4.4.4 -revision 1 +revision 2 epoch 1 license LGPL-2.1+ @@ -296,14 +296,10 @@ platform darwin { port:svt-av1 } - # Available on 10.6+ - if {(${os.major} >= 10) && (${configure.build_arch} ne "ppc")} { - # Only enable 'rav1e', for non-slim installation - if {![variant_isset slim]} { - configure.args-append \ - --enable-librav1e - depends_lib-append \ - port:rav1e + # rav1e available on 10.6+ + if {(${os.major} < 10) || (${configure.build_arch} eq "ppc")} { + if {[variant_isset rav1e]} { + error "Variant rav1e not supported for macOS 10.5 and earlier, or PPC" } } } @@ -476,50 +472,44 @@ variant nonfree description {enable nonfree code, libraries and binaries will no port:libfdk-aac } -variant slim description {Trim dependencies slightly, without significantly impacting overall feature set} {} +variant rav1e description {Enable codec rav1e} { + configure.args-append \ + --enable-librav1e + depends_lib-append \ + port:rav1e +} + +if {![variant_isset rav1e]} { + notes-append "Support for rav1e now disabled by default; enable via +rav1e" +} if {[variant_isset nonfree]} { -notes " +notes-append " This build of ${name} includes nonfree code as follows: libfdk-aac The following libraries and binaries may not be redistributed: - ffmpeg - libavcodec - libavdevice - libavfilter - libavformat - libavutil + ffmpeg libavcodec libavdevice libavfilter libavformat libavutil To remove this restriction remove the variant +nonfree " } elseif {[variant_isset gpl3]} { -notes " -This build of ${name} includes GPLed code and is therefore licensed under GPL v3 or later. +notes-append " +This build of ${name} includes GPLed code and is therefore licensed under GPL v3 or later.\ The following modules are GPLed: - postproc - libsambaclient - libvidstab - libx264 - libx265 - libxvid -To include all nonfree, GPLed and LGPL code use variant +nonfree. + libsambaclient libvidstab libx264 libx265 libxvid postproc +To include all nonfree, GPLed and LGPL code use variant +nonfree.\ To remove nonfree and GPLed code leaving only LGPL code remove the +gpl2 and +gpl3 variants. " } elseif {[variant_isset gpl2]} { -notes " -This build of ${name} includes GPLed code and is therefore licensed under GPL v2 or later. +notes-append " +This build of ${name} includes GPLed code and is therefore licensed under GPL v2 or later.\ The following modules are GPLed: - postproc - libvidstab - libx264 - libx265 - libxvid -To include all nonfree, GPLed and LGPL code use variant +nonfree. + libvidstab libx264 libx265 libxvid postproc +To include all nonfree, GPLed and LGPL code use variant +nonfree.\ To remove nonfree and GPLed code leaving only LGPL code remove the +gpl2 variant. " } else { -notes " -This build of ${name} includes no GPLed or nonfree code\ -and is therefore licensed under LGPL v2.1 or later. +notes-append " +This build of ${name} includes no GPLed or nonfree code and is therefore licensed under LGPL v2.1 or later. " } From 525a5d5f7dc4c8102c3abb66e8943b80983bd012 Mon Sep 17 00:00:00 2001 From: Aaron Colwell <300262+acolwell@users.noreply.github.com> Date: Wed, 4 Oct 2023 07:08:07 -0700 Subject: [PATCH 06/31] Fix pacman repo build (#925) * Updated OpenImageIO tarball sha256 sum and source directory. * Updated ffmpeg patch's sha256 sum. The index line has extra hash digits now. --- tools/MINGW-packages/mingw-w64-ffmpeg-gpl2/PKGBUILD | 2 +- tools/MINGW-packages/mingw-w64-openimageio/PKGBUILD | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/tools/MINGW-packages/mingw-w64-ffmpeg-gpl2/PKGBUILD b/tools/MINGW-packages/mingw-w64-ffmpeg-gpl2/PKGBUILD index a2cea2497..6bbc74242 100644 --- a/tools/MINGW-packages/mingw-w64-ffmpeg-gpl2/PKGBUILD +++ b/tools/MINGW-packages/mingw-w64-ffmpeg-gpl2/PKGBUILD @@ -49,7 +49,7 @@ makedepends=("${MINGW_PACKAGE_PREFIX}-gcc" source=(https://ffmpeg.org/releases/${_realname}-${pkgver}.tar.xz https://github.com/FFmpeg/FFmpeg/commit/effadce6c756247ea8bae32dc13bb3e6f464f0eb.patch) sha256sums=('6c5b6c195e61534766a0b5fe16acc919170c883362612816d0a1c7f4f947006e' - '206f4d8437b21f6197ffc444c86d0504892a5c2137cb227b4af1c1e8bf2c426c') + '8fad5f253bcda7a17523dbfcbfcfd60b3db23783dcdb65998005cddc7c7776c3') prepare() { cd "${srcdir}/${_realname}-${pkgver}" diff --git a/tools/MINGW-packages/mingw-w64-openimageio/PKGBUILD b/tools/MINGW-packages/mingw-w64-openimageio/PKGBUILD index 3a7cc69c8..25373a17c 100644 --- a/tools/MINGW-packages/mingw-w64-openimageio/PKGBUILD +++ b/tools/MINGW-packages/mingw-w64-openimageio/PKGBUILD @@ -35,7 +35,7 @@ source=(${_realname}-${pkgver}.tar.gz::https://github.com/OpenImageIO/oiio/archi oiio-2.2.14-libraw.diff oiio-2.4.13.0-thread-shutdown.patch # Remove when updating to a future 2.5 release that has these changes. ) -sha256sums=('72b7d2d5edd1049bb7fc09becad4d8be64a9918cdf79bae98b4b32e1fda762cd' +sha256sums=('bb10a7ab6dff5dae2c6d854e9da38136546232235913237e8b1b3c99abb7dd0b' 'SKIP' 'e8aec185fd20a6e5cdf77a7155fcaedb301c07bd806f73bd30dfc75af721ac83' 'd9c2e066ce0e94404d31fd649341cc0ee03faf9b4023dfcdf5cf59fbbf466127' @@ -44,7 +44,7 @@ sha256sums=('72b7d2d5edd1049bb7fc09becad4d8be64a9918cdf79bae98b4b32e1fda762cd' ) prepare() { - cd ${srcdir}/oiio-${pkgver} + cd ${srcdir}/OpenImageIO-${pkgver} #patch -p0 -i ${srcdir}/oiio-2.1.10-boost.diff patch -p1 -i ${srcdir}/oiio-2.0.8-invalidatespec.patch patch -p0 -i ${srcdir}/oiio-2.2.14-libraw.diff @@ -92,7 +92,7 @@ build() { -DCMAKE_CXX_STANDARD=14 \ -DCMAKE_SHARED_LINKER_FLAGS=" -Wl,--export-all-symbols -Wl,--enable-auto-import " \ ${extra_config} \ - ../oiio-${pkgver} + ../OpenImageIO-${pkgver} make } From 526e05e9b1e9efbbedb99167c334ee7e98d23541 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20Devernay?= Date: Tue, 31 Oct 2023 09:56:06 +0100 Subject: [PATCH 07/31] update MacPorts --- tools/MacPorts/graphics/libraw/Portfile.orig | 1 + tools/MacPorts/graphics/libraw/Portfile.patch | 25 ++++---- tools/MacPorts/lang/libomp/Portfile | 41 +++++++++--- tools/MacPorts/lang/libomp/Portfile.orig | 26 +++++--- tools/MacPorts/lang/libomp/Portfile.patch | 62 ++++--------------- tools/MacPorts/multimedia/ffmpeg/Portfile | 11 +++- .../MacPorts/multimedia/ffmpeg/Portfile.orig | 11 +++- tools/MacPorts/multimedia/libvpx/Portfile | 4 +- .../MacPorts/multimedia/libvpx/Portfile.orig | 4 +- tools/MacPorts/net/curl/Portfile | 40 ++++++++---- tools/MacPorts/net/curl/Portfile.orig | 40 ++++++++---- tools/MacPorts/net/curl/files/configure.patch | 2 +- tools/MacPorts/python/py-pyside2/Portfile | 16 +++-- .../MacPorts/python/py-pyside2/Portfile.orig | 16 +++-- 14 files changed, 169 insertions(+), 130 deletions(-) diff --git a/tools/MacPorts/graphics/libraw/Portfile.orig b/tools/MacPorts/graphics/libraw/Portfile.orig index c7939c92f..af45080db 100644 --- a/tools/MacPorts/graphics/libraw/Portfile.orig +++ b/tools/MacPorts/graphics/libraw/Portfile.orig @@ -29,6 +29,7 @@ depends_lib port:jasper \ port:lcms2 use_autoreconf yes +autoreconf.args -fvi # libraw_datastream.h:125:8: error: no template named 'unique_ptr' in namespace 'std' compiler.cxx_standard 2011 diff --git a/tools/MacPorts/graphics/libraw/Portfile.patch b/tools/MacPorts/graphics/libraw/Portfile.patch index a803fecbc..93c7cbe15 100644 --- a/tools/MacPorts/graphics/libraw/Portfile.patch +++ b/tools/MacPorts/graphics/libraw/Portfile.patch @@ -1,18 +1,18 @@ ---- Portfile.orig 2023-01-28 18:14:47.000000000 -0800 -+++ Portfile 2023-01-28 18:14:55.000000000 -0800 -@@ -3,47 +3,67 @@ +--- Portfile.orig 2023-10-31 09:50:57 ++++ Portfile 2023-07-04 02:43:05 +@@ -3,50 +3,69 @@ PortSystem 1.0 name libraw -version 0.21.1 -revision 0 -- --checksums rmd160 be36d8709eb2e8578f07b63ea8632eb6ed1d7775 \ -- sha256 630a6bcf5e65d1b1b40cdb8608bdb922316759bfb981c65091fec8682d1543cd \ -- size 1638461 +version 0.18.13 +set demosaicversion 0.18.8 +-checksums rmd160 be36d8709eb2e8578f07b63ea8632eb6ed1d7775 \ +- sha256 630a6bcf5e65d1b1b40cdb8608bdb922316759bfb981c65091fec8682d1543cd \ +- size 1638461 +- description Library for RAW image manipulation long_description A library for reading RAW files obtained from digital photo \ cameras (CRW/CR2, NEF, RAF, DNG, and others). @@ -50,6 +50,7 @@ port:lcms2 -use_autoreconf yes +-autoreconf.args -fvi - -# libraw_datastream.h:125:8: error: no template named 'unique_ptr' in namespace 'std' -compiler.cxx_standard 2011 @@ -70,8 +71,8 @@ + reinplace -E {s|-lstdc|-lc|g} ${destroot}${prefix}/lib/pkgconfig/libraw.pc + reinplace -E {s|-lstdc|-lc|g} ${destroot}${prefix}/lib/pkgconfig/libraw_r.pc + } -+} -+ + } + +variant gpl2 description {Enable GPL demosaic pack, license will be GPL-2+} { + distfiles-append \ + LibRaw-demosaic-pack-GPL2-${demosaicversion}${extract.suffix} \ @@ -84,6 +85,8 @@ + LibRaw-demosaic-pack-GPL3-${demosaicversion}${extract.suffix} + + license GPL-3+ - } - ++} ++ livecheck.type regex + livecheck.url ${homepage}/download/ + livecheck.regex "LibRaw-(\\d+(?:\\.\\d+)*)${extract.suffix}" diff --git a/tools/MacPorts/lang/libomp/Portfile b/tools/MacPorts/lang/libomp/Portfile index 4a7306895..ee3ca0416 100644 --- a/tools/MacPorts/lang/libomp/Portfile +++ b/tools/MacPorts/lang/libomp/Portfile @@ -29,21 +29,30 @@ epoch 1 subport libomp-devel {} if {${os.platform} eq "darwin" && ${configure.cxx_stdlib} ne "libstdc++"} { + + version 17.0.3 + revision 0 + if { ${subport} eq "libomp-devel" } { - version 11.1.0 - checksums rmd160 8869b60844901466aed4e462ae8dac831bf519c3 \ - sha256 d187483b75b39acb3ff8ea1b7d98524d95322e3cb148842957e9b0fbb866052e \ - size 971628 - livecheck.regex {"llvmorg-([0-9.rc-]+)".*} + # Marked obsolete 10/25/2022 + PortGroup obsolete 1.0 + replaced_by libomp } else { - version 11.1.0 - checksums rmd160 8869b60844901466aed4e462ae8dac831bf519c3 \ - sha256 d187483b75b39acb3ff8ea1b7d98524d95322e3cb148842957e9b0fbb866052e \ - size 971628 livecheck.regex {"llvmorg-([0-9.]+)".*} } - revision 0 + distname openmp-${version}.src + distfiles ${distname}.tar.xz cmake-${version}.src.tar.xz + + checksums \ + openmp-${version}.src.tar.xz \ + rmd160 a79350f38202f4e9819373a433b1b19cef631eb2 \ + sha256 e04172c067f256d06cd8112abb49bc65f4e1d986a4b49b36cd837dfee3cdd274 \ + size 1273276 \ + cmake-${version}.src.tar.xz \ + rmd160 2f419efae4d3f8c9d87943cf1873031468a19bd7 \ + sha256 54fc534f0da09088adbaa6c3bfc9899a500153b96e60c2fb9322a7aa37b1027a \ + size 8712 if {${os.major} <= 12} { # kmp_alloc.c includes but libc++ is not the default on @@ -95,6 +104,18 @@ cmake.out_of_source yes # According to documentation builds with clang >= 3.3 compiler.blacklist-append {clang < 500} *gcc* +# https://trac.macports.org/ticket/68490# +# Use clang-11-bootstrap on OSX10.11 and older +if {${os.major} <= 15} { + compiler.blacklist-append clang *gcc* + depends_build-append port:clang-11-bootstrap + depends_skip_archcheck-append clang-11-bootstrap + pre-configure { + configure.cc ${prefix}/libexec/clang-11-bootstrap/bin/clang + configure.cxx ${prefix}/libexec/clang-11-bootstrap/bin/clang++ + } +} + if {${os.major} <= 17} { default_variants +universal } diff --git a/tools/MacPorts/lang/libomp/Portfile.orig b/tools/MacPorts/lang/libomp/Portfile.orig index a41738980..64a4e6f30 100644 --- a/tools/MacPorts/lang/libomp/Portfile.orig +++ b/tools/MacPorts/lang/libomp/Portfile.orig @@ -30,7 +30,7 @@ subport libomp-devel {} if {${os.platform} eq "darwin" && ${configure.cxx_stdlib} ne "libstdc++"} { - version 16.0.6 + version 17.0.3 revision 0 if { ${subport} eq "libomp-devel" } { @@ -46,13 +46,13 @@ if {${os.platform} eq "darwin" && ${configure.cxx_stdlib} ne "libstdc++"} { checksums \ openmp-${version}.src.tar.xz \ - rmd160 de7bc41e8207077aee79e3ff45c782f489f8f383 \ - sha256 a2536f06373774f2829d892b72eea5f97bab20e69b26b03042d947f992eb8e38 \ - size 1278072 \ + rmd160 a79350f38202f4e9819373a433b1b19cef631eb2 \ + sha256 e04172c067f256d06cd8112abb49bc65f4e1d986a4b49b36cd837dfee3cdd274 \ + size 1273276 \ cmake-${version}.src.tar.xz \ - rmd160 94ead500d749de031894e9a14c51ed17951c8fd7 \ - sha256 39d342a4161095d2f28fb1253e4585978ac50521117da666e2b1f6f28b62f514 \ - size 9008 + rmd160 2f419efae4d3f8c9d87943cf1873031468a19bd7 \ + sha256 54fc534f0da09088adbaa6c3bfc9899a500153b96e60c2fb9322a7aa37b1027a \ + size 8712 if {${os.major} <= 12} { # kmp_alloc.c includes but libc++ is not the default on @@ -98,6 +98,18 @@ cmake.out_of_source yes # According to documentation builds with clang >= 3.3 compiler.blacklist-append {clang < 500} *gcc* +# https://trac.macports.org/ticket/68490# +# Use clang-11-bootstrap on OSX10.11 and older +if {${os.major} <= 15} { + compiler.blacklist-append clang *gcc* + depends_build-append port:clang-11-bootstrap + depends_skip_archcheck-append clang-11-bootstrap + pre-configure { + configure.cc ${prefix}/libexec/clang-11-bootstrap/bin/clang + configure.cxx ${prefix}/libexec/clang-11-bootstrap/bin/clang++ + } +} + if {${os.major} <= 17} { default_variants +universal } diff --git a/tools/MacPorts/lang/libomp/Portfile.patch b/tools/MacPorts/lang/libomp/Portfile.patch index 83df784f5..7b318430a 100644 --- a/tools/MacPorts/lang/libomp/Portfile.patch +++ b/tools/MacPorts/lang/libomp/Portfile.patch @@ -1,5 +1,5 @@ ---- Portfile.orig 2023-07-03 17:37:19.000000000 -0700 -+++ Portfile 2023-04-04 12:02:53.000000000 -0700 +--- Portfile.orig 2023-10-31 09:50:26 ++++ Portfile 2023-10-31 09:50:26 @@ -1,7 +1,7 @@ # -*- coding: utf-8; mode: tcl; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- vim:fenc=utf-8:ft=tcl:et:sw=4:ts=4:sts=4 @@ -18,48 +18,7 @@ components required to build an executing OpenMP\ program that are outside the compiler itself. \ This port works with MacPorts' clang-3.7+ (optionally \ -@@ -29,30 +29,21 @@ - subport libomp-devel {} - - if {${os.platform} eq "darwin" && ${configure.cxx_stdlib} ne "libstdc++"} { -- -- version 16.0.6 -- revision 0 -- - if { ${subport} eq "libomp-devel" } { -- # Marked obsolete 10/25/2022 -- PortGroup obsolete 1.0 -- replaced_by libomp -+ version 11.1.0 -+ checksums rmd160 8869b60844901466aed4e462ae8dac831bf519c3 \ -+ sha256 d187483b75b39acb3ff8ea1b7d98524d95322e3cb148842957e9b0fbb866052e \ -+ size 971628 -+ livecheck.regex {"llvmorg-([0-9.rc-]+)".*} - } else { -+ version 11.1.0 -+ checksums rmd160 8869b60844901466aed4e462ae8dac831bf519c3 \ -+ sha256 d187483b75b39acb3ff8ea1b7d98524d95322e3cb148842957e9b0fbb866052e \ -+ size 971628 - livecheck.regex {"llvmorg-([0-9.]+)".*} - } - -- distname openmp-${version}.src -- distfiles ${distname}.tar.xz cmake-${version}.src.tar.xz -- -- checksums \ -- openmp-${version}.src.tar.xz \ -- rmd160 de7bc41e8207077aee79e3ff45c782f489f8f383 \ -- sha256 a2536f06373774f2829d892b72eea5f97bab20e69b26b03042d947f992eb8e38 \ -- size 1278072 \ -- cmake-${version}.src.tar.xz \ -- rmd160 94ead500d749de031894e9a14c51ed17951c8fd7 \ -- sha256 39d342a4161095d2f28fb1253e4585978ac50521117da666e2b1f6f28b62f514 \ -- size 9008 -+ revision 0 - - if {${os.major} <= 12} { - # kmp_alloc.c includes but libc++ is not the default on -@@ -62,34 +53,40 @@ +@@ -62,34 +62,40 @@ # Build requires std::atomic configure.cxxflags-append -std=c++11 @@ -120,24 +79,25 @@ } depends_build-append port:perl5 -@@ -115,14 +112,8 @@ +@@ -127,15 +133,9 @@ # With this, cmake sets the correct library name in the dylibs for the # final destination we move them to configure.args-append -DCMAKE_INSTALL_RPATH=${prefix}/lib/libomp \ - -DCMAKE_INSTALL_NAME_DIR=${prefix}/lib/libomp -- ++ -DCMAKE_INSTALL_NAME_DIR=${prefix}/lib/libomp \ ++ -DLIBOMP_OMPT_SUPPORT=FALSE + -if {${os.major} <= 10} { - set hnames {omp.h} - configure.args-append -DLIBOMP_OMPT_SUPPORT=FALSE -} else { - set hnames {omp-tools.h omp.h ompt.h} -} -+ -DCMAKE_INSTALL_NAME_DIR=${prefix}/lib/libomp \ -+ -DLIBOMP_OMPT_SUPPORT=FALSE - +- variant top_level description \ "Install (links to) omp.h and libs into ${prefix}/(include|lib)" {} -@@ -131,30 +122,22 @@ + +@@ -143,30 +143,22 @@ # Patch tool for build with CMAKE_INSTALL_PREFIX reinplace "/bulk.*compatibility/s/s\+/s+.*/" \ ${rtpath}tools/check-depends.pl @@ -172,7 +132,7 @@ foreach p {libiomp5.dylib libomp.dylib libgomp.dylib} { system -W ${instdest}/lib/ \ "ln -s libomp/${p}" -@@ -162,8 +145,8 @@ +@@ -174,8 +166,8 @@ } set fpath ${worksrcpath}/${rtpath} diff --git a/tools/MacPorts/multimedia/ffmpeg/Portfile b/tools/MacPorts/multimedia/ffmpeg/Portfile index 68b3b68b0..bd53a007b 100644 --- a/tools/MacPorts/multimedia/ffmpeg/Portfile +++ b/tools/MacPorts/multimedia/ffmpeg/Portfile @@ -19,7 +19,7 @@ conflicts ffmpeg-devel # Please increase the revision of mpv whenever ffmpeg's version is updated. version 4.4.4 -revision 2 +revision 3 epoch 1 license LGPL-2.1+ @@ -314,6 +314,15 @@ platform darwin { error "Variant rav1e not supported for macOS 10.5 and earlier, or PPC" } } + + # due to the new linker (which was introduced in Xcode 15: https://developer.apple.com/documentation/xcode-release-notes/xcode-15-release-notes), + # this port requires '-ld_classic' to build successfully with the toolchains from Xcode 15 or Command Line Tools 15. + # + # TODO: This is a temporary solution, the classic linker will be removed in a future release by Apple. + if { ( [vercmp ${xcodeversion} 15 ] >= 0 ) || ( [vercmp ${xcodecltversion} 15 ] >= 0 ) } { + configure.ldflags-append \ + -Wl,-ld_classic + } } platform powerpc { diff --git a/tools/MacPorts/multimedia/ffmpeg/Portfile.orig b/tools/MacPorts/multimedia/ffmpeg/Portfile.orig index bc8b82851..4582698a0 100644 --- a/tools/MacPorts/multimedia/ffmpeg/Portfile.orig +++ b/tools/MacPorts/multimedia/ffmpeg/Portfile.orig @@ -19,7 +19,7 @@ conflicts ffmpeg-devel # Please increase the revision of mpv whenever ffmpeg's version is updated. version 4.4.4 -revision 2 +revision 3 epoch 1 license LGPL-2.1+ @@ -302,6 +302,15 @@ platform darwin { error "Variant rav1e not supported for macOS 10.5 and earlier, or PPC" } } + + # due to the new linker (which was introduced in Xcode 15: https://developer.apple.com/documentation/xcode-release-notes/xcode-15-release-notes), + # this port requires '-ld_classic' to build successfully with the toolchains from Xcode 15 or Command Line Tools 15. + # + # TODO: This is a temporary solution, the classic linker will be removed in a future release by Apple. + if { ( [vercmp ${xcodeversion} 15 ] >= 0 ) || ( [vercmp ${xcodecltversion} 15 ] >= 0 ) } { + configure.ldflags-append \ + -Wl,-ld_classic + } } platform powerpc { diff --git a/tools/MacPorts/multimedia/libvpx/Portfile b/tools/MacPorts/multimedia/libvpx/Portfile index 1b6f8da30..6538d5aba 100644 --- a/tools/MacPorts/multimedia/libvpx/Portfile +++ b/tools/MacPorts/multimedia/libvpx/Portfile @@ -7,8 +7,8 @@ PortGroup muniversal 1.0 name libvpx conflicts libvpx-devel set my_name libvpx -version 1.13.0 -revision 1 +version 1.13.1 +revision 0 categories multimedia license Permissive diff --git a/tools/MacPorts/multimedia/libvpx/Portfile.orig b/tools/MacPorts/multimedia/libvpx/Portfile.orig index 089f19b3c..ecbf5bac3 100644 --- a/tools/MacPorts/multimedia/libvpx/Portfile.orig +++ b/tools/MacPorts/multimedia/libvpx/Portfile.orig @@ -7,8 +7,8 @@ PortGroup muniversal 1.0 name libvpx conflicts libvpx-devel set my_name libvpx -version 1.13.0 -revision 1 +version 1.13.1 +revision 0 categories multimedia license Permissive diff --git a/tools/MacPorts/net/curl/Portfile b/tools/MacPorts/net/curl/Portfile index 0df4d7ffd..03a6e5a34 100644 --- a/tools/MacPorts/net/curl/Portfile +++ b/tools/MacPorts/net/curl/Portfile @@ -6,10 +6,10 @@ PortGroup clang_dependency 1.0 # Increase the revision of p5-www-curl whenever the version of curl gets updated. name curl -version 8.3.0 -checksums rmd160 f5f0aa07f0783cc331fb86c50249037d3524e33f \ - sha256 376d627767d6c4f05105ab6d497b0d9aba7111770dd9d995225478209c37ea63 \ - size 2641764 +version 8.4.0 +checksums rmd160 d63bf003f0ef4da208337143a036da835ad9bfb6 \ + sha256 16c62a9c4af0f703d28bda6d7bbf37ba47055ad3414d70dec63e2e6336f2a82d \ + size 2658376 categories net www platforms darwin freebsd @@ -47,12 +47,6 @@ if {${name} eq ${subport}} { patchfiles configure.patch - # see https://github.com/curl/curl/issues/11893 - if {${os.platform} eq "darwin" && ${os.major} >= 23} { - incr revision - patchfiles-append patch-sonoma.patch - } - configure.args --disable-silent-rules \ --enable-ipv6 \ --without-gnutls \ @@ -62,7 +56,6 @@ if {${name} eq ${subport}} { --without-libssh2 \ --without-mbedtls \ --without-nghttp2 \ - --without-nss \ --without-openssl \ --without-ssl \ --without-secure-transport \ @@ -127,30 +120,51 @@ if {${name} eq ${subport}} { RELEASE-NOTES \ ${destroot}${docdir} xinstall -m 0644 -W ${worksrcpath}/docs \ + ALTSVC.md \ BINDINGS.md \ + BUFREF.md \ BUGS.md \ + CIPHERS.md \ CODE_OF_CONDUCT.md \ CODE_STYLE.md \ + CONNECTION-FILTERS.md \ CONTRIBUTE.md \ + CURL-DISABLE.md \ + DEPRECATE.md \ + DYNBUF.md \ FAQ \ FEATURES.md \ GOVERNANCE.md \ HELP-US.md \ HISTORY.md \ + HSTS.md \ HTTP-COOKIES.md \ - HTTP2.md \ INTERNALS.md \ KNOWN_BUGS \ MAIL-ETIQUETTE \ + PARALLEL-TRANSFERS.md \ ROADMAP.md \ - SECURITY-PROCESS.md \ + SECURITY-ADVISORY.md \ SSL-PROBLEMS.md \ SSLCERTS.md \ THANKS \ TODO \ TheArtOfHttpScripting.md \ + URL-SYNTAX.md \ VERSIONS.md \ + WEBSOCKET.md \ + VULN-DISCLOSURE-POLICY.md \ ${destroot}${docdir} + if {[variant_isset http2]} { + xinstall -m 0644 -W ${worksrcpath}/docs \ + HTTP2.md \ + ${destroot}${docdir} + } + if {[variant_isset http3]} { + xinstall -m 0644 -W ${worksrcpath}/docs \ + HTTP3.md \ + ${destroot}${docdir} + } xinstall -m 0644 ${worksrcpath}/docs/libcurl/libcurl.m4 \ ${destroot}${prefix}/share/aclocal/ } diff --git a/tools/MacPorts/net/curl/Portfile.orig b/tools/MacPorts/net/curl/Portfile.orig index 0ee35533f..5dbded285 100644 --- a/tools/MacPorts/net/curl/Portfile.orig +++ b/tools/MacPorts/net/curl/Portfile.orig @@ -6,10 +6,10 @@ PortGroup clang_dependency 1.0 # Increase the revision of p5-www-curl whenever the version of curl gets updated. name curl -version 8.3.0 -checksums rmd160 f5f0aa07f0783cc331fb86c50249037d3524e33f \ - sha256 376d627767d6c4f05105ab6d497b0d9aba7111770dd9d995225478209c37ea63 \ - size 2641764 +version 8.4.0 +checksums rmd160 d63bf003f0ef4da208337143a036da835ad9bfb6 \ + sha256 16c62a9c4af0f703d28bda6d7bbf37ba47055ad3414d70dec63e2e6336f2a82d \ + size 2658376 categories net www platforms darwin freebsd @@ -47,12 +47,6 @@ if {${name} eq ${subport}} { patchfiles configure.patch - # see https://github.com/curl/curl/issues/11893 - if {${os.platform} eq "darwin" && ${os.major} >= 23} { - incr revision - patchfiles-append patch-sonoma.patch - } - configure.args --disable-silent-rules \ --enable-ipv6 \ --without-gnutls \ @@ -62,7 +56,6 @@ if {${name} eq ${subport}} { --without-libssh2 \ --without-mbedtls \ --without-nghttp2 \ - --without-nss \ --without-openssl \ --without-ssl \ --without-secure-transport \ @@ -123,30 +116,51 @@ if {${name} eq ${subport}} { RELEASE-NOTES \ ${destroot}${docdir} xinstall -m 0644 -W ${worksrcpath}/docs \ + ALTSVC.md \ BINDINGS.md \ + BUFREF.md \ BUGS.md \ + CIPHERS.md \ CODE_OF_CONDUCT.md \ CODE_STYLE.md \ + CONNECTION-FILTERS.md \ CONTRIBUTE.md \ + CURL-DISABLE.md \ + DEPRECATE.md \ + DYNBUF.md \ FAQ \ FEATURES.md \ GOVERNANCE.md \ HELP-US.md \ HISTORY.md \ + HSTS.md \ HTTP-COOKIES.md \ - HTTP2.md \ INTERNALS.md \ KNOWN_BUGS \ MAIL-ETIQUETTE \ + PARALLEL-TRANSFERS.md \ ROADMAP.md \ - SECURITY-PROCESS.md \ + SECURITY-ADVISORY.md \ SSL-PROBLEMS.md \ SSLCERTS.md \ THANKS \ TODO \ TheArtOfHttpScripting.md \ + URL-SYNTAX.md \ VERSIONS.md \ + WEBSOCKET.md \ + VULN-DISCLOSURE-POLICY.md \ ${destroot}${docdir} + if {[variant_isset http2]} { + xinstall -m 0644 -W ${worksrcpath}/docs \ + HTTP2.md \ + ${destroot}${docdir} + } + if {[variant_isset http3]} { + xinstall -m 0644 -W ${worksrcpath}/docs \ + HTTP3.md \ + ${destroot}${docdir} + } xinstall -m 0644 ${worksrcpath}/docs/libcurl/libcurl.m4 \ ${destroot}${prefix}/share/aclocal/ } diff --git a/tools/MacPorts/net/curl/files/configure.patch b/tools/MacPorts/net/curl/files/configure.patch index 53ce8a7d2..2168572f1 100644 --- a/tools/MacPorts/net/curl/files/configure.patch +++ b/tools/MacPorts/net/curl/files/configure.patch @@ -2,7 +2,7 @@ Prevent curl-config from telling curl's dependents that they have to link with all of curl's dependencies as well. --- configure.orig 2023-09-13 08:41:45 +++ configure 2023-09-13 08:42:48 -@@ -14479,7 +14479,7 @@ +@@ -14477,7 +14477,7 @@ else whole_archive_flag_spec='' fi diff --git a/tools/MacPorts/python/py-pyside2/Portfile b/tools/MacPorts/python/py-pyside2/Portfile index 6eb342a70..76b9f6af8 100644 --- a/tools/MacPorts/python/py-pyside2/Portfile +++ b/tools/MacPorts/python/py-pyside2/Portfile @@ -4,7 +4,7 @@ PortSystem 1.0 PortGroup python 1.0 name py-pyside2 -version 5.15.10 +version 5.15.11 revision 0 categories-append devel aqua platforms darwin @@ -18,14 +18,15 @@ master_sites https://download.qt.io/official_releases/QtForPython/pys distname pyside-setup-opensource-src-${version} use_xz yes -checksums rmd160 492396a82a4140e86a81e4235cafa6a781766714 \ - sha256 2af691d3613a41f83a60439b46568fc2c696dbfae42f7cd7b07152d115ead33a \ - size 3583764 +checksums rmd160 7f5725800c28998c6600b8360caab88bc137b11d \ + sha256 da567cd3b7854d27a0b4afe3e89de8b2f98b7a6d57393be56f1fc13f770faf29 \ + size 3584760 -python.versions 37 38 39 310 +python.versions 37 38 39 310 311 +python.pep517 no -set llvm_version 16 +set llvm_version 17 if {${name} ne ${subport}} { PortGroup qt5 1.0 @@ -39,9 +40,6 @@ if {${name} ne ${subport}} { # Needed for generating shiboken2 documentation qt5.depends_build_component sqlite-plugin - # undeclared identifier NPY_ARRAY_UPDATEIFCOPY - patchfiles-append patch-shiboken2-numpy-1.23.0.diff - depends_build-append \ path:bin/cmake:cmake \ port:py${python.version}-setuptools \ diff --git a/tools/MacPorts/python/py-pyside2/Portfile.orig b/tools/MacPorts/python/py-pyside2/Portfile.orig index 0f21fa2d3..6c1c7d944 100644 --- a/tools/MacPorts/python/py-pyside2/Portfile.orig +++ b/tools/MacPorts/python/py-pyside2/Portfile.orig @@ -4,7 +4,7 @@ PortSystem 1.0 PortGroup python 1.0 name py-pyside2 -version 5.15.10 +version 5.15.11 revision 0 categories-append devel aqua platforms darwin @@ -18,14 +18,15 @@ master_sites https://download.qt.io/official_releases/QtForPython/pys distname pyside-setup-opensource-src-${version} use_xz yes -checksums rmd160 492396a82a4140e86a81e4235cafa6a781766714 \ - sha256 2af691d3613a41f83a60439b46568fc2c696dbfae42f7cd7b07152d115ead33a \ - size 3583764 +checksums rmd160 7f5725800c28998c6600b8360caab88bc137b11d \ + sha256 da567cd3b7854d27a0b4afe3e89de8b2f98b7a6d57393be56f1fc13f770faf29 \ + size 3584760 -python.versions 37 38 39 310 +python.versions 37 38 39 310 311 +python.pep517 no -set llvm_version 16 +set llvm_version 17 if {${name} ne ${subport}} { PortGroup qt5 1.0 @@ -39,9 +40,6 @@ if {${name} ne ${subport}} { # Needed for generating shiboken2 documentation qt5.depends_build_component sqlite-plugin - # undeclared identifier NPY_ARRAY_UPDATEIFCOPY - patchfiles-append patch-shiboken2-numpy-1.23.0.diff - depends_build-append \ path:bin/cmake:cmake \ port:py${python.version}-setuptools \ From d95207674073129dbd3667d82f180de7148c29a6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20Devernay?= Date: Fri, 3 Nov 2023 22:04:35 +0100 Subject: [PATCH 08/31] MacPorts updates --- tools/MacPorts/graphics/openimageio/Portfile | 6 +-- tools/MacPorts/lang/libomp/Portfile | 41 +++++--------------- 2 files changed, 13 insertions(+), 34 deletions(-) diff --git a/tools/MacPorts/graphics/openimageio/Portfile b/tools/MacPorts/graphics/openimageio/Portfile index 4f0a05e8b..f05d156ae 100644 --- a/tools/MacPorts/graphics/openimageio/Portfile +++ b/tools/MacPorts/graphics/openimageio/Portfile @@ -18,9 +18,9 @@ platforms darwin github.setup OpenImageIO oiio 2.4.15.0 v revision 100 -checksums rmd160 31292919a0cb4f9fb4ee92d08add97349280874a \ - sha256 b2d76e3880d25d3b005f7c694811a991ccebb6e396965959d194f79c369ff390 \ - size 47894535 +checksums rmd160 2ccbd4905b7133f730d08a4387ae3641db0d73c3 \ + sha256 67f28a1599eb942a075f23cc35c938f7de0b901a40583da6798cf9a418c56e07 \ + size 47894262 github.tarball_from archive diff --git a/tools/MacPorts/lang/libomp/Portfile b/tools/MacPorts/lang/libomp/Portfile index ee3ca0416..4a7306895 100644 --- a/tools/MacPorts/lang/libomp/Portfile +++ b/tools/MacPorts/lang/libomp/Portfile @@ -29,30 +29,21 @@ epoch 1 subport libomp-devel {} if {${os.platform} eq "darwin" && ${configure.cxx_stdlib} ne "libstdc++"} { - - version 17.0.3 - revision 0 - if { ${subport} eq "libomp-devel" } { - # Marked obsolete 10/25/2022 - PortGroup obsolete 1.0 - replaced_by libomp + version 11.1.0 + checksums rmd160 8869b60844901466aed4e462ae8dac831bf519c3 \ + sha256 d187483b75b39acb3ff8ea1b7d98524d95322e3cb148842957e9b0fbb866052e \ + size 971628 + livecheck.regex {"llvmorg-([0-9.rc-]+)".*} } else { + version 11.1.0 + checksums rmd160 8869b60844901466aed4e462ae8dac831bf519c3 \ + sha256 d187483b75b39acb3ff8ea1b7d98524d95322e3cb148842957e9b0fbb866052e \ + size 971628 livecheck.regex {"llvmorg-([0-9.]+)".*} } - distname openmp-${version}.src - distfiles ${distname}.tar.xz cmake-${version}.src.tar.xz - - checksums \ - openmp-${version}.src.tar.xz \ - rmd160 a79350f38202f4e9819373a433b1b19cef631eb2 \ - sha256 e04172c067f256d06cd8112abb49bc65f4e1d986a4b49b36cd837dfee3cdd274 \ - size 1273276 \ - cmake-${version}.src.tar.xz \ - rmd160 2f419efae4d3f8c9d87943cf1873031468a19bd7 \ - sha256 54fc534f0da09088adbaa6c3bfc9899a500153b96e60c2fb9322a7aa37b1027a \ - size 8712 + revision 0 if {${os.major} <= 12} { # kmp_alloc.c includes but libc++ is not the default on @@ -104,18 +95,6 @@ cmake.out_of_source yes # According to documentation builds with clang >= 3.3 compiler.blacklist-append {clang < 500} *gcc* -# https://trac.macports.org/ticket/68490# -# Use clang-11-bootstrap on OSX10.11 and older -if {${os.major} <= 15} { - compiler.blacklist-append clang *gcc* - depends_build-append port:clang-11-bootstrap - depends_skip_archcheck-append clang-11-bootstrap - pre-configure { - configure.cc ${prefix}/libexec/clang-11-bootstrap/bin/clang - configure.cxx ${prefix}/libexec/clang-11-bootstrap/bin/clang++ - } -} - if {${os.major} <= 17} { default_variants +universal } From c6ef9ba9ed7e365ba187c0d914d22799284d7ccf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20Devernay?= Date: Sat, 4 Nov 2023 14:43:32 +0100 Subject: [PATCH 09/31] Update build-Linux-sdk.sh fixes https://github.com/NatronGitHub/Natron/issues/906 --- tools/jenkins/include/scripts/build-Linux-sdk.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tools/jenkins/include/scripts/build-Linux-sdk.sh b/tools/jenkins/include/scripts/build-Linux-sdk.sh index fea06a8bc..a3531157c 100755 --- a/tools/jenkins/include/scripts/build-Linux-sdk.sh +++ b/tools/jenkins/include/scripts/build-Linux-sdk.sh @@ -194,7 +194,7 @@ EOF fi # Note: perl-version added for qt4webkit, see https://github.com/NatronGitHub/Natron/issues/351#issuecomment-524068232 # perl-Encode and perl-Data-Dumper needed to build texinfo before perl - YUM_PKGS="ca-certificates make util-linux git tar bzip2 wget glibc-devel diffutils patch zip unzip alsa-lib-devel libX11-devel mesa-libGL-devel mesa-libGLU-devel libXrender-devel libSM-devel libICE-devel libXcursor-devel libXrender-devel libXrandr-devel libXinerama-devel libXi-devel libXv-devel libXfixes-devel libXvMC-devel libXxf86vm-devel libxkbcommon-devel libxkbfile-devel libXdamage-devel libXp-devel libXScrnSaver-devel libXcomposite-devel libXp-devel libXres-devel libXtst-devel xorg-x11-proto-devel libXxf86dga-devel libXpm-devel perl-Digest-MD5 perl-version perl-Encode perl-Data-Dumper" + YUM_PKGS="ca-certificates make util-linux git tar bzip2 wget glibc-devel diffutils patch zip unzip alsa-lib-devel libX11-devel mesa-libGL-devel mesa-libEGL-devel mesa-libGLU-devel libXrender-devel libSM-devel libICE-devel libXcursor-devel libXrender-devel libXrandr-devel libXinerama-devel libXi-devel libXv-devel libXfixes-devel libXvMC-devel libXxf86vm-devel libxkbcommon-devel libxkbfile-devel libXdamage-devel libXp-devel libXScrnSaver-devel libXcomposite-devel libXp-devel libXres-devel libXtst-devel xorg-x11-proto-devel libXxf86dga-devel libXpm-devel perl-Digest-MD5 perl-version perl-Encode perl-Data-Dumper" SDKPREP="RUN ${PREYUM}${DTSYUM}yum -y install ${YUM_PKGS} ${YUM_DEVEL_EXTRA} && yum -y clean all" cat <&2 echo "Error: X11/Xlib.h not available (on CentOS, do 'yum install alsa-lib-devel libICE-devel libSM-devel libX11-devel libXScrnSaver-devel libXcomposite-devel libXcursor-devel libXdamage-devel libXfixes-devel libXi-devel libXinerama-devel libXp-devel libXp-devel libXpm-devel libXrandr-devel libXrender-devel libXres-devel libXtst-devel libXv-devel libXvMC-devel libXxf86dga-devel libXxf86vm-devel libxkbfile-devel mesa-libGL-devel mesa-libGLU-devel ${YUM_DEVEL_EXTRA}')") + (>&2 echo "Error: X11/Xlib.h not available (on CentOS, do 'yum install alsa-lib-devel libICE-devel libSM-devel libX11-devel libXScrnSaver-devel libXcomposite-devel libXcursor-devel libXdamage-devel libXfixes-devel libXi-devel libXinerama-devel libXp-devel libXp-devel libXpm-devel libXrandr-devel libXrender-devel libXres-devel libXtst-devel libXv-devel libXvMC-devel libXxf86dga-devel libXxf86vm-devel libxkbfile-devel mesa-libGL-devel mesa-libEGL-devel mesa-libGLU-devel ${YUM_DEVEL_EXTRA}')") error=true fi From 9e539774409991a87bfd1f2c012ae429e6d42954 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20Devernay?= Date: Sat, 4 Nov 2023 19:37:12 +0100 Subject: [PATCH 10/31] Fix Qt4 build --- Engine/Qt4/NatronEngine/recti_wrapper.cpp | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/Engine/Qt4/NatronEngine/recti_wrapper.cpp b/Engine/Qt4/NatronEngine/recti_wrapper.cpp index 7afb3c550..6b8b924f8 100644 --- a/Engine/Qt4/NatronEngine/recti_wrapper.cpp +++ b/Engine/Qt4/NatronEngine/recti_wrapper.cpp @@ -377,8 +377,12 @@ static PyObject* Sbk_RectIFunc_intersect(PyObject* self, PyObject* args) // intersect(RectI,RectI*)const // Begin code injection - RectI t; - cppSelf->intersect(*cppArg0,&t); + // Original: + //RectI t; + //cppSelf->intersect(*cppArg0,&t); + // Fix after https://github.com/NatronGitHub/Natron/pull/914 : + RectI t = cppSelf->intersect(*cppArg0); + pyResult = Shiboken::Conversions::copyToPython((SbkObjectType*)SbkNatronEngineTypes[SBK_RECTI_IDX], &t); return pyResult; @@ -403,8 +407,11 @@ static PyObject* Sbk_RectIFunc_intersect(PyObject* self, PyObject* args) // intersect(int,int,int,int,RectI*)const // Begin code injection - RectI t; - cppSelf->intersect(cppArg0,cppArg1,cppArg2,cppArg3,&t); + // Original: + //RectI t; + //cppSelf->intersect(cppArg0,cppArg1,cppArg2,cppArg3,&t); + // Fix after https://github.com/NatronGitHub/Natron/pull/914 : + RectI t = cppSelf->intersect(cppArg0,cppArg1,cppArg2,cppArg3); pyResult = Shiboken::Conversions::copyToPython((SbkObjectType*)SbkNatronEngineTypes[SBK_RECTI_IDX], &t); return pyResult; From 4a769e02ae0970c184a1c63b94f755ab23d42234 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20Devernay?= Date: Sat, 4 Nov 2023 20:07:43 +0100 Subject: [PATCH 11/31] Update rectd_wrapper.cpp --- Engine/Qt4/NatronEngine/rectd_wrapper.cpp | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/Engine/Qt4/NatronEngine/rectd_wrapper.cpp b/Engine/Qt4/NatronEngine/rectd_wrapper.cpp index 4c561a206..b3b3ade86 100644 --- a/Engine/Qt4/NatronEngine/rectd_wrapper.cpp +++ b/Engine/Qt4/NatronEngine/rectd_wrapper.cpp @@ -384,8 +384,11 @@ static PyObject* Sbk_RectDFunc_intersect(PyObject* self, PyObject* args) // intersect(RectD,RectD*)const // Begin code injection - RectD t; - cppSelf->intersect(*cppArg0,&t); + // Original: + //RectD t; + //cppSelf->intersect(*cppArg0,&t); + // Fix after https://github.com/NatronGitHub/Natron/pull/914 : + RectD t = cppSelf->intersect(*cppArg0); pyResult = Shiboken::Conversions::copyToPython((SbkObjectType*)SbkNatronEngineTypes[SBK_RECTD_IDX], &t); return pyResult; @@ -410,8 +413,11 @@ static PyObject* Sbk_RectDFunc_intersect(PyObject* self, PyObject* args) // intersect(double,double,double,double,RectD*)const // Begin code injection - RectD t; - cppSelf->intersect(cppArg0,cppArg1,cppArg2,cppArg3,&t); + // Original: + //RectD t; + //cppSelf->intersect(cppArg0,cppArg1,cppArg2,cppArg3,&t); + // Fix after https://github.com/NatronGitHub/Natron/pull/914 : + RectD t = cppSelf->intersect(cppArg0,cppArg1,cppArg2,cppArg3); pyResult = Shiboken::Conversions::copyToPython((SbkObjectType*)SbkNatronEngineTypes[SBK_RECTD_IDX], &t); return pyResult; From 4b44fb18293035873b35c3a2d2aa29da78cb8740 Mon Sep 17 00:00:00 2001 From: Aaron Colwell <300262+acolwell@users.noreply.github.com> Date: Sun, 26 Nov 2023 15:42:55 -0800 Subject: [PATCH 12/31] Fix Windows build busters. (#929) - Always include cstdint in GlobalDefines.h to avoid missing decl errors. - Change NATRON_BUILD_WORKSPACE to a shorter path to avoid path length errors that can occur during python file compilation. - Change logic in build-Windows-installer.sh related to mt.exe and the Qt Installer Framework so that these binaries could be retrieved from the Windows SDK and msys2 respectively. --- .github/workflows/build_installer.yml | 10 ++++----- Global/GlobalDefines.h | 4 +--- tools/jenkins/build-Windows-installer.sh | 27 ++++++++++++++++++------ 3 files changed, 25 insertions(+), 16 deletions(-) diff --git a/.github/workflows/build_installer.yml b/.github/workflows/build_installer.yml index 7c2207b7d..2797cb013 100644 --- a/.github/workflows/build_installer.yml +++ b/.github/workflows/build_installer.yml @@ -4,6 +4,10 @@ on: workflow_dispatch: {} push: +env: + NATRON_BUILD_WORKSPACE: 'D:/nbw' + CI: 'True' + jobs: win-installer: name: Windows Installer @@ -11,8 +15,6 @@ jobs: defaults: run: shell: msys2 {0} - env: - CI: 'True' steps: - name: Checkout branch @@ -41,7 +43,6 @@ jobs: - name: Build id: build run: | - NATRON_BUILD_WORKSPACE=${GITHUB_WORKSPACE}/natron_build NATRON_BUILD_WORKSPACE_UNIX=$(cygpath -u ${NATRON_BUILD_WORKSPACE}) mkdir ${NATRON_BUILD_WORKSPACE_UNIX} @@ -76,8 +77,6 @@ jobs: defaults: run: shell: msys2 {0} - env: - CI: 'True' steps: - name: Checkout branch @@ -106,7 +105,6 @@ jobs: - name: Build id: build run: | - NATRON_BUILD_WORKSPACE=${GITHUB_WORKSPACE}/natron_build NATRON_BUILD_WORKSPACE_UNIX=$(cygpath -u ${NATRON_BUILD_WORKSPACE}) mkdir ${NATRON_BUILD_WORKSPACE_UNIX} diff --git a/Global/GlobalDefines.h b/Global/GlobalDefines.h index 3a41fc94c..3fe45350d 100644 --- a/Global/GlobalDefines.h +++ b/Global/GlobalDefines.h @@ -26,6 +26,7 @@ #include // ***** END PYTHON BLOCK ***** +#include #include #if defined(_WIN32) #include @@ -47,9 +48,6 @@ #undef isalpha #undef isalnum -#if !defined(Q_MOC_RUN) && !defined(SBK_RUN) -#include -#endif #include #if QT_VERSION < QT_VERSION_CHECK(5, 0, 0) #include diff --git a/tools/jenkins/build-Windows-installer.sh b/tools/jenkins/build-Windows-installer.sh index d021db062..b70c9a071 100755 --- a/tools/jenkins/build-Windows-installer.sh +++ b/tools/jenkins/build-Windows-installer.sh @@ -131,14 +131,27 @@ $GSED -e "s/_VERSION_/${NATRON_VERSION_FULL}/;s#_RBVERSION_#${NATRON_GIT_BRANCH} cp "$INC_PATH/config/"*.png "$INSTALLER_PATH/config/" # make sure we have mt and qtifw -if [ ! -f "$SDK_HOME/bin/mt.exe" ] || [ ! -f "$SDK_HOME/bin/binarycreator.exe" ]; then - if [ ! -d "$SRC_PATH/natron-windows-installer" ]; then - ( cd "$SRC_PATH"; - $CURL "$THIRD_PARTY_BIN_URL/natron-windows-installer.zip" --output "$SRC_PATH/natron-windows-installer.zip" - unzip natron-windows-installer.zip - ) + +if ! which mt.exe; then + # Add Windows SDK to path so that mt.exe is available. + WIN_SDK_MAJOR_VERSION=10 + WIN_SDK_BASE_PATH="/c/Program Files (x86)/Windows Kits/${WIN_SDK_MAJOR_VERSION}/bin" + WIN_SDK_VERSION=$(ls "${WIN_SDK_BASE_PATH}" | grep "${WIN_SDK_MAJOR_VERSION}." | sort -n | tail -1) + PATH="${WIN_SDK_BASE_PATH}/${WIN_SDK_VERSION}/x64/":${PATH} + + if ! which mt.exe; then + echo "Failed to find mt.exe" + exit 1 + fi +fi + +if ! which binarycreator.exe && [ ! -f "/Setup.exe" ]; then + pacman -S mingw-w64-x86_64-qt-installer-framework + + if ! which binarycreator.exe; then + echo "Failed to find binarycreator.exe" + exit 1 fi - cp "$SRC_PATH/natron-windows-installer/mingw$BITS/bin/"{archivegen.exe,binarycreator.exe,installerbase.exe,installerbase.manifest,repogen.exe,mt.exe} "$SDK_HOME/bin/" fi function installPlugin() { From 69ab44fc7ec98fed36480b3f8ca7782c1965cc5c Mon Sep 17 00:00:00 2001 From: Aaron Colwell <300262+acolwell@users.noreply.github.com> Date: Sun, 26 Nov 2023 15:43:43 -0800 Subject: [PATCH 13/31] Fix asserts and build buster in debug build. (#930) - Fixed assert() in Tests/FileSystemModel_Test.cpp that broke the debug build. - Fixed asserts in Engine/EffectInstanceRenderRoI.cpp so that they are only checked if tiling is supported. The assert was accidentally applied to all cases when the code was refactored by https://github.com/NatronGitHub/Natron/pull/918 - Updated Linux CI to build and test release AND debug builds. This should help avoid such issues from sneaking in going forward. --- .github/workflows/ci.yml | 41 ++++++++++++++++++++---------- Engine/EffectInstanceRenderRoI.cpp | 16 +++++++----- Tests/FileSystemModel_Test.cpp | 8 +++--- 3 files changed, 41 insertions(+), 24 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 41bc38f7f..a473a4a62 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -66,34 +66,49 @@ jobs: tar xzf Natron-v${OCIO_CONFIG_VERSION}.tar.gz mv OpenColorIO-Configs-Natron-v${OCIO_CONFIG_VERSION} OpenColorIO-Configs - - name: Build Unix + - name: Download Plugins run: | - mkdir build && cd build - cmake ../ + mkdir Plugins && cd Plugins + wget https://github.com/NatronGitHub/openfx-io/releases/download/natron_testing/openfx-io-build-ubuntu_22-testing.zip + unzip openfx-io-build-ubuntu_22-testing.zip + cd .. + + - name: Build Unix (debug) + run: | + mkdir debug && cd debug + cmake -DCMAKE_BUILD_TYPE=Debug ../ make -j2 - - name: Run Unix Tests - id: run-unix-tests + - name: Run Unix Tests (debug) + id: run-unix-tests-debug # Allow continuing after error so logs can be uploaded. continue-on-error: true run: | - cd build + cd debug + OFX_PLUGIN_PATH=$PWD/../Plugins OCIO=$PWD/../OpenColorIO-Configs/blender/config.ocio ctest -V - mkdir Plugins && cd Plugins - wget https://github.com/NatronGitHub/openfx-io/releases/download/natron_testing/openfx-io-build-ubuntu_22-testing.zip - unzip openfx-io-build-ubuntu_22-testing.zip - cd .. + - name: Build Unix (release) + run: | + mkdir release && cd release + cmake ../ + make -j2 - OFX_PLUGIN_PATH=$PWD/Plugins OCIO=$PWD/../OpenColorIO-Configs/blender/config.ocio ctest -V + - name: Run Unix Tests (release) + id: run-unix-tests-release + # Allow continuing after error so logs can be uploaded. + continue-on-error: true + run: | + cd release + OFX_PLUGIN_PATH=$PWD/../Plugins OCIO=$PWD/../OpenColorIO-Configs/blender/config.ocio ctest -V - name: Upload ${{ matrix.os }} Test Log artifacts uses: actions/upload-artifact@v3 with: name: ${{ matrix.os }} Test Logs - path: ${{ github.workspace }}/build/Testing/Temporary/LastTest.log + path: ${{ github.workspace }}/release/Testing/Temporary/LastTest.log - name: Check for test failures - if: steps.run-unix-tests.outcome == 'failure' + if: steps.run-unix-tests-debug.outcome == 'failure' || steps.run-unix-tests-release.outcome == 'failure' run: exit 1 win-test: diff --git a/Engine/EffectInstanceRenderRoI.cpp b/Engine/EffectInstanceRenderRoI.cpp index a9a614135..dcaa11088 100644 --- a/Engine/EffectInstanceRenderRoI.cpp +++ b/Engine/EffectInstanceRenderRoI.cpp @@ -737,17 +737,21 @@ EffectInstance::renderRoI(const RenderRoIArgs & args, //renderRoIInternal should check the bitmap of 'image' and not downscaledImage! roi = args.roi.toNewMipmapLevel(args.mipmapLevel, 0, par, rod); - if (frameArgs->tilesSupported && !roi.clipIfOverlaps(upscaledImageBoundsNc)) { - return eRenderRoIRetCodeOk; + if (frameArgs->tilesSupported) { + if (!roi.clipIfOverlaps(upscaledImageBoundsNc)) { + return eRenderRoIRetCodeOk; + } + assert(upscaledImageBoundsNc.contains(roi)); } - assert( upscaledImageBoundsNc.contains(roi)); } else { roi = args.roi; - if (frameArgs->tilesSupported && !roi.clipIfOverlaps(downscaledImageBoundsNc)) { - return eRenderRoIRetCodeOk; + if (frameArgs->tilesSupported) { + if (!roi.clipIfOverlaps(downscaledImageBoundsNc)) { + return eRenderRoIRetCodeOk; + } + assert(downscaledImageBoundsNc.contains(roi)); } - assert(downscaledImageBoundsNc.contains(roi)); } /* diff --git a/Tests/FileSystemModel_Test.cpp b/Tests/FileSystemModel_Test.cpp index 9ea83ab40..9d7e09b3f 100644 --- a/Tests/FileSystemModel_Test.cpp +++ b/Tests/FileSystemModel_Test.cpp @@ -249,10 +249,8 @@ TEST(FileSystemModelTest, CleanPath) { expectedOutput = testCase.input; } #endif - // Make sure the expectation was actually set to something. - assert(!expectedOutput.isNull()); - - const auto output = FileSystemModel::cleanPath(input).toStdString(); - EXPECT_EQ(expectedOutput, output) << " input '" << testCase.input << "'"; + const QString output = FileSystemModel::cleanPath(input); + ASSERT_TRUE(!output.isNull()); + EXPECT_EQ(expectedOutput, output.toStdString()) << " input '" << testCase.input << "'"; } } \ No newline at end of file From 2acaa84d149de5c2e0c6b7512a73b9a3cae5fd18 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20Devernay?= Date: Tue, 28 Nov 2023 16:24:22 +0100 Subject: [PATCH 14/31] MacPorts update --- tools/MacPorts/devel/gnutls/Portfile | 8 +- tools/MacPorts/devel/gnutls/Portfile.orig | 8 +- tools/MacPorts/graphics/opencolorio/Portfile | 42 +--- .../graphics/opencolorio/Portfile.orig | 40 +--- .../graphics/opencolorio/Portfile.patch | 57 ++--- tools/MacPorts/lang/libomp/Portfile.orig | 10 +- tools/MacPorts/lang/libomp/Portfile.patch | 89 +++++++- tools/MacPorts/multimedia/ffmpeg/Portfile | 6 + .../MacPorts/multimedia/ffmpeg/Portfile.orig | 6 + .../ffmpeg/files/patch-texinfo-7.diff | 207 ++++++++++++++++++ tools/MacPorts/print/ghostscript/Portfile | 10 +- .../MacPorts/print/ghostscript/Portfile.orig | 10 +- 12 files changed, 353 insertions(+), 140 deletions(-) create mode 100644 tools/MacPorts/multimedia/ffmpeg/files/patch-texinfo-7.diff diff --git a/tools/MacPorts/devel/gnutls/Portfile b/tools/MacPorts/devel/gnutls/Portfile index 3467702d7..0f5376110 100644 --- a/tools/MacPorts/devel/gnutls/Portfile +++ b/tools/MacPorts/devel/gnutls/Portfile @@ -36,12 +36,12 @@ subport ${name} { subport ${name}-devel { conflicts ${name} - version 3.8.1 + version 3.8.2 revision 0 - checksums rmd160 d9a09dec344ec897e7abaf408ba93e25e91ca2ad \ - sha256 ba8b9e15ae20aba88f44661978f5b5863494316fe7e722ede9d069fe6294829c \ - size 6447056 + checksums rmd160 94154bab53fef5b66365cb8ebd9caa616e3ed741 \ + sha256 e765e5016ffa9b9dd243e363a0460d577074444ee2491267db2e96c9c2adef77 \ + size 6456540 patchfiles patch-lib-system-certs.c.diff } diff --git a/tools/MacPorts/devel/gnutls/Portfile.orig b/tools/MacPorts/devel/gnutls/Portfile.orig index b9b1c28c1..c2cce9f66 100644 --- a/tools/MacPorts/devel/gnutls/Portfile.orig +++ b/tools/MacPorts/devel/gnutls/Portfile.orig @@ -36,12 +36,12 @@ subport ${name} { subport ${name}-devel { conflicts ${name} - version 3.8.1 + version 3.8.2 revision 0 - checksums rmd160 d9a09dec344ec897e7abaf408ba93e25e91ca2ad \ - sha256 ba8b9e15ae20aba88f44661978f5b5863494316fe7e722ede9d069fe6294829c \ - size 6447056 + checksums rmd160 94154bab53fef5b66365cb8ebd9caa616e3ed741 \ + sha256 e765e5016ffa9b9dd243e363a0460d577074444ee2491267db2e96c9c2adef77 \ + size 6456540 patchfiles patch-lib-system-certs.c.diff } diff --git a/tools/MacPorts/graphics/opencolorio/Portfile b/tools/MacPorts/graphics/opencolorio/Portfile index d39a5c362..83517e932 100644 --- a/tools/MacPorts/graphics/opencolorio/Portfile +++ b/tools/MacPorts/graphics/opencolorio/Portfile @@ -87,7 +87,7 @@ if {${configure.build_arch} in [list ppc ppc64]} { # OpenColorIO intentially installs Python module in lib # see https://github.com/imageworks/OpenColorIO/blob/15e96c1f579d3640947a5fcb5ec831383cc3956e/src/pyglue/CMakeLists.txt#L85 -variant python27 description {Build the Python 2.7 bindings} conflicts python36 python37 python38 python39 python310 python311 { +variant python27 description {Build the Python 2.7 bindings} conflicts python38 python39 python310 python311 { depends_lib-append port:python27 port:py27-pybind11 configure.args-append \ -DOCIO_PYTHON_VERSION=2.7 \ @@ -101,35 +101,7 @@ variant python27 description {Build the Python 2.7 bindings} conflicts python36 } } -variant python36 description {Build the Python 3.6 bindings} conflicts python27 python37 python38 python39 python310 python311 { - depends_lib-append port:python36 port:py36-pybind11 - configure.args-append \ - -DOCIO_PYTHON_VERSION=3.6 \ - -DPYTHON=${prefix}/bin/python3.6 - post-destroot { - xinstall -d -m 0755 \ - ${destroot}${frameworks_dir}/Python.framework/Versions/3.6/lib/python3.6/site-packages - ln -s \ - ${prefix}/lib/python3.6/site-packages/PyOpenColorIO.so \ - ${destroot}${frameworks_dir}/Python.framework/Versions/3.6/lib/python3.6/site-packages/ - } -} - -variant python37 description {Build the Python 3.7 bindings} conflicts python27 python36 python38 python39 python310 python311 { - depends_lib-append port:python37 port:py37-pybind11 - configure.args-append \ - -DOCIO_PYTHON_VERSION=3.7 \ - -DPYTHON=${prefix}/bin/python3.7 - post-destroot { - xinstall -d -m 0755 \ - ${destroot}${frameworks_dir}/Python.framework/Versions/3.7/lib/python3.7/site-packages - ln -s \ - ${prefix}/lib/python3.7/site-packages/PyOpenColorIO.so \ - ${destroot}${frameworks_dir}/Python.framework/Versions/3.7/lib/python3.7/site-packages/ - } -} - -variant python38 description {Build the Python 3.8 bindings} conflicts python27 python36 python37 python39 python310 python311 { +variant python38 description {Build the Python 3.8 bindings} conflicts python27 python39 python310 python311 { depends_lib-append port:python38 port:py38-pybind11 configure.args-append \ -DOCIO_PYTHON_VERSION=3.8 \ @@ -143,7 +115,7 @@ variant python38 description {Build the Python 3.8 bindings} conflicts python27 } } -variant python39 description {Build the Python 3.9 bindings} conflicts python27 python36 python37 python38 python310 python311 { +variant python39 description {Build the Python 3.9 bindings} conflicts python27 python38 python310 python311 { depends_lib-append port:python39 port:py39-pybind11 configure.args-append \ -DOCIO_PYTHON_VERSION=3.9 \ @@ -157,7 +129,7 @@ variant python39 description {Build the Python 3.9 bindings} conflicts python27 } } -variant python310 description {Build the Python 3.10 bindings} conflicts python27 python36 python37 python38 python39 python311 { +variant python310 description {Build the Python 3.10 bindings} conflicts python27 python38 python39 python311 { depends_lib-append port:python310 port:py310-pybind11 configure.args-append \ -DOCIO_PYTHON_VERSION=3.10 \ @@ -172,7 +144,7 @@ variant python310 description {Build the Python 3.10 bindings} conflicts python2 } -variant python311 description {Build the Python 3.11 bindings} conflicts python27 python36 python37 python38 python39 python310 { +variant python311 description {Build the Python 3.11 bindings} conflicts python27 python38 python39 python310 { depends_lib-append port:python311 port:py311-pybind11 configure.args-append \ -DOCIO_PYTHON_VERSION=3.11 \ @@ -186,11 +158,11 @@ variant python311 description {Build the Python 3.11 bindings} conflicts python2 } } -if {![variant_isset python27] && ![variant_isset python36] && ![variant_isset python37] && ![variant_isset python38] && ![variant_isset python39] && ![variant_isset python310] && ![variant_isset python311]} { +if {![variant_isset python27] && ![variant_isset python38] && ![variant_isset python39] && ![variant_isset python310] && ![variant_isset python311]} { default_variants +python311 } -if {![variant_isset python27] && ![variant_isset python36] && ![variant_isset python37] && ![variant_isset python38] && ![variant_isset python39] && ![variant_isset python310] && ![variant_isset python311]} { +if {![variant_isset python27] && ![variant_isset python38] && ![variant_isset python39] && ![variant_isset python310] && ![variant_isset python311]} { configure.args-append \ -DOCIO_BUILD_PYTHON=OFF \ -DOCIO_BUILD_PYGLUE=OFF diff --git a/tools/MacPorts/graphics/opencolorio/Portfile.orig b/tools/MacPorts/graphics/opencolorio/Portfile.orig index da0f81d92..4aef71ac0 100644 --- a/tools/MacPorts/graphics/opencolorio/Portfile.orig +++ b/tools/MacPorts/graphics/opencolorio/Portfile.orig @@ -106,7 +106,7 @@ if {${configure.build_arch} in [list ppc ppc64]} { # OpenColorIO intentially installs Python module in lib # see https://github.com/imageworks/OpenColorIO/blob/15e96c1f579d3640947a5fcb5ec831383cc3956e/src/pyglue/CMakeLists.txt#L85 -variant python27 description {Build the Python 2.7 bindings} conflicts python36 python37 python38 python39 python310 python311 { +variant python27 description {Build the Python 2.7 bindings} conflicts python38 python39 python310 python311 { depends_lib-append port:python27 configure.args-append \ -DPYTHON=${prefix}/bin/python2.7 @@ -119,33 +119,7 @@ variant python27 description {Build the Python 2.7 bindings} conflicts python36 } } -variant python36 description {Build the Python 3.6 bindings} conflicts python27 python37 python38 python39 python310 python311 { - depends_lib-append port:python36 - configure.args-append \ - -DPYTHON=${prefix}/bin/python3.6 - post-destroot { - xinstall -d -m 0755 \ - ${destroot}${frameworks_dir}/Python.framework/Versions/3.6/lib/python3.6/site-packages - ln -s \ - ${prefix}/lib/python3.6/site-packages/PyOpenColorIO.so \ - ${destroot}${frameworks_dir}/Python.framework/Versions/3.6/lib/python3.6/site-packages/ - } -} - -variant python37 description {Build the Python 3.7 bindings} conflicts python27 python36 python38 python39 python310 python311 { - depends_lib-append port:python37 - configure.args-append \ - -DPYTHON=${prefix}/bin/python3.7 - post-destroot { - xinstall -d -m 0755 \ - ${destroot}${frameworks_dir}/Python.framework/Versions/3.7/lib/python3.7/site-packages - ln -s \ - ${prefix}/lib/python3.7/site-packages/PyOpenColorIO.so \ - ${destroot}${frameworks_dir}/Python.framework/Versions/3.7/lib/python3.7/site-packages/ - } -} - -variant python38 description {Build the Python 3.8 bindings} conflicts python27 python36 python37 python39 python310 python311 { +variant python38 description {Build the Python 3.8 bindings} conflicts python27 python39 python310 python311 { depends_lib-append port:python38 configure.args-append \ -DPYTHON=${prefix}/bin/python3.8 @@ -158,7 +132,7 @@ variant python38 description {Build the Python 3.8 bindings} conflicts python27 } } -variant python39 description {Build the Python 3.9 bindings} conflicts python27 python36 python37 python38 python310 python311 { +variant python39 description {Build the Python 3.9 bindings} conflicts python27 python38 python310 python311 { depends_lib-append port:python39 configure.args-append \ -DPYTHON=${prefix}/bin/python3.9 @@ -171,7 +145,7 @@ variant python39 description {Build the Python 3.9 bindings} conflicts python27 } } -variant python310 description {Build the Python 3.10 bindings} conflicts python27 python36 python37 python38 python39 python311 { +variant python310 description {Build the Python 3.10 bindings} conflicts python27 python38 python39 python311 { depends_lib-append port:python310 configure.args-append \ -DPYTHON=${prefix}/bin/python3.10 @@ -185,7 +159,7 @@ variant python310 description {Build the Python 3.10 bindings} conflicts python2 } -variant python311 description {Build the Python 3.11 bindings} conflicts python27 python36 python37 python38 python39 python310 { +variant python311 description {Build the Python 3.11 bindings} conflicts python27 python38 python39 python310 { depends_lib-append port:python311 configure.args-append \ -DPYTHON=${prefix}/bin/python3.11 @@ -198,11 +172,11 @@ variant python311 description {Build the Python 3.11 bindings} conflicts python2 } } -if {![variant_isset python27] && ![variant_isset python36] && ![variant_isset python37] && ![variant_isset python38] && ![variant_isset python39] && ![variant_isset python310] && ![variant_isset python311]} { +if {![variant_isset python27] && ![variant_isset python38] && ![variant_isset python39] && ![variant_isset python310] && ![variant_isset python311]} { default_variants +python311 } -if {![variant_isset python27] && ![variant_isset python36] && ![variant_isset python37] && ![variant_isset python38] && ![variant_isset python39] && ![variant_isset python310] && ![variant_isset python311]} { +if {![variant_isset python27] && ![variant_isset python38] && ![variant_isset python39] && ![variant_isset python310] && ![variant_isset python311]} { configure.args-append \ -DOCIO_BUILD_PYGLUE=OFF } diff --git a/tools/MacPorts/graphics/opencolorio/Portfile.patch b/tools/MacPorts/graphics/opencolorio/Portfile.patch index 7222366f9..1e0bb5992 100644 --- a/tools/MacPorts/graphics/opencolorio/Portfile.patch +++ b/tools/MacPorts/graphics/opencolorio/Portfile.patch @@ -1,5 +1,5 @@ ---- Portfile.orig 2023-08-29 21:57:17 -+++ Portfile 2023-08-29 21:58:24 +--- Portfile.orig 2023-11-28 15:59:17.000000000 +0100 ++++ Portfile 2023-11-28 16:02:49.000000000 +0100 @@ -7,7 +7,7 @@ boost.depends_type build @@ -22,7 +22,7 @@ # Exclude pre-releases from livecheck github.livecheck.regex {([0-9.]+)} -@@ -31,31 +31,9 @@ +@@ -31,30 +31,8 @@ configure.args-append \ -DCMAKE_CONFIGURATION_TYPES=MacPorts @@ -31,9 +31,7 @@ -if {${os.platform} eq "darwin" && ${os.major} < 20} { - github.setup AcademySoftwareFoundation OpenColorIO 1.1.1 v - revision 3 -+patchfiles-append \ -+ patch-OCIOZArchive.diff - +- - checksums rmd160 81534822cb8350e1b7ba171c91226de996494d02 \ - sha256 b7def3b5383c9b35dc9c0bdd26da74e2199c2b283d52bb84847aa307f70a0bc4 \ - size 13830493 @@ -52,10 +50,11 @@ - - livecheck.type none -} -- ++patchfiles-append \ ++ patch-OCIOZArchive.diff + # source assumes C++11 compiler compiler.cxx_standard 2011 - configure.cxxflags-append \ @@ -93,6 +71,9 @@ port:tinyxml @@ -69,7 +68,7 @@ @@ -107,8 +88,9 @@ # see https://github.com/imageworks/OpenColorIO/blob/15e96c1f579d3640947a5fcb5ec831383cc3956e/src/pyglue/CMakeLists.txt#L85 - variant python27 description {Build the Python 2.7 bindings} conflicts python36 python37 python38 python39 python310 python311 { + variant python27 description {Build the Python 2.7 bindings} conflicts python38 python39 python310 python311 { - depends_lib-append port:python27 + depends_lib-append port:python27 port:py27-pybind11 configure.args-append \ @@ -80,29 +79,7 @@ @@ -120,8 +102,9 @@ } - variant python36 description {Build the Python 3.6 bindings} conflicts python27 python37 python38 python39 python310 python311 { -- depends_lib-append port:python36 -+ depends_lib-append port:python36 port:py36-pybind11 - configure.args-append \ -+ -DOCIO_PYTHON_VERSION=3.6 \ - -DPYTHON=${prefix}/bin/python3.6 - post-destroot { - xinstall -d -m 0755 \ -@@ -133,8 +116,9 @@ - } - - variant python37 description {Build the Python 3.7 bindings} conflicts python27 python36 python38 python39 python310 python311 { -- depends_lib-append port:python37 -+ depends_lib-append port:python37 port:py37-pybind11 - configure.args-append \ -+ -DOCIO_PYTHON_VERSION=3.7 \ - -DPYTHON=${prefix}/bin/python3.7 - post-destroot { - xinstall -d -m 0755 \ -@@ -146,8 +130,9 @@ - } - - variant python38 description {Build the Python 3.8 bindings} conflicts python27 python36 python37 python39 python310 python311 { + variant python38 description {Build the Python 3.8 bindings} conflicts python27 python39 python310 python311 { - depends_lib-append port:python38 + depends_lib-append port:python38 port:py38-pybind11 configure.args-append \ @@ -110,10 +87,10 @@ -DPYTHON=${prefix}/bin/python3.8 post-destroot { xinstall -d -m 0755 \ -@@ -159,8 +144,9 @@ +@@ -133,8 +116,9 @@ } - variant python39 description {Build the Python 3.9 bindings} conflicts python27 python36 python37 python38 python310 python311 { + variant python39 description {Build the Python 3.9 bindings} conflicts python27 python38 python310 python311 { - depends_lib-append port:python39 + depends_lib-append port:python39 port:py39-pybind11 configure.args-append \ @@ -121,10 +98,10 @@ -DPYTHON=${prefix}/bin/python3.9 post-destroot { xinstall -d -m 0755 \ -@@ -172,8 +158,9 @@ +@@ -146,8 +130,9 @@ } - variant python310 description {Build the Python 3.10 bindings} conflicts python27 python36 python37 python38 python39 python311 { + variant python310 description {Build the Python 3.10 bindings} conflicts python27 python38 python39 python311 { - depends_lib-append port:python310 + depends_lib-append port:python310 port:py310-pybind11 configure.args-append \ @@ -132,10 +109,10 @@ -DPYTHON=${prefix}/bin/python3.10 post-destroot { xinstall -d -m 0755 \ -@@ -186,8 +173,9 @@ +@@ -160,8 +145,9 @@ - variant python311 description {Build the Python 3.11 bindings} conflicts python27 python36 python37 python38 python39 python310 { + variant python311 description {Build the Python 3.11 bindings} conflicts python27 python38 python39 python310 { - depends_lib-append port:python311 + depends_lib-append port:python311 port:py311-pybind11 configure.args-append \ @@ -143,9 +120,9 @@ -DPYTHON=${prefix}/bin/python3.11 post-destroot { xinstall -d -m 0755 \ -@@ -204,6 +192,7 @@ +@@ -178,6 +164,7 @@ - if {![variant_isset python27] && ![variant_isset python36] && ![variant_isset python37] && ![variant_isset python38] && ![variant_isset python39] && ![variant_isset python310] && ![variant_isset python311]} { + if {![variant_isset python27] && ![variant_isset python38] && ![variant_isset python39] && ![variant_isset python310] && ![variant_isset python311]} { configure.args-append \ + -DOCIO_BUILD_PYTHON=OFF \ -DOCIO_BUILD_PYGLUE=OFF diff --git a/tools/MacPorts/lang/libomp/Portfile.orig b/tools/MacPorts/lang/libomp/Portfile.orig index 64a4e6f30..2fa916192 100644 --- a/tools/MacPorts/lang/libomp/Portfile.orig +++ b/tools/MacPorts/lang/libomp/Portfile.orig @@ -86,8 +86,14 @@ if {${os.platform} eq "darwin" && ${configure.cxx_stdlib} ne "libstdc++"} { worksrcdir openmp-${version}/final/runtime version 3.8.1 checksums rmd160 a41054068a127ef84610afef8090109078cb6c46 \ - sha256 4c46b5946fe9b2a701661746d11c7c85c51a7f18673194a7ebd2a43470948a34 + sha256 4c46b5946fe9b2a701661746d11c7c85c51a7f18673194a7ebd2a43470948a34 \ + size 5587986 set rtpath "./" + + # use cmake-bootstrap to minimize dependencies. + depends_build-replace \ + path:bin/cmake:cmake port:cmake-bootstrap + configure.cmd ${prefix}/libexec/cmake-bootstrap/bin/cmake } livecheck.type none } @@ -101,7 +107,7 @@ compiler.blacklist-append {clang < 500} *gcc* # https://trac.macports.org/ticket/68490# # Use clang-11-bootstrap on OSX10.11 and older if {${os.major} <= 15} { - compiler.blacklist-append clang *gcc* + configure.compiler.add_deps no depends_build-append port:clang-11-bootstrap depends_skip_archcheck-append clang-11-bootstrap pre-configure { diff --git a/tools/MacPorts/lang/libomp/Portfile.patch b/tools/MacPorts/lang/libomp/Portfile.patch index 7b318430a..8390d060c 100644 --- a/tools/MacPorts/lang/libomp/Portfile.patch +++ b/tools/MacPorts/lang/libomp/Portfile.patch @@ -1,5 +1,5 @@ ---- Portfile.orig 2023-10-31 09:50:26 -+++ Portfile 2023-10-31 09:50:26 +--- Portfile.orig 2023-11-28 15:57:54.000000000 +0100 ++++ Portfile 2023-11-04 17:46:40.000000000 +0100 @@ -1,7 +1,7 @@ # -*- coding: utf-8; mode: tcl; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- vim:fenc=utf-8:ft=tcl:et:sw=4:ts=4:sts=4 @@ -18,7 +18,48 @@ components required to build an executing OpenMP\ program that are outside the compiler itself. \ This port works with MacPorts' clang-3.7+ (optionally \ -@@ -62,34 +62,40 @@ +@@ -29,30 +29,21 @@ + subport libomp-devel {} + + if {${os.platform} eq "darwin" && ${configure.cxx_stdlib} ne "libstdc++"} { +- +- version 17.0.3 +- revision 0 +- + if { ${subport} eq "libomp-devel" } { +- # Marked obsolete 10/25/2022 +- PortGroup obsolete 1.0 +- replaced_by libomp ++ version 11.1.0 ++ checksums rmd160 8869b60844901466aed4e462ae8dac831bf519c3 \ ++ sha256 d187483b75b39acb3ff8ea1b7d98524d95322e3cb148842957e9b0fbb866052e \ ++ size 971628 ++ livecheck.regex {"llvmorg-([0-9.rc-]+)".*} + } else { ++ version 11.1.0 ++ checksums rmd160 8869b60844901466aed4e462ae8dac831bf519c3 \ ++ sha256 d187483b75b39acb3ff8ea1b7d98524d95322e3cb148842957e9b0fbb866052e \ ++ size 971628 + livecheck.regex {"llvmorg-([0-9.]+)".*} + } + +- distname openmp-${version}.src +- distfiles ${distname}.tar.xz cmake-${version}.src.tar.xz +- +- checksums \ +- openmp-${version}.src.tar.xz \ +- rmd160 a79350f38202f4e9819373a433b1b19cef631eb2 \ +- sha256 e04172c067f256d06cd8112abb49bc65f4e1d986a4b49b36cd837dfee3cdd274 \ +- size 1273276 \ +- cmake-${version}.src.tar.xz \ +- rmd160 2f419efae4d3f8c9d87943cf1873031468a19bd7 \ +- sha256 54fc534f0da09088adbaa6c3bfc9899a500153b96e60c2fb9322a7aa37b1027a \ +- size 8712 ++ revision 0 + + if {${os.major} <= 12} { + # kmp_alloc.c includes but libc++ is not the default on +@@ -62,40 +53,40 @@ # Build requires std::atomic configure.cxxflags-append -std=c++11 @@ -65,8 +106,14 @@ - worksrcdir openmp-${version}/final/runtime - version 3.8.1 - checksums rmd160 a41054068a127ef84610afef8090109078cb6c46 \ -- sha256 4c46b5946fe9b2a701661746d11c7c85c51a7f18673194a7ebd2a43470948a34 +- sha256 4c46b5946fe9b2a701661746d11c7c85c51a7f18673194a7ebd2a43470948a34 \ +- size 5587986 - set rtpath "./" +- +- # use cmake-bootstrap to minimize dependencies. +- depends_build-replace \ +- path:bin/cmake:cmake port:cmake-bootstrap +- configure.cmd ${prefix}/libexec/cmake-bootstrap/bin/cmake + worksrcdir openmp-${version}/final/runtime + version 3.8.1 + checksums \ @@ -79,25 +126,43 @@ } depends_build-append port:perl5 -@@ -127,15 +133,9 @@ +@@ -104,18 +95,6 @@ + # According to documentation builds with clang >= 3.3 + compiler.blacklist-append {clang < 500} *gcc* + +-# https://trac.macports.org/ticket/68490# +-# Use clang-11-bootstrap on OSX10.11 and older +-if {${os.major} <= 15} { +- configure.compiler.add_deps no +- depends_build-append port:clang-11-bootstrap +- depends_skip_archcheck-append clang-11-bootstrap +- pre-configure { +- configure.cc ${prefix}/libexec/clang-11-bootstrap/bin/clang +- configure.cxx ${prefix}/libexec/clang-11-bootstrap/bin/clang++ +- } +-} +- + if {${os.major} <= 17} { + default_variants +universal + } +@@ -133,14 +112,8 @@ # With this, cmake sets the correct library name in the dylibs for the # final destination we move them to configure.args-append -DCMAKE_INSTALL_RPATH=${prefix}/lib/libomp \ - -DCMAKE_INSTALL_NAME_DIR=${prefix}/lib/libomp -+ -DCMAKE_INSTALL_NAME_DIR=${prefix}/lib/libomp \ -+ -DLIBOMP_OMPT_SUPPORT=FALSE - +- -if {${os.major} <= 10} { - set hnames {omp.h} - configure.args-append -DLIBOMP_OMPT_SUPPORT=FALSE -} else { - set hnames {omp-tools.h omp.h ompt.h} -} -- ++ -DCMAKE_INSTALL_NAME_DIR=${prefix}/lib/libomp \ ++ -DLIBOMP_OMPT_SUPPORT=FALSE + variant top_level description \ "Install (links to) omp.h and libs into ${prefix}/(include|lib)" {} - -@@ -143,30 +143,22 @@ +@@ -149,30 +122,22 @@ # Patch tool for build with CMAKE_INSTALL_PREFIX reinplace "/bulk.*compatibility/s/s\+/s+.*/" \ ${rtpath}tools/check-depends.pl @@ -132,7 +197,7 @@ foreach p {libiomp5.dylib libomp.dylib libgomp.dylib} { system -W ${instdest}/lib/ \ "ln -s libomp/${p}" -@@ -174,8 +166,8 @@ +@@ -180,8 +145,8 @@ } set fpath ${worksrcpath}/${rtpath} diff --git a/tools/MacPorts/multimedia/ffmpeg/Portfile b/tools/MacPorts/multimedia/ffmpeg/Portfile index bd53a007b..e71491f41 100644 --- a/tools/MacPorts/multimedia/ffmpeg/Portfile +++ b/tools/MacPorts/multimedia/ffmpeg/Portfile @@ -121,6 +121,12 @@ patchfiles-append patch-issue-9439-non-b-frame-encoding.diff # Fixed via upstream commit: 031f1561cd286596cdb374da32f8aa816ce3b135 patchfiles-append patch-libavcodec-libsvtav1-ten_bit_format.diff +# Patch for building docs with texinfo >= 7 +# https://trac.macports.org/ticket/68747 +# https://trac.ffmpeg.org/ticket/10636 +# Fixed via upstream commit: f01fdedb69e4accb1d1555106d8f682ff1f1ddc7 +patchfiles-append patch-texinfo-7.diff + # enable auto configure of asm optimizations # requires Xcode 3.1 or better on Leopard minimum_xcodeversions {9 3.1} diff --git a/tools/MacPorts/multimedia/ffmpeg/Portfile.orig b/tools/MacPorts/multimedia/ffmpeg/Portfile.orig index 4582698a0..0de8bcc2e 100644 --- a/tools/MacPorts/multimedia/ffmpeg/Portfile.orig +++ b/tools/MacPorts/multimedia/ffmpeg/Portfile.orig @@ -119,6 +119,12 @@ patchfiles-append patch-issue-9439-non-b-frame-encoding.diff # Fixed via upstream commit: 031f1561cd286596cdb374da32f8aa816ce3b135 patchfiles-append patch-libavcodec-libsvtav1-ten_bit_format.diff +# Patch for building docs with texinfo >= 7 +# https://trac.macports.org/ticket/68747 +# https://trac.ffmpeg.org/ticket/10636 +# Fixed via upstream commit: f01fdedb69e4accb1d1555106d8f682ff1f1ddc7 +patchfiles-append patch-texinfo-7.diff + # enable auto configure of asm optimizations # requires Xcode 3.1 or better on Leopard minimum_xcodeversions {9 3.1} diff --git a/tools/MacPorts/multimedia/ffmpeg/files/patch-texinfo-7.diff b/tools/MacPorts/multimedia/ffmpeg/files/patch-texinfo-7.diff new file mode 100644 index 000000000..8b8652ca2 --- /dev/null +++ b/tools/MacPorts/multimedia/ffmpeg/files/patch-texinfo-7.diff @@ -0,0 +1,207 @@ +Backported from the below upstream commit. + +From f01fdedb69e4accb1d1555106d8f682ff1f1ddc7 Mon Sep 17 00:00:00 2001 +From: Frank Plowman +Date: Wed, 8 Nov 2023 07:55:18 +0000 +Subject: [PATCH 1/1] doc/html: support texinfo 7.0 + +Resolves trac ticket #10636 (http://trac.ffmpeg.org/ticket/10636). + +Texinfo 7.0, released in November 2022, changed the names of various +functions. Compiling docs with Texinfo 7.0 resulted in warnings and +improperly formatted documentation. More old names appear to have +been removed in Texinfo 7.1, released October 2023, which causes docs +compilation to fail. + +This commit addresses the issue by adding logic to switch between the old +and new function names depending on the Texinfo version. Texinfo 6.8 +produces identical documentation before and after the patch. + +CC +https://www.mail-archive.com/debian-bugs-dist@lists.debian.org/msg1938238.html +https://bugs.gentoo.org/916104 + +Signed-off-by: Frank Plowman +--- + doc/t2h.pm | 106 ++++++++++++++++++++++++++++++++++++++++++----------- + 1 file changed, 85 insertions(+), 21 deletions(-) + +diff --git a/doc/t2h.pm b/doc/t2h.pm +index d07d974286..b7485e1f1e 100644 +--- doc/t2h.pm 2023-04-12 14:01:50 ++++ doc/t2h.pm 2023-11-21 13:32:35 +@@ -20,8 +20,45 @@ + # License along with FFmpeg; if not, write to the Free Software + # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + ++# Texinfo 7.0 changed the syntax of various functions. ++# Provide a shim for older versions. ++sub ff_set_from_init_file($$) { ++ my $key = shift; ++ my $value = shift; ++ if (exists &{'texinfo_set_from_init_file'}) { ++ texinfo_set_from_init_file($key, $value); ++ } else { ++ set_from_init_file($key, $value); ++ } ++} ++ ++sub ff_get_conf($) { ++ my $key = shift; ++ if (exists &{'texinfo_get_conf'}) { ++ texinfo_get_conf($key); ++ } else { ++ get_conf($key); ++ } ++} ++ ++sub get_formatting_function($$) { ++ my $obj = shift; ++ my $func = shift; ++ ++ my $sub = $obj->can('formatting_function'); ++ if ($sub) { ++ return $obj->formatting_function($func); ++ } else { ++ return $obj->{$func}; ++ } ++} ++ ++# determine texinfo version ++my $program_version_num = version->declare(ff_get_conf('PACKAGE_VERSION'))->numify; ++my $program_version_6_8 = $program_version_num >= 6.008000; ++ + # no navigation elements +-set_from_init_file('HEADERS', 0); ++ff_set_from_init_file('HEADERS', 0); + + sub ffmpeg_heading_command($$$$$) + { +@@ -55,7 +92,7 @@ sub ffmpeg_heading_command($$$$$) + $element = $command->{'parent'}; + } + if ($element) { +- $result .= &{$self->{'format_element_header'}}($self, $cmdname, ++ $result .= &{get_formatting_function($self, 'format_element_header')}($self, $cmdname, + $command, $element); + } + +@@ -112,7 +149,11 @@ sub ffmpeg_heading_command($$$$$) + $cmdname + = $Texinfo::Common::level_to_structuring_command{$cmdname}->[$heading_level]; + } +- $result .= &{$self->{'format_heading_text'}}( ++ # format_heading_text expects an array of headings for texinfo >= 7.0 ++ if ($program_version_num >= 7.000000) { ++ $heading = [$heading]; ++ } ++ $result .= &{get_formatting_function($self,'format_heading_text')}( + $self, $cmdname, $heading, + $heading_level + + $self->get_conf('CHAPTER_HEADER_LEVEL') - 1, $command); +@@ -127,14 +168,14 @@ foreach my $command (keys(%Texinfo::Common::sectioning + } + + # print the TOC where @contents is used +-set_from_init_file('INLINE_CONTENTS', 1); ++ff_set_from_init_file('INLINE_CONTENTS', 1); + + # make chapters

+-set_from_init_file('CHAPTER_HEADER_LEVEL', 2); ++ff_set_from_init_file('CHAPTER_HEADER_LEVEL', 2); + + # Do not add
+-set_from_init_file('DEFAULT_RULE', ''); +-set_from_init_file('BIG_RULE', ''); ++ff_set_from_init_file('DEFAULT_RULE', ''); ++ff_set_from_init_file('BIG_RULE', ''); + + # Customized file beginning + sub ffmpeg_begin_file($$$) +@@ -151,7 +192,18 @@ sub ffmpeg_begin_file($$$) + my ($title, $description, $encoding, $date, $css_lines, + $doctype, $bodytext, $copying_comment, $after_body_open, + $extra_head, $program_and_version, $program_homepage, +- $program, $generator) = $self->_file_header_informations($command); ++ $program, $generator); ++ if ($program_version_num >= 7.000000) { ++ ($title, $description, $encoding, $date, $css_lines, ++ $doctype, $bodytext, $copying_comment, $after_body_open, ++ $extra_head, $program_and_version, $program_homepage, ++ $program, $generator) = $self->_file_header_information($command); ++ } else { ++ ($title, $description, $encoding, $date, $css_lines, ++ $doctype, $bodytext, $copying_comment, $after_body_open, ++ $extra_head, $program_and_version, $program_homepage, ++ $program, $generator) = $self->_file_header_informations($command); ++ } + + my $links = $self->_get_links ($filename, $element); + +@@ -207,7 +259,7 @@ sub ffmpeg_end_file($) + sub ffmpeg_end_file($) + { + my $self = shift; +- my $program_string = &{$self->{'format_program_string'}}($self); ++ my $program_string = &{get_formatting_function($self,'format_program_string')}($self); + my $program_text = < + $program_string +@@ -224,7 +276,7 @@ texinfo_register_formatting_function('end_file', \&ffm + + # Dummy title command + # Ignore title. Title is handled through ffmpeg_begin_file(). +-set_from_init_file('USE_TITLEPAGE_FOR_TITLE', 1); ++ff_set_from_init_file('USE_TITLEPAGE_FOR_TITLE', 1); + sub ffmpeg_title($$$$) + { + return ''; +@@ -242,8 +294,14 @@ sub ffmpeg_float($$$$$) + my $args = shift; + my $content = shift; + +- my ($caption, $prepended) = Texinfo::Common::float_name_caption($self, +- $command); ++ my ($caption, $prepended); ++ if ($program_version_num >= 7.000000) { ++ ($caption, $prepended) = Texinfo::Convert::Converter::float_name_caption($self, ++ $command); ++ } else { ++ ($caption, $prepended) = Texinfo::Common::float_name_caption($self, ++ $command); ++ } + my $caption_text = ''; + my $prepended_text; + my $prepended_save = ''; +@@ -315,8 +373,13 @@ sub ffmpeg_float($$$$$) + $caption->{'args'}->[0], 'float caption'); + } + if ($prepended_text.$caption_text ne '') { +- $prepended_text = $self->_attribute_class('div','float-caption'). '>' +- . $prepended_text; ++ if ($program_version_num >= 7.000000) { ++ $prepended_text = $self->html_attribute_class('div',['float-caption']). '>' ++ . $prepended_text; ++ } else { ++ $prepended_text = $self->_attribute_class('div','float-caption'). '>' ++ . $prepended_text; ++ } + $caption_text .= ''; + } + my $html_class = ''; +@@ -329,8 +392,13 @@ sub ffmpeg_float($$$$$) + $prepended_text = ''; + $caption_text = ''; + } +- return $self->_attribute_class('div', $html_class). '>' . "\n" . +- $prepended_text . $caption_text . $content . ''; ++ if ($program_version_num >= 7.000000) { ++ return $self->html_attribute_class('div', [$html_class]). '>' . "\n" . ++ $prepended_text . $caption_text . $content . ''; ++ } else { ++ return $self->_attribute_class('div', $html_class). '>' . "\n" . ++ $prepended_text . $caption_text . $content . ''; ++ } + } + + texinfo_register_command_formatting('float', diff --git a/tools/MacPorts/print/ghostscript/Portfile b/tools/MacPorts/print/ghostscript/Portfile index 5056d763e..91c06743a 100644 --- a/tools/MacPorts/print/ghostscript/Portfile +++ b/tools/MacPorts/print/ghostscript/Portfile @@ -4,8 +4,8 @@ PortSystem 1.0 PortGroup muniversal 1.0 name ghostscript -version 10.02.0 -revision 0 +version 10.02.1 +revision 1 categories print license AGPL-3 BSD @@ -34,9 +34,9 @@ distfiles ${distname}.tar.gz:source \ ${mappingresources_commit}.zip:misc checksums ${distname}.tar.gz \ - rmd160 4b09840d7f2c029d807d4bf9f730d2364b87ba74 \ - sha256 15662eb7cc0aba5ef260ba83e40bb062a04c96c78ef717c80e8f983ebab3cce9 \ - size 98136363 \ + rmd160 4a8dd188fe10e5f16f4a7f3c5866e2923e3d7b3c \ + sha256 25399af0ef5bb94f2a13c91dc785c128d14f16744c4c92fa7c86e011c23151d8 \ + size 98194756 \ ghostscript-fonts-other-6.0.tar.gz \ rmd160 ab60dbf71e7d91283a106c3df381cadfe173082f \ sha256 4fa051e341167008d37fe34c19d241060cd17b13909932cd7ca7fe759243c2de \ diff --git a/tools/MacPorts/print/ghostscript/Portfile.orig b/tools/MacPorts/print/ghostscript/Portfile.orig index 4218c76ce..bbc24ae95 100644 --- a/tools/MacPorts/print/ghostscript/Portfile.orig +++ b/tools/MacPorts/print/ghostscript/Portfile.orig @@ -4,8 +4,8 @@ PortSystem 1.0 PortGroup muniversal 1.0 name ghostscript -version 10.02.0 -revision 0 +version 10.02.1 +revision 1 categories print license AGPL-3 BSD @@ -34,9 +34,9 @@ distfiles ${distname}.tar.gz:source \ ${mappingresources_commit}.zip:misc checksums ${distname}.tar.gz \ - rmd160 4b09840d7f2c029d807d4bf9f730d2364b87ba74 \ - sha256 15662eb7cc0aba5ef260ba83e40bb062a04c96c78ef717c80e8f983ebab3cce9 \ - size 98136363 \ + rmd160 4a8dd188fe10e5f16f4a7f3c5866e2923e3d7b3c \ + sha256 25399af0ef5bb94f2a13c91dc785c128d14f16744c4c92fa7c86e011c23151d8 \ + size 98194756 \ ghostscript-fonts-other-6.0.tar.gz \ rmd160 ab60dbf71e7d91283a106c3df381cadfe173082f \ sha256 4fa051e341167008d37fe34c19d241060cd17b13909932cd7ca7fe759243c2de \ From e81c3f3a14c8a1bf1e1f95d55eb90eaad6b40d0a Mon Sep 17 00:00:00 2001 From: Cedric PAILLE Date: Tue, 28 Nov 2023 16:28:26 +0100 Subject: [PATCH 15/31] Add BT1886 view EOTF (#928) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Add BT1886 view EOTF --------- Co-authored-by: cedric Co-authored-by: Frédéric Devernay --- Engine/ImageConvert.cpp | 3 +++ Engine/Lut.cpp | 6 ++++++ Engine/Lut.h | 13 +++++++++++++ Engine/Project.cpp | 1 + Engine/ViewerInstance.cpp | 3 +++ Global/Enums.h | 3 ++- Gui/Shaders.cpp | 20 +++++++++++++++----- Gui/ViewerTab.cpp | 1 + Gui/ViewerTab10.cpp | 2 ++ Gui/ViewerTab30.cpp | 5 ++++- 10 files changed, 50 insertions(+), 7 deletions(-) diff --git a/Engine/ImageConvert.cpp b/Engine/ImageConvert.cpp index 77cb347f8..a12ad661e 100644 --- a/Engine/ImageConvert.cpp +++ b/Engine/ImageConvert.cpp @@ -115,6 +115,9 @@ lutFromColorspace(ViewerColorSpaceEnum cs) case eViewerColorSpaceRec709: lut = Color::LutManager::Rec709Lut(); break; + case eViewerColorSpaceBT1886: + lut = Color::LutManager::BT1886Lut(); + break; case eViewerColorSpaceLinear: default: lut = 0; diff --git a/Engine/Lut.cpp b/Engine/Lut.cpp index f3aa4ba60..66f557605 100644 --- a/Engine/Lut.cpp +++ b/Engine/Lut.cpp @@ -1293,6 +1293,12 @@ LutManager::sRGBLut() return LutManager::m_instance.getLut("sRGB", from_func_srgb, to_func_srgb); } +const Lut* +LutManager::BT1886Lut() +{ + return LutManager::m_instance.getLut("BT1886", from_func_bt1886, to_func_bt1886); +} + // Rec.709 and Rec.2020 share the same transfer function (and illuminant), except that // Rec.2020 is more precise. // https://www.itu.int/dms_pubrec/itu-r/rec/bt/R-REC-BT.2020-0-201208-S!!PDF-E.pdf diff --git a/Engine/Lut.h b/Engine/Lut.h index 6064a9f9b..a1359c2e3 100644 --- a/Engine/Lut.h +++ b/Engine/Lut.h @@ -89,6 +89,7 @@ class LutManager ///buit-ins color-spaces static const Lut* sRGBLut(); static const Lut* Rec709Lut(); + static const Lut* BT1886Lut(); static const Lut* CineonLut(); static const Lut* Gamma1_8Lut(); static const Lut* Gamma2_2Lut(); @@ -496,6 +497,18 @@ to_func_srgb(float v) } } +inline float +from_func_bt1886(float v) +{ + return std::pow(v, 2.4); +} + +inline float +to_func_bt1886(float v) +{ + return std::pow(v, 1.0/2.4); +} + // r,g,b values are from 0 to 1 // h = [0,NATRON_COLOR_HUE_CIRCLE], s = [0,1], v = [0,1] // if s == 0, then h = 0 (undefined) diff --git a/Engine/Project.cpp b/Engine/Project.cpp index 4b30403bc..1f4ffc4b0 100644 --- a/Engine/Project.cpp +++ b/Engine/Project.cpp @@ -1001,6 +1001,7 @@ Project::initializeKnobs() colorSpaces.push_back(ChoiceOption("Linear","","")); colorSpaces.push_back(ChoiceOption("sRGB","","")); colorSpaces.push_back(ChoiceOption("Rec.709","","")); + colorSpaces.push_back(ChoiceOption("BT1886","","")); _imp->colorSpace8u = AppManager::createKnob( this, tr("8-Bit LUT") ); _imp->colorSpace8u->setName("defaultColorSpace8u"); diff --git a/Engine/ViewerInstance.cpp b/Engine/ViewerInstance.cpp index e8b5b5166..bb6de8265 100644 --- a/Engine/ViewerInstance.cpp +++ b/Engine/ViewerInstance.cpp @@ -140,6 +140,9 @@ ViewerInstance::lutFromColorspace(ViewerColorSpaceEnum cs) case eViewerColorSpaceRec709: lut = Color::LutManager::Rec709Lut(); break; + case eViewerColorSpaceBT1886: + lut = Color::LutManager::BT1886Lut(); + break; case eViewerColorSpaceLinear: default: lut = 0; diff --git a/Global/Enums.h b/Global/Enums.h index d8c50a453..fbcb456ff 100644 --- a/Global/Enums.h +++ b/Global/Enums.h @@ -441,7 +441,8 @@ enum ViewerColorSpaceEnum { eViewerColorSpaceSRGB = 0, eViewerColorSpaceLinear, - eViewerColorSpaceRec709 + eViewerColorSpaceRec709, + eViewerColorSpaceBT1886 }; enum ImageBitDepthEnum diff --git a/Gui/Shaders.cpp b/Gui/Shaders.cpp index bfeb855ce..5fe11d0c6 100644 --- a/Gui/Shaders.cpp +++ b/Gui/Shaders.cpp @@ -42,21 +42,31 @@ const char* fragRGB = "float linear_to_rec709(float c) {" " return (c<0.018) ? (4.500*c) : (1.099*pow(c,0.45) - 0.099);\n" "}\n" - "void main(){\n" + "float linear_to_bt1886(float c) {" + " return pow(c,1.0/2.4);\n" + "}\n" + "void main() {\n" " vec4 color_tmp = texture2D(Tex,gl_TexCoord[0].st);\n" " color_tmp.rgb = (color_tmp.rgb * gain) + offset;\n" - " if(lut == 0){ // srgb\n" + " if (lut == 0) { // srgb\n" // << TO SRGB " color_tmp.r = linear_to_srgb(color_tmp.r);\n" " color_tmp.g = linear_to_srgb(color_tmp.g);\n" " color_tmp.b = linear_to_srgb(color_tmp.b);\n" // << END TO SRGB - " }\n" - " else if (lut == 2){ // Rec 709\n" // << TO REC 709 + " } else if (lut == 2) { // Rec 709\n" +// << TO REC 709 " color_tmp.r = linear_to_rec709(color_tmp.r);\n" " color_tmp.g = linear_to_rec709(color_tmp.g);\n" " color_tmp.b = linear_to_rec709(color_tmp.b);\n" - " }\n" // << END TO REC 709 +// << END TO REC 709 + " } else if (lut == 3) { // BT1886\n" +// << TO BT1886 + " color_tmp.r = linear_to_bt1886(color_tmp.r);\n" + " color_tmp.g = linear_to_bt1886(color_tmp.g);\n" + " color_tmp.b = linear_to_bt1886(color_tmp.b);\n" +// << END TO BT1886 + " }\n" " if (gamma <= 0.) {\n" " color_tmp.r = (color_tmp.r >= 1.) ? 1. : 0.;\n" " color_tmp.g = (color_tmp.g >= 1.) ? 1. : 0.;\n" diff --git a/Gui/ViewerTab.cpp b/Gui/ViewerTab.cpp index 42a31876a..8d8b7cd9c 100644 --- a/Gui/ViewerTab.cpp +++ b/Gui/ViewerTab.cpp @@ -528,6 +528,7 @@ ViewerTab::ViewerTab(const std::list & existingNodesContext, _imp->viewerColorSpace->addItem( QString::fromUtf8("Linear(None)") ); _imp->viewerColorSpace->addItem( QString::fromUtf8("sRGB") ); _imp->viewerColorSpace->addItem( QString::fromUtf8("Rec.709") ); + _imp->viewerColorSpace->addItem( QString::fromUtf8("BT1886") ); _imp->viewerColorSpace->setCurrentIndex(1); QPixmap pixCheckerboardEnabled, pixCheckerboardDisabld; diff --git a/Gui/ViewerTab10.cpp b/Gui/ViewerTab10.cpp index 4a6b15328..3832f4c2f 100644 --- a/Gui/ViewerTab10.cpp +++ b/Gui/ViewerTab10.cpp @@ -76,6 +76,8 @@ ViewerTab::onColorSpaceComboBoxChanged(int v) colorspace = eViewerColorSpaceSRGB; } else if (v == 2) { colorspace = eViewerColorSpaceRec709; + } else if (v == 3) { + colorspace = eViewerColorSpaceBT1886; } else { assert(false); throw std::logic_error("ViewerTab::onColorSpaceComboBoxChanged(): unknown colorspace"); diff --git a/Gui/ViewerTab30.cpp b/Gui/ViewerTab30.cpp index 7e3d9c0a1..330d49506 100644 --- a/Gui/ViewerTab30.cpp +++ b/Gui/ViewerTab30.cpp @@ -89,8 +89,11 @@ ViewerTab::getColorSpace() const return "Rec.709"; break; - default: + case eViewerColorSpaceBT1886: + return "BT1886"; + break; + default: return ""; break; } From 67d31f93740d027ca3f5d4f339e276c7cb396ed2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20Devernay?= Date: Tue, 28 Nov 2023 16:33:56 +0100 Subject: [PATCH 16/31] Update .readthedocs.yaml --- .readthedocs.yaml | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/.readthedocs.yaml b/.readthedocs.yaml index a8b824030..89f857dd4 100644 --- a/.readthedocs.yaml +++ b/.readthedocs.yaml @@ -6,14 +6,14 @@ version: 2 # Set the version of Python and other tools you might need -# build: -# os: ubuntu-20.04 -# tools: -# python: "3" -# # You can also specify other tool versions: -# # nodejs: "16" -# # rust: "1.55" -# # golang: "1.17" +build: + os: ubuntu-22.04 + tools: + python: "3.12" + # You can also specify other tool versions: + # nodejs: "20" + # rust: "1.70" + # golang: "1.20" # Build documentation in the docs/ directory with Sphinx sphinx: From 30c14fdc83acaa7a61ec405fe2b7837c4b1e6228 Mon Sep 17 00:00:00 2001 From: Aaron Colwell <300262+acolwell@users.noreply.github.com> Date: Wed, 27 Dec 2023 22:07:11 -0800 Subject: [PATCH 17/31] Temporarily add clang dependency to natron-build-deps-qt5 package. (#935) --- .../MINGW-packages/mingw-w64-natron-build-deps-qt5/PKGBUILD | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/tools/MINGW-packages/mingw-w64-natron-build-deps-qt5/PKGBUILD b/tools/MINGW-packages/mingw-w64-natron-build-deps-qt5/PKGBUILD index 035596251..69ea0e05c 100644 --- a/tools/MINGW-packages/mingw-w64-natron-build-deps-qt5/PKGBUILD +++ b/tools/MINGW-packages/mingw-w64-natron-build-deps-qt5/PKGBUILD @@ -15,6 +15,12 @@ depends=( "${MINGW_PACKAGE_PREFIX}-qt5-base" "${MINGW_PACKAGE_PREFIX}-pyside2" "${MINGW_PACKAGE_PREFIX}-shiboken2" + # Clang is needed by shiboken2 for now because shiboken2 can't seem to find g++. It appears + # shiboken2 includes hard-coded paths to the g++ binary that is used when shiboken2 is built for msys2. + # Remove this dependency when the shiboken2 package is fixed so it works w/o clang or updates its pkg deps. + # The following change to msys2 made adding this clang dependency necessary. + # https://github.com/msys2/MINGW-packages/commit/c21027404c9d8776ad7dad94973a209bdc3aede2 + "${MINGW_PACKAGE_PREFIX}-clang" "${MINGW_PACKAGE_PREFIX}-python-qtpy" # openfx-misc deps "${MINGW_PACKAGE_PREFIX}-osmesa" From af267b1963f463abb1af5589f40c6ae18edbf2ae Mon Sep 17 00:00:00 2001 From: Aaron Colwell <300262+acolwell@users.noreply.github.com> Date: Thu, 28 Dec 2023 13:25:36 -0800 Subject: [PATCH 18/31] Updating CI workflow on Windows to use Natron pacman repo for deps. (#936) - Adding a step to the Windows workflow that downloads and sets up the Natron pacman repo. - Removed dependencies from the "Install Windows system packages" that are installed when the mingw-w64-x86_64-natron-build-deps-qt5 package is installed. --- .github/workflows/ci.yml | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index a473a4a62..540fcf5e3 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -139,10 +139,18 @@ jobs: with: msystem: mingw64 update: true - install: git base-devel mingw-w64-x86_64-cc mingw-w64-x86_64-qt5-base mingw-w64-x86_64-pyside2 - mingw-w64-x86_64-shiboken2 mingw-w64-x86_64-python-qtpy mingw-w64-x86_64-ninja - mingw-w64-x86_64-cmake mingw-w64-x86_64-boost mingw-w64-x86_64-cairo mingw-w64-x86_64-expat - mingw-w64-x86_64-wget unzip + install: git mingw-w64-x86_64-wget unzip mingw-w64-x86_64-ninja mingw-w64-x86_64-cmake + + - name: Install Natron pacman repository + run: | + mkdir ${GITHUB_WORKSPACE}/natron_pacman_repo + cd ${GITHUB_WORKSPACE}/natron_pacman_repo + wget https://github.com/NatronGitHub/Natron/releases/download/windows-mingw-package-repo/natron_package_repo.zip + unzip natron_package_repo.zip + NATRON_REPO_PATH=`cygpath -u $GITHUB_WORKSPACE` + echo -e "#NATRON_REPO_START\n[natron]\nSigLevel = Optional TrustAll\nServer = file://${NATRON_REPO_PATH}/natron_pacman_repo/\n#NATRON_REPO_END" >> /etc/pacman.conf + pacman -Syl natron + pacman -S --needed --noconfirm mingw-w64-x86_64-natron-build-deps-qt5 - name: Download OpenColorIO-Configs run: | From 2708a86b27830694ab6d55ee61555ec2f35fde21 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20Devernay?= Date: Wed, 3 Jan 2024 14:34:00 +0100 Subject: [PATCH 19/31] MacPorts update --- tools/MacPorts/graphics/libraw/Portfile.orig | 8 ++++---- tools/MacPorts/graphics/libraw/Portfile.patch | 10 +++++----- tools/MacPorts/graphics/openimageio/Portfile | 8 ++++---- tools/MacPorts/graphics/openimageio/Portfile.patch | 10 +++++----- tools/MacPorts/multimedia/ffmpeg/Portfile | 2 +- tools/MacPorts/multimedia/ffmpeg/Portfile.orig | 2 +- tools/MacPorts/net/curl/Portfile | 8 ++++---- tools/MacPorts/net/curl/Portfile.orig | 8 ++++---- tools/MacPorts/python/py-pyside2/Portfile.orig | 8 ++++---- .../py-pyside2/{Portfile => Portfile~2024-01-03} | 8 ++++---- 10 files changed, 36 insertions(+), 36 deletions(-) rename tools/MacPorts/python/py-pyside2/{Portfile => Portfile~2024-01-03} (92%) diff --git a/tools/MacPorts/graphics/libraw/Portfile.orig b/tools/MacPorts/graphics/libraw/Portfile.orig index af45080db..8f08294ed 100644 --- a/tools/MacPorts/graphics/libraw/Portfile.orig +++ b/tools/MacPorts/graphics/libraw/Portfile.orig @@ -3,12 +3,12 @@ PortSystem 1.0 name libraw -version 0.21.1 +version 0.21.2 revision 0 -checksums rmd160 be36d8709eb2e8578f07b63ea8632eb6ed1d7775 \ - sha256 630a6bcf5e65d1b1b40cdb8608bdb922316759bfb981c65091fec8682d1543cd \ - size 1638461 +checksums rmd160 7fe2461241ec66e0b63fdeffdc76d2033ade2b48 \ + sha256 fe7288013206854baf6e4417d0fb63ba4ed7227bf36fff021992671c2dd34b03 \ + size 1639305 description Library for RAW image manipulation long_description A library for reading RAW files obtained from digital photo \ diff --git a/tools/MacPorts/graphics/libraw/Portfile.patch b/tools/MacPorts/graphics/libraw/Portfile.patch index 93c7cbe15..951f97128 100644 --- a/tools/MacPorts/graphics/libraw/Portfile.patch +++ b/tools/MacPorts/graphics/libraw/Portfile.patch @@ -1,17 +1,17 @@ ---- Portfile.orig 2023-10-31 09:50:57 +--- Portfile.orig 2024-01-03 03:22:07 +++ Portfile 2023-07-04 02:43:05 @@ -3,50 +3,69 @@ PortSystem 1.0 name libraw --version 0.21.1 +-version 0.21.2 -revision 0 +version 0.18.13 +set demosaicversion 0.18.8 --checksums rmd160 be36d8709eb2e8578f07b63ea8632eb6ed1d7775 \ -- sha256 630a6bcf5e65d1b1b40cdb8608bdb922316759bfb981c65091fec8682d1543cd \ -- size 1638461 +-checksums rmd160 7fe2461241ec66e0b63fdeffdc76d2033ade2b48 \ +- sha256 fe7288013206854baf6e4417d0fb63ba4ed7227bf36fff021992671c2dd34b03 \ +- size 1639305 - description Library for RAW image manipulation long_description A library for reading RAW files obtained from digital photo \ diff --git a/tools/MacPorts/graphics/openimageio/Portfile b/tools/MacPorts/graphics/openimageio/Portfile index f05d156ae..33ef5a800 100644 --- a/tools/MacPorts/graphics/openimageio/Portfile +++ b/tools/MacPorts/graphics/openimageio/Portfile @@ -16,11 +16,11 @@ long_description OpenImageIO is a library for reading and writing images, related classes, utilities, and applications. platforms darwin -github.setup OpenImageIO oiio 2.4.15.0 v +github.setup OpenImageIO oiio 2.4.17.0 v revision 100 -checksums rmd160 2ccbd4905b7133f730d08a4387ae3641db0d73c3 \ - sha256 67f28a1599eb942a075f23cc35c938f7de0b901a40583da6798cf9a418c56e07 \ - size 47894262 +checksums rmd160 e593d35b8a4d62c0277622267c43911836eebd61 \ + sha256 7fe81d8e5bce30cc4a212f020ac3cc4344e6b7c1c0842475e3a048515099c65c \ + size 47900800 github.tarball_from archive diff --git a/tools/MacPorts/graphics/openimageio/Portfile.patch b/tools/MacPorts/graphics/openimageio/Portfile.patch index 42a46c5d8..5a03bd562 100644 --- a/tools/MacPorts/graphics/openimageio/Portfile.patch +++ b/tools/MacPorts/graphics/openimageio/Portfile.patch @@ -1,5 +1,5 @@ --- Portfile.orig 2023-09-20 19:26:42 -+++ Portfile 2023-09-20 21:23:35 ++++ Portfile 2024-01-03 06:38:40 @@ -2,7 +2,6 @@ PortSystem 1.0 @@ -21,11 +21,11 @@ -} else { - set port_latest no -} -+github.setup OpenImageIO oiio 2.4.15.0 v ++github.setup OpenImageIO oiio 2.4.17.0 v +revision 100 -+checksums rmd160 31292919a0cb4f9fb4ee92d08add97349280874a \ -+ sha256 b2d76e3880d25d3b005f7c694811a991ccebb6e396965959d194f79c369ff390 \ -+ size 47894535 ++checksums rmd160 e593d35b8a4d62c0277622267c43911836eebd61 \ ++ sha256 7fe81d8e5bce30cc4a212f020ac3cc4344e6b7c1c0842475e3a048515099c65c \ ++ size 47900800 -if {${port_latest}} { - github.setup OpenImageIO oiio 2.4.5.0 v diff --git a/tools/MacPorts/multimedia/ffmpeg/Portfile b/tools/MacPorts/multimedia/ffmpeg/Portfile index e71491f41..5bd1d1fe7 100644 --- a/tools/MacPorts/multimedia/ffmpeg/Portfile +++ b/tools/MacPorts/multimedia/ffmpeg/Portfile @@ -19,7 +19,7 @@ conflicts ffmpeg-devel # Please increase the revision of mpv whenever ffmpeg's version is updated. version 4.4.4 -revision 3 +revision 4 epoch 1 license LGPL-2.1+ diff --git a/tools/MacPorts/multimedia/ffmpeg/Portfile.orig b/tools/MacPorts/multimedia/ffmpeg/Portfile.orig index 0de8bcc2e..5b975558f 100644 --- a/tools/MacPorts/multimedia/ffmpeg/Portfile.orig +++ b/tools/MacPorts/multimedia/ffmpeg/Portfile.orig @@ -19,7 +19,7 @@ conflicts ffmpeg-devel # Please increase the revision of mpv whenever ffmpeg's version is updated. version 4.4.4 -revision 3 +revision 4 epoch 1 license LGPL-2.1+ diff --git a/tools/MacPorts/net/curl/Portfile b/tools/MacPorts/net/curl/Portfile index 03a6e5a34..76bec67d0 100644 --- a/tools/MacPorts/net/curl/Portfile +++ b/tools/MacPorts/net/curl/Portfile @@ -6,10 +6,10 @@ PortGroup clang_dependency 1.0 # Increase the revision of p5-www-curl whenever the version of curl gets updated. name curl -version 8.4.0 -checksums rmd160 d63bf003f0ef4da208337143a036da835ad9bfb6 \ - sha256 16c62a9c4af0f703d28bda6d7bbf37ba47055ad3414d70dec63e2e6336f2a82d \ - size 2658376 +version 8.5.0 +checksums rmd160 47b80f4a164c18d95a9af6ffc42576ebe546ea85 \ + sha256 42ab8db9e20d8290a3b633e7fbb3cec15db34df65fd1015ef8ac1e4723750eeb \ + size 2658520 categories net www platforms darwin freebsd diff --git a/tools/MacPorts/net/curl/Portfile.orig b/tools/MacPorts/net/curl/Portfile.orig index 5dbded285..2ec11d344 100644 --- a/tools/MacPorts/net/curl/Portfile.orig +++ b/tools/MacPorts/net/curl/Portfile.orig @@ -6,10 +6,10 @@ PortGroup clang_dependency 1.0 # Increase the revision of p5-www-curl whenever the version of curl gets updated. name curl -version 8.4.0 -checksums rmd160 d63bf003f0ef4da208337143a036da835ad9bfb6 \ - sha256 16c62a9c4af0f703d28bda6d7bbf37ba47055ad3414d70dec63e2e6336f2a82d \ - size 2658376 +version 8.5.0 +checksums rmd160 47b80f4a164c18d95a9af6ffc42576ebe546ea85 \ + sha256 42ab8db9e20d8290a3b633e7fbb3cec15db34df65fd1015ef8ac1e4723750eeb \ + size 2658520 categories net www platforms darwin freebsd diff --git a/tools/MacPorts/python/py-pyside2/Portfile.orig b/tools/MacPorts/python/py-pyside2/Portfile.orig index 6c1c7d944..4850bd5a9 100644 --- a/tools/MacPorts/python/py-pyside2/Portfile.orig +++ b/tools/MacPorts/python/py-pyside2/Portfile.orig @@ -4,7 +4,7 @@ PortSystem 1.0 PortGroup python 1.0 name py-pyside2 -version 5.15.11 +version 5.15.12 revision 0 categories-append devel aqua platforms darwin @@ -18,9 +18,9 @@ master_sites https://download.qt.io/official_releases/QtForPython/pys distname pyside-setup-opensource-src-${version} use_xz yes -checksums rmd160 7f5725800c28998c6600b8360caab88bc137b11d \ - sha256 da567cd3b7854d27a0b4afe3e89de8b2f98b7a6d57393be56f1fc13f770faf29 \ - size 3584760 +checksums rmd160 6490e24dcc3ec3195003f8fd48b2b5ca0c8092ac \ + sha256 9c53a111ca5779064593e690db0da43ce0d5dad25369931b7a4f593886259ff4 \ + size 3585204 python.versions 37 38 39 310 311 diff --git a/tools/MacPorts/python/py-pyside2/Portfile b/tools/MacPorts/python/py-pyside2/Portfile~2024-01-03 similarity index 92% rename from tools/MacPorts/python/py-pyside2/Portfile rename to tools/MacPorts/python/py-pyside2/Portfile~2024-01-03 index 76b9f6af8..11cc1d166 100644 --- a/tools/MacPorts/python/py-pyside2/Portfile +++ b/tools/MacPorts/python/py-pyside2/Portfile~2024-01-03 @@ -4,7 +4,7 @@ PortSystem 1.0 PortGroup python 1.0 name py-pyside2 -version 5.15.11 +version 5.15.12 revision 0 categories-append devel aqua platforms darwin @@ -18,9 +18,9 @@ master_sites https://download.qt.io/official_releases/QtForPython/pys distname pyside-setup-opensource-src-${version} use_xz yes -checksums rmd160 7f5725800c28998c6600b8360caab88bc137b11d \ - sha256 da567cd3b7854d27a0b4afe3e89de8b2f98b7a6d57393be56f1fc13f770faf29 \ - size 3584760 +checksums rmd160 6490e24dcc3ec3195003f8fd48b2b5ca0c8092ac \ + sha256 9c53a111ca5779064593e690db0da43ce0d5dad25369931b7a4f593886259ff4 \ + size 3585204 python.versions 37 38 39 310 311 From 91fdcbc05802cd76dcdac48dd7a39a67f2e8545c Mon Sep 17 00:00:00 2001 From: Aaron Colwell <300262+acolwell@users.noreply.github.com> Date: Thu, 18 Jan 2024 10:24:22 -0800 Subject: [PATCH 20/31] Update shiboken includes to fix Windows build. (#938) * Update shiboken includes and typesystem paths to fix Windows build. Pyside2 and a few other python related packages were updated on MSYS2 in the last week or so which caused the Windows Installer builds to start failing. This change modifies how include & typesystem paths are specified on the command-line. It appears that shiboken no longer handles colon separated path lists on Windows so each include and typesystem path is now specified with its own -I or -T option respectively. --- tools/jenkins/build-natron.sh | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/tools/jenkins/build-natron.sh b/tools/jenkins/build-natron.sh index 25c398d12..c69ed54f9 100755 --- a/tools/jenkins/build-natron.sh +++ b/tools/jenkins/build-natron.sh @@ -173,11 +173,11 @@ if [ "$QT_VERSION_MAJOR" = 5 ]; then esac rm Engine/Qt${QT_VERSION_MAJOR}/NatronEngine/* Gui/Qt${QT_VERSION_MAJOR}/NatronGui/* || true - SHIBOKEN_INCLUDE_PATHS=".:./Engine:./Global:libs/OpenFX/include:${UNIX_SDK_HOME}/include:${QTDIR}/include:${UNIX_PYTHON_HOME}/include/python${PYVER}:${UNIX_PYTHON_HOME}/include/PySide2:${UNIX_PYTHON_HOME}/lib/python${PYVER}/site-packages/PySide2/include" - SHIBOKEN_TYPESYSTEM_PATHS="${UNIX_PYTHON_HOME}/share/PySide2/typesystems:${UNIX_PYTHON_HOME}/lib/python${PYVER}/site-packages/PySide2/typesystems" - shiboken2 --avoid-protected-hack --enable-pyside-extensions --include-paths=${SHIBOKEN_INCLUDE_PATHS} --typesystem-paths=${SHIBOKEN_TYPESYSTEM_PATHS} --output-directory=Engine/Qt${QT_VERSION_MAJOR} Engine/Pyside2_Engine_Python.h Engine/typesystem_engine.xml + SHIBOKEN_INCLUDE_PATHS="-I. -I./Engine -I./Global -Ilibs/OpenFX/include -I${UNIX_SDK_HOME}/include -I${QTDIR}/include -I${UNIX_PYTHON_HOME}/include/python${PYVER} -I${UNIX_PYTHON_HOME}/include/PySide2 -I${UNIX_PYTHON_HOME}/lib/python${PYVER}/site-packages/PySide2/include" + SHIBOKEN_TYPESYSTEM_PATHS="-T${UNIX_PYTHON_HOME}/share/PySide2/typesystems -T${UNIX_PYTHON_HOME}/lib/python${PYVER}/site-packages/PySide2/typesystems" + shiboken2 --avoid-protected-hack --enable-pyside-extensions ${SHIBOKEN_INCLUDE_PATHS} ${SHIBOKEN_TYPESYSTEM_PATHS} --output-directory=Engine/Qt${QT_VERSION_MAJOR} Engine/Pyside2_Engine_Python.h Engine/typesystem_engine.xml - shiboken2 --avoid-protected-hack --enable-pyside-extensions --include-paths=${SHIBOKEN_INCLUDE_PATHS}:${QTDIR}/include/QtWidgets:${QTDIR}/include/QtCore --typesystem-paths=${SHIBOKEN_TYPESYSTEM_PATHS}:./Engine:./Shiboken --output-directory=Gui/Qt${QT_VERSION_MAJOR} Gui/Pyside2_Gui_Python.h Gui/typesystem_natronGui.xml + shiboken2 --avoid-protected-hack --enable-pyside-extensions ${SHIBOKEN_INCLUDE_PATHS} -I${QTDIR}/include/QtWidgets -I${QTDIR}/include/QtCore ${SHIBOKEN_TYPESYSTEM_PATHS} -T./Engine -T./Shiboken --output-directory=Gui/Qt${QT_VERSION_MAJOR} Gui/Pyside2_Gui_Python.h Gui/typesystem_natronGui.xml tools/utils/runPostShiboken2.sh Engine/Qt${QT_VERSION_MAJOR}/NatronEngine natronengine tools/utils/runPostShiboken2.sh Gui/Qt${QT_VERSION_MAJOR}/NatronGui natrongui From f260aa22ce5a288519754a8ede0bc893739bfdac Mon Sep 17 00:00:00 2001 From: Max Chadwick Date: Mon, 22 Jan 2024 03:21:46 -0500 Subject: [PATCH 21/31] Update getstarted-about-mainconcepts.rst (#934) Fix document --- .../source/guide/getstarted-about-mainconcepts.rst | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Documentation/source/guide/getstarted-about-mainconcepts.rst b/Documentation/source/guide/getstarted-about-mainconcepts.rst index 3898dc674..21f401cb5 100644 --- a/Documentation/source/guide/getstarted-about-mainconcepts.rst +++ b/Documentation/source/guide/getstarted-about-mainconcepts.rst @@ -16,9 +16,9 @@ Image Layers and Channels ######################### In natron an image is only a stack of black and white images called channels. channels are grouped in layers. -The Color layer is the base layer. Color layer has channels R,G,B,A -R,G,B codes the color of the pixels in Red Green blue -A codes the transparency of the pixel called Alpha. When A=0 the pixel is transparent. When A=1 the pixel is transparent +The Color layer is the base layer. Color layer has channels R,G,B,A. +R,G,B codes the color of the pixels in Red Green blue. +A codes the transparency of the pixel called Alpha. When A=0 the pixel is transparent. When A=1 the pixel is opaque The image can have as many layers as you want describing, the motion, the depth of your image or whatever else you want .. note:: You cannot see the stacking of the layers as in as in Photoshop or After Effects. In Natron you will have different branches of your node tree that are Merged together. The Merge node is the good way to stack layers. From ac93534191b9c254c00fbab9dddcbbdda1f3c4c3 Mon Sep 17 00:00:00 2001 From: Aaron Colwell <300262+acolwell@users.noreply.github.com> Date: Mon, 22 Jan 2024 00:23:12 -0800 Subject: [PATCH 22/31] Replace firebird2 dependency with firebird and refactor repo logic. (#939) Msys2 has removed its firebird2 package. This change replaces the package reference in our mingw-w64-natron-build-deps-qt5 package. The pacman repo building workflow logic has been reworked so that it generates versioned .zip files and builds the repo locally if it can't download the current repo version. This allows changes to the repo to generate the new zip file AND allows the installer and CI workflows to pass at the same time. This makes it easier to verify that the changes to the repo actually fix build issues when the pull request workflows run. --- .github/workflows/build_installer.yml | 16 +------- .github/workflows/build_pacman_repo.yml | 21 ++++++---- .github/workflows/ci.yml | 8 +--- .../workflows/install_natron_pacman_repo.sh | 39 +++++++++++++++++++ .../build_natron_package_repo.sh | 8 ++-- .../mingw-w64-natron-build-deps-qt5/PKGBUILD | 2 +- .../windows_pacman_repo_version.txt | 1 + 7 files changed, 61 insertions(+), 34 deletions(-) create mode 100644 .github/workflows/install_natron_pacman_repo.sh create mode 100644 tools/MINGW-packages/windows_pacman_repo_version.txt diff --git a/.github/workflows/build_installer.yml b/.github/workflows/build_installer.yml index 2797cb013..a29001e68 100644 --- a/.github/workflows/build_installer.yml +++ b/.github/workflows/build_installer.yml @@ -31,13 +31,7 @@ jobs: - name: Install Natron pacman repository run: | - mkdir ${GITHUB_WORKSPACE}/natron_pacman_repo - cd ${GITHUB_WORKSPACE}/natron_pacman_repo - wget https://github.com/NatronGitHub/Natron/releases/download/windows-mingw-package-repo/natron_package_repo.zip - unzip natron_package_repo.zip - NATRON_REPO_PATH=`cygpath -u $GITHUB_WORKSPACE` - echo -e "#NATRON_REPO_START\n[natron]\nSigLevel = Optional TrustAll\nServer = file://${NATRON_REPO_PATH}/natron_pacman_repo/\n#NATRON_REPO_END" >> /etc/pacman.conf - pacman -Syl natron + ${GITHUB_WORKSPACE}/.github/workflows/install_natron_pacman_repo.sh ${GITHUB_WORKSPACE} ${GITHUB_WORKSPACE}/natron_pacman_repo pacman -S --needed --noconfirm mingw-w64-x86_64-natron-build-deps-qt5 - name: Build @@ -93,13 +87,7 @@ jobs: - name: Install Natron pacman repository run: | - mkdir ${GITHUB_WORKSPACE}/natron_pacman_repo - cd ${GITHUB_WORKSPACE}/natron_pacman_repo - wget https://github.com/NatronGitHub/Natron/releases/download/windows-mingw-package-repo/natron_package_repo.zip - unzip natron_package_repo.zip - NATRON_REPO_PATH=`cygpath -u $GITHUB_WORKSPACE` - echo -e "#NATRON_REPO_START\n[natron]\nSigLevel = Optional TrustAll\nServer = file://${NATRON_REPO_PATH}/natron_pacman_repo/\n#NATRON_REPO_END" >> /etc/pacman.conf - pacman -Syl natron + ${GITHUB_WORKSPACE}/.github/workflows/install_natron_pacman_repo.sh ${GITHUB_WORKSPACE} ${GITHUB_WORKSPACE}/natron_pacman_repo pacman -S --needed --noconfirm mingw-w64-x86_64-natron-build-deps-qt5 - name: Build diff --git a/.github/workflows/build_pacman_repo.yml b/.github/workflows/build_pacman_repo.yml index d99acb21f..bba04eb2c 100644 --- a/.github/workflows/build_pacman_repo.yml +++ b/.github/workflows/build_pacman_repo.yml @@ -39,32 +39,37 @@ jobs: - name: Install Inno Setup run: choco install innosetup shell: pwsh + - name: Prep MinGW package version list + run: | + pacman -Sl mingw64 msys > mingw-package-version-list.txt - name: Restore natron repo directory from cache id: restore-natron-repo-cache uses: actions/cache/restore@v3 with: - path: tools/MINGW-packages/natron_repo - key: ${{ env.cache-name }}-${{ hashFiles('tools/MINGW-packages/**/PKGBUILD') }} + path: natron_repo + key: ${{ env.cache-name }}-${{ hashFiles('mingw-package-version-list.txt', 'tools/MINGW-packages/**/PKGBUILD') }} - name: Build natron package repo id: build-package-repo # Allow continuing after error so cache gets updated and makes reruns faster. continue-on-error: true run: | - cd tools/MINGW-packages - ./build_natron_package_repo.sh natron_repo + tools/MINGW-packages/build_natron_package_repo.sh natron_repo + + REPO_VERSION=`cat ${GITHUB_WORKSPACE}/tools/MINGW-packages/windows_pacman_repo_version.txt` + echo "REPO_VERSION=${REPO_VERSION}" >> "$GITHUB_OUTPUT" - name: Save natron repo directory to cache id: save-natron-repo-cache uses: actions/cache/save@v3 # save even if build fails. if: always() with: - path: tools/MINGW-packages/natron_repo - key: ${{ env.cache-name }}-${{ hashFiles('tools/MINGW-packages/**/PKGBUILD') }} + path: natron_repo + key: ${{ env.cache-name }}-${{ hashFiles('mingw-package-version-list.txt', 'tools/MINGW-packages/**/PKGBUILD') }} - name: Upload natron_package_repo artifacts uses: actions/upload-artifact@v3 with: - name: natron_package_repo - path: tools/MINGW-packages/natron_repo + name: natron_package_repo-${{ steps.build-package-repo.outputs.REPO_VERSION }} + path: natron_repo - name: Check on failures if: steps.build-package-repo.outcome != 'success' run: exit 1 \ No newline at end of file diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 540fcf5e3..b263e5a61 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -143,13 +143,7 @@ jobs: - name: Install Natron pacman repository run: | - mkdir ${GITHUB_WORKSPACE}/natron_pacman_repo - cd ${GITHUB_WORKSPACE}/natron_pacman_repo - wget https://github.com/NatronGitHub/Natron/releases/download/windows-mingw-package-repo/natron_package_repo.zip - unzip natron_package_repo.zip - NATRON_REPO_PATH=`cygpath -u $GITHUB_WORKSPACE` - echo -e "#NATRON_REPO_START\n[natron]\nSigLevel = Optional TrustAll\nServer = file://${NATRON_REPO_PATH}/natron_pacman_repo/\n#NATRON_REPO_END" >> /etc/pacman.conf - pacman -Syl natron + ${GITHUB_WORKSPACE}/.github/workflows/install_natron_pacman_repo.sh ${GITHUB_WORKSPACE} ${GITHUB_WORKSPACE}/natron_pacman_repo pacman -S --needed --noconfirm mingw-w64-x86_64-natron-build-deps-qt5 - name: Download OpenColorIO-Configs diff --git a/.github/workflows/install_natron_pacman_repo.sh b/.github/workflows/install_natron_pacman_repo.sh new file mode 100644 index 000000000..0812f9ad0 --- /dev/null +++ b/.github/workflows/install_natron_pacman_repo.sh @@ -0,0 +1,39 @@ +#!/bin/bash + +NATRON_DIR= +NATRON_REPO_DIR= +if [[ -z $1 || -z $2 ]]; then + echo "Usage: $(basename $0) " + exit 1 +else + NATRON_DIR=$(realpath $1) + NATRON_REPO_DIR=$(realpath $2) +fi + +source ${NATRON_DIR}/tools/MINGW-packages/natron_repo_common.sh + +if [[ ! -d ${NATRON_REPO_DIR} ]]; then + mkdir ${NATRON_REPO_DIR} +fi + +cd ${NATRON_REPO_DIR} + +WINDOWS_PACMAN_REPO_VERSION=`cat ${NATRON_DIR}/tools/MINGW-packages/windows_pacman_repo_version.txt` +ZIP_FILENAME="natron_package_repo-${WINDOWS_PACMAN_REPO_VERSION}.zip" +wget https://github.com/NatronGitHub/Natron/releases/download/windows-mingw-package-repo/${ZIP_FILENAME} + +if [[ -e ${ZIP_FILENAME} ]]; then + unzip ${ZIP_FILENAME} +else + echo "Failed to fetch ${ZIP_FILENAME}" + + echo "Building pacman repo locally." + + # install necessary dependencies for building pacman repo. + pacman -S --needed --noconfirm git base-devel + + ${NATRON_DIR}/tools/MINGW-packages/build_natron_package_repo.sh ${NATRON_REPO_DIR} +fi + +UNIX_NATRON_REPO_DIR=`cygpath -u ${NATRON_REPO_DIR}` +natron_repo_init ${UNIX_NATRON_REPO_DIR} diff --git a/tools/MINGW-packages/build_natron_package_repo.sh b/tools/MINGW-packages/build_natron_package_repo.sh index ae87d01ef..dc08294d5 100644 --- a/tools/MINGW-packages/build_natron_package_repo.sh +++ b/tools/MINGW-packages/build_natron_package_repo.sh @@ -1,7 +1,7 @@ #!/bin/sh set -e #set -x -CWD=$(pwd) +BUILD_SCRIPT_DIR=$(realpath $(dirname "${BASH_SOURCE[0]}")) PKGS=" mingw-w64-natron-setup @@ -21,7 +21,7 @@ mingw-w64-dump_syms mingw-w64-natron-build-deps-qt5 " -source ./natron_repo_common.sh +source "${BUILD_SCRIPT_DIR}/natron_repo_common.sh" trap natron_repo_cleanup EXIT @@ -37,7 +37,7 @@ natron_repo_init ${NATRON_REPO_DIR} for pkg_dir in ${PKGS}; do echo -e "\n\nEntering package directory ${pkg_dir}." - cd "${CWD}/${pkg_dir}" + cd "${BUILD_SCRIPT_DIR}/${pkg_dir}" PACKAGE_NAME=`makepkg --printsrcinfo | awk '/pkgname/{print $3}'` @@ -71,5 +71,5 @@ for pkg_dir in ${PKGS}; do fi echo -e "Leaving package directory ${pkg_dir}." - cd "${CWD}" + cd "${BUILD_SCRIPT_DIR}" done diff --git a/tools/MINGW-packages/mingw-w64-natron-build-deps-qt5/PKGBUILD b/tools/MINGW-packages/mingw-w64-natron-build-deps-qt5/PKGBUILD index 69ea0e05c..88940a8b6 100644 --- a/tools/MINGW-packages/mingw-w64-natron-build-deps-qt5/PKGBUILD +++ b/tools/MINGW-packages/mingw-w64-natron-build-deps-qt5/PKGBUILD @@ -41,7 +41,7 @@ depends=( # installer "zip" "unzip" - "${MINGW_PACKAGE_PREFIX}-firebird2-git" + "${MINGW_PACKAGE_PREFIX}-firebird" "${MINGW_PACKAGE_PREFIX}-breakpad-git" "${MINGW_PACKAGE_PREFIX}-python-sphinx" "${MINGW_PACKAGE_PREFIX}-python-sphinx_rtd_theme" diff --git a/tools/MINGW-packages/windows_pacman_repo_version.txt b/tools/MINGW-packages/windows_pacman_repo_version.txt new file mode 100644 index 000000000..d861e6ecd --- /dev/null +++ b/tools/MINGW-packages/windows_pacman_repo_version.txt @@ -0,0 +1 @@ +20240120-1 From 43dd0196ee391f927a78b70af2fdb872aec008de Mon Sep 17 00:00:00 2001 From: Todica Ionut Date: Wed, 31 Jan 2024 20:31:41 +0200 Subject: [PATCH 23/31] Update imath 3.1.10 to latest versions on Windows. (#941) Co-authored-by: Aaron Colwell <300262+acolwell@users.noreply.github.com> --- tools/MINGW-packages/mingw-w64-imath/PKGBUILD | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/tools/MINGW-packages/mingw-w64-imath/PKGBUILD b/tools/MINGW-packages/mingw-w64-imath/PKGBUILD index adc25be92..a1948bca6 100644 --- a/tools/MINGW-packages/mingw-w64-imath/PKGBUILD +++ b/tools/MINGW-packages/mingw-w64-imath/PKGBUILD @@ -3,7 +3,7 @@ _realname=imath pkgbase=mingw-w64-natron_${_realname} pkgname=("${MINGW_PACKAGE_PREFIX}-natron_${_realname}") -pkgver=3.1.9 +pkgver=3.1.10 pkgrel=99.1 pkgdesc='A C++ and python library of 2D and 3D vector, matrix, and math operations for computer graphics (mingw-w64)' url='https://www.openexr.com/' @@ -11,10 +11,10 @@ arch=('any') mingw_arch=('mingw32' 'mingw64' 'ucrt64' 'clang64' 'clang32' 'clangarm64') license=('spdx:BSD-3-Clause') depends=("${MINGW_PACKAGE_PREFIX}-gcc-libs") -makedepends=("${MINGW_PACKAGE_PREFIX}-boost" - "${MINGW_PACKAGE_PREFIX}-cc" +makedepends=("${MINGW_PACKAGE_PREFIX}-cc" "${MINGW_PACKAGE_PREFIX}-cmake" "${MINGW_PACKAGE_PREFIX}-ninja" + "${MINGW_PACKAGE_PREFIX}-boost" "${MINGW_PACKAGE_PREFIX}-python" "${MINGW_PACKAGE_PREFIX}-python-numpy") optdepends=("${MINGW_PACKAGE_PREFIX}-python: python bindings" @@ -22,7 +22,7 @@ optdepends=("${MINGW_PACKAGE_PREFIX}-python: python bindings" source=("https://github.com/AcademySoftwareFoundation/Imath/archive/v${pkgver}/${_realname}-${pkgver}.tar.gz" 0001-cmake-libs-name.patch 0002-fix-openexr-clang-build.patch) -sha256sums=('f1d8aacd46afed958babfced3190d2d3c8209b66da451f556abd6da94c165cf3' +sha256sums=('f2943e86bfb694e216c60b9a169e5356f8a90f18fbd34d7b6e3450be14f60b10' '2dc2de52e2475cc9d725ff443466d3ac247a405018f1d9b0caeb03a9d5116d9b' '0eea3c7b57d5b59887f963d696c2afdcfb1976a3913f161995e19b13d6a65086') @@ -35,7 +35,6 @@ prepare() { } build() { - [[ -d "${srcdir}/build-${MSYSTEM}" ]] && rm -rf "${srcdir}/build-${MSYSTEM}" mkdir -p "${srcdir}/build-${MSYSTEM}" && cd "${srcdir}/build-${MSYSTEM}" declare -a _extra_config From e1654fb7780b1c2a038cb41fdc7f6495361ee7c7 Mon Sep 17 00:00:00 2001 From: Todica Ionut Date: Fri, 2 Feb 2024 00:31:56 +0200 Subject: [PATCH 24/31] Update OpenEXR 3.2.1 to latest versions on Windows. (#942) --- .../0006-cmake-soversion.patch | 4 ++-- .../0007-export-TypedAttribute-value.patch | 19 ++++++++++++++++++ .../MINGW-packages/mingw-w64-openexr/PKGBUILD | 20 ++++++++++--------- .../windows_pacman_repo_version.txt | 2 +- 4 files changed, 33 insertions(+), 12 deletions(-) create mode 100644 tools/MINGW-packages/mingw-w64-openexr/0007-export-TypedAttribute-value.patch diff --git a/tools/MINGW-packages/mingw-w64-openexr/0006-cmake-soversion.patch b/tools/MINGW-packages/mingw-w64-openexr/0006-cmake-soversion.patch index 23e600e30..34bc71db3 100644 --- a/tools/MINGW-packages/mingw-w64-openexr/0006-cmake-soversion.patch +++ b/tools/MINGW-packages/mingw-w64-openexr/0006-cmake-soversion.patch @@ -17,8 +17,8 @@ Description: OpenEXR image library Version: @OPENEXR_VERSION@ --Libs: @exr_pthread_libs@ -L${libdir} -lOpenEXR${libsuffix} -lOpenEXRUtil${libsuffix} -lOpenEXRCore${libsuffix} -lIex${libsuffix} -lIlmThread${libsuffix} -+Libs: @exr_pthread_libs@ -L${libdir} -lOpenEXR -lOpenEXRUtil -lOpenEXRCore -lIex -lIlmThread +-Libs: @exr_pthread_libs@ -L${libdir} -lOpenEXR${libsuffix} -lOpenEXRUtil${libsuffix} -lOpenEXRCore${libsuffix} -lIex${libsuffix} -lIlmThread${libsuffix} @EXR_DEFLATE_LDFLAGS@ ++Libs: @exr_pthread_libs@ -L${libdir} -lOpenEXR -lOpenEXRUtil -lOpenEXRCore -lIex -lIlmThread @EXR_DEFLATE_LDFLAGS@ Cflags: -I${includedir} -I${OpenEXR_includedir} @exr_pthread_cflags@ Requires: Imath Libs.private: @zlib_link@ diff --git a/tools/MINGW-packages/mingw-w64-openexr/0007-export-TypedAttribute-value.patch b/tools/MINGW-packages/mingw-w64-openexr/0007-export-TypedAttribute-value.patch new file mode 100644 index 000000000..f5367144f --- /dev/null +++ b/tools/MINGW-packages/mingw-w64-openexr/0007-export-TypedAttribute-value.patch @@ -0,0 +1,19 @@ +--- a/src/lib/OpenEXR/ImfAttribute.h ++++ b/src/lib/OpenEXR/ImfAttribute.h +@@ -215,14 +215,14 @@ + } + + template +-inline T& ++T& + TypedAttribute::value () + { + return _value; + } + + template +-inline const T& ++const T& + TypedAttribute::value () const + { + return _value; diff --git a/tools/MINGW-packages/mingw-w64-openexr/PKGBUILD b/tools/MINGW-packages/mingw-w64-openexr/PKGBUILD index e06f3be48..dfc277627 100644 --- a/tools/MINGW-packages/mingw-w64-openexr/PKGBUILD +++ b/tools/MINGW-packages/mingw-w64-openexr/PKGBUILD @@ -3,16 +3,16 @@ _realname=openexr pkgbase=mingw-w64-natron_${_realname} pkgname=("${MINGW_PACKAGE_PREFIX}-natron_${_realname}") -pkgver=3.1.8 +pkgver=3.2.1 pkgrel=99.1 pkgdesc='A high dynamic-range image file format library (mingw-w64)' arch=('any') mingw_arch=('mingw32' 'mingw64' 'ucrt64' 'clang64' 'clang32' 'clangarm64') url="https://www.openexr.com/" -license=('BSD') +license=('spdx:BSD-3-Clause') depends=("${MINGW_PACKAGE_PREFIX}-natron_imath" - "${MINGW_PACKAGE_PREFIX}-libwinpthread-git" - "${MINGW_PACKAGE_PREFIX}-zlib") + "${MINGW_PACKAGE_PREFIX}-libdeflate" + "${MINGW_PACKAGE_PREFIX}-libwinpthread-git") makedepends=("${MINGW_PACKAGE_PREFIX}-cc" "${MINGW_PACKAGE_PREFIX}-cmake" "${MINGW_PACKAGE_PREFIX}-ninja") @@ -26,9 +26,11 @@ replaces=( "${MINGW_PACKAGE_PREFIX}-pyilmbase" ) source=("https://github.com/openexr/openexr/archive/v${pkgver}/${_realname}-${pkgver}.tar.gz" - 0006-cmake-soversion.patch) -sha256sums=('3ff47111ef7e5da6f69330e66e1e90ae620b79df1cedf2512bb9bffe86c2c617' - 'e65852ac2e5545472ad90830c97e964aa2c71e1795979a8b9867155d578d45ed') + 0006-cmake-soversion.patch + 0007-export-TypedAttribute-value.patch) +sha256sums=('61e175aa2203399fb3c8c2288752fbea3c2637680d50b6e306ea5f8ffdd46a9b' + 'a5ce463815e8d05c879dbe6a255e9f8ac2697cd3ef4242dac1e5cb331f78ed02' + '204777b48cde1c4d390789f10c5e429d5295be701f68a7937a90d0ecf271c048') # Helper macros to help make tasks easier # apply_patch_with_msg() { @@ -43,7 +45,8 @@ prepare(){ cd "${srcdir}/${_realname}-${pkgver}" apply_patch_with_msg \ - 0006-cmake-soversion.patch + 0006-cmake-soversion.patch \ + 0007-export-TypedAttribute-value.patch } build() { @@ -70,7 +73,6 @@ build() { -DBUILD_SHARED_LIBS=ON \ -DBUILD_TESTING=OFF \ -DOPENEXR_INSTALL_EXAMPLES=OFF \ - -DOPENEXR_INSTALL_PKG_CONFIG=ON \ ../${_realname}-${pkgver} ${MINGW_PREFIX}/bin/cmake --build . diff --git a/tools/MINGW-packages/windows_pacman_repo_version.txt b/tools/MINGW-packages/windows_pacman_repo_version.txt index d861e6ecd..e0492b582 100644 --- a/tools/MINGW-packages/windows_pacman_repo_version.txt +++ b/tools/MINGW-packages/windows_pacman_repo_version.txt @@ -1 +1 @@ -20240120-1 +20240201-1 From d42eaccbbfa89d35ad99681fc4fdcc16f9c72933 Mon Sep 17 00:00:00 2001 From: Aaron Colwell <300262+acolwell@users.noreply.github.com> Date: Tue, 13 Feb 2024 11:21:47 -0800 Subject: [PATCH 25/31] Update action versions to get rid of Node 16 warnings. (#945) --- .github/workflows/build_installer.yml | 10 +++++----- .github/workflows/build_pacman_repo.yml | 8 ++++---- .github/workflows/ci.yml | 9 ++++----- 3 files changed, 13 insertions(+), 14 deletions(-) diff --git a/.github/workflows/build_installer.yml b/.github/workflows/build_installer.yml index a29001e68..088635c53 100644 --- a/.github/workflows/build_installer.yml +++ b/.github/workflows/build_installer.yml @@ -18,7 +18,7 @@ jobs: steps: - name: Checkout branch - uses: actions/checkout@v3 + uses: actions/checkout@v4.1.1 with: submodules: recursive @@ -60,7 +60,7 @@ jobs: echo "INSTALLER_DIR=$(cygpath -m ${INSTALLER_DIR})" >> $GITHUB_OUTPUT - name: Upload artifacts - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4.3.1 with: name: ${{ steps.build.outputs.INSTALLER_NAME }} path: ${{ steps.build.outputs.INSTALLER_DIR }} @@ -74,7 +74,7 @@ jobs: steps: - name: Checkout branch - uses: actions/checkout@v3 + uses: actions/checkout@v4.1.1 with: submodules: recursive @@ -126,13 +126,13 @@ jobs: echo "SYMBOLS_DIR=$(cygpath -m ${SYMBOLS_DIR})" >> $GITHUB_OUTPUT - name: Upload installer - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4.3.1 with: name: ${{ steps.build.outputs.INSTALLER_NAME }} path: ${{ steps.build.outputs.INSTALLER_DIR }} - name: Upload symbols - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4.3.1 with: name: ${{ steps.build.outputs.SYMBOLS_NAME }} path: ${{ steps.build.outputs.SYMBOLS_DIR }} diff --git a/.github/workflows/build_pacman_repo.yml b/.github/workflows/build_pacman_repo.yml index bba04eb2c..71a9bbc49 100644 --- a/.github/workflows/build_pacman_repo.yml +++ b/.github/workflows/build_pacman_repo.yml @@ -27,7 +27,7 @@ jobs: shell: msys2 {0} steps: - name: Checkout branch - uses: actions/checkout@v3 + uses: actions/checkout@v4.1.1 with: submodules: recursive - name: Setup MinGW environment @@ -44,7 +44,7 @@ jobs: pacman -Sl mingw64 msys > mingw-package-version-list.txt - name: Restore natron repo directory from cache id: restore-natron-repo-cache - uses: actions/cache/restore@v3 + uses: actions/cache/restore@v4.0.0 with: path: natron_repo key: ${{ env.cache-name }}-${{ hashFiles('mingw-package-version-list.txt', 'tools/MINGW-packages/**/PKGBUILD') }} @@ -59,14 +59,14 @@ jobs: echo "REPO_VERSION=${REPO_VERSION}" >> "$GITHUB_OUTPUT" - name: Save natron repo directory to cache id: save-natron-repo-cache - uses: actions/cache/save@v3 + uses: actions/cache/save@v4.0.0 # save even if build fails. if: always() with: path: natron_repo key: ${{ env.cache-name }}-${{ hashFiles('mingw-package-version-list.txt', 'tools/MINGW-packages/**/PKGBUILD') }} - name: Upload natron_package_repo artifacts - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4.3.1 with: name: natron_package_repo-${{ steps.build-package-repo.outputs.REPO_VERSION }} path: natron_repo diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index b263e5a61..116eafaeb 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -6,7 +6,6 @@ on: branches: - RB-2.5 - RB-2.6 - - fix-ci # For testing. Remove before commit. paths-ignore: - Documentation pull_request: @@ -40,7 +39,7 @@ jobs: python-version: '3.10' steps: - name: Checkout branch - uses: actions/checkout@v3 + uses: actions/checkout@v4.1.1 with: submodules: recursive - name: Install Linux system packages @@ -102,7 +101,7 @@ jobs: OFX_PLUGIN_PATH=$PWD/../Plugins OCIO=$PWD/../OpenColorIO-Configs/blender/config.ocio ctest -V - name: Upload ${{ matrix.os }} Test Log artifacts - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4.3.1 with: name: ${{ matrix.os }} Test Logs path: ${{ github.workspace }}/release/Testing/Temporary/LastTest.log @@ -130,7 +129,7 @@ jobs: python-version: ['3.10'] steps: - name: Checkout branch - uses: actions/checkout@v3 + uses: actions/checkout@v4.1.1 with: submodules: recursive @@ -173,7 +172,7 @@ jobs: PYTHONHOME=/mingw64 OFX_PLUGIN_PATH=$PWD/Plugins OCIO=$PWD/../OpenColorIO-Configs/blender/config.ocio ctest -V - name: Upload ${{ matrix.os }} Test Log artifacts - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4.3.1 with: name: ${{ matrix.os }} Test Logs path: ${{ github.workspace }}/build/Testing/Temporary/LastTest.log From 985103e7d4df652aa5467c6cb628f80c625b55df Mon Sep 17 00:00:00 2001 From: Aaron Colwell <300262+acolwell@users.noreply.github.com> Date: Fri, 16 Feb 2024 18:28:08 -0800 Subject: [PATCH 26/31] Verify plugins are loadable in Windows installer builds and fix missing dependencies (#946) * Add logic to verify that OFX plugins load. * Add missing libheif dependencies. --- .github/workflows/build_installer.yml | 32 +++++++++++++ .github/workflows/verify_plugin_loads.cpp | 58 +++++++++++++++++++++++ tools/jenkins/genDllVersions.sh | 2 + 3 files changed, 92 insertions(+) create mode 100644 .github/workflows/verify_plugin_loads.cpp diff --git a/.github/workflows/build_installer.yml b/.github/workflows/build_installer.yml index 088635c53..9b9ddee8d 100644 --- a/.github/workflows/build_installer.yml +++ b/.github/workflows/build_installer.yml @@ -59,6 +59,22 @@ jobs: echo "INSTALLER_NAME=${INSTALLER_NAME}" >> $GITHUB_OUTPUT echo "INSTALLER_DIR=$(cygpath -m ${INSTALLER_DIR})" >> $GITHUB_OUTPUT + - name: Build verify_plugin_loads binary + run: | + g++ -DWINDOWS -o verify_plugin_loads .github/workflows/verify_plugin_loads.cpp libs/OpenFX/HostSupport/src/ofxhBinary.cpp libs/OpenFX/HostSupport/src/ofxhUtilities.cpp -I libs/OpenFX/HostSupport/include/ -I libs/OpenFX/include/ + + - name: Uninstall Natron dependencies + run: | + pacman -Rs --noconfirm mingw-w64-x86_64-natron-build-deps-qt5 + + - name: Verify plugin loading + run: | + INSTALLER_DIR=$(cygpath -u '${{ steps.build.outputs.INSTALLER_DIR }}')/${{ steps.build.outputs.INSTALLER_NAME }} + for x in $(find ${INSTALLER_DIR}/Plugins -name *.ofx); do + echo "Testing $(basename ${x}) ..." + PATH=${INSTALLER_DIR}/bin ./verify_plugin_loads.exe "${x}" + done + - name: Upload artifacts uses: actions/upload-artifact@v4.3.1 with: @@ -125,6 +141,22 @@ jobs: echo "SYMBOLS_NAME=${SYMBOLS_NAME}" >> $GITHUB_OUTPUT echo "SYMBOLS_DIR=$(cygpath -m ${SYMBOLS_DIR})" >> $GITHUB_OUTPUT + - name: Build verify_plugin_loads binary + run: | + g++ -DWINDOWS -o verify_plugin_loads .github/workflows/verify_plugin_loads.cpp libs/OpenFX/HostSupport/src/ofxhBinary.cpp libs/OpenFX/HostSupport/src/ofxhUtilities.cpp -I libs/OpenFX/HostSupport/include/ -I libs/OpenFX/include/ + + - name: Uninstall Natron dependencies + run: | + pacman -Rs --noconfirm mingw-w64-x86_64-natron-build-deps-qt5 + + - name: Verify plugin loading + run: | + INSTALLER_DIR=$(cygpath -u '${{ steps.build.outputs.INSTALLER_DIR }}')/${{ steps.build.outputs.INSTALLER_NAME }} + for x in $(find ${INSTALLER_DIR}/Plugins -name *.ofx); do + echo "Testing $(basename ${x}) ..." + PATH=${INSTALLER_DIR}/bin ./verify_plugin_loads.exe "${x}" + done + - name: Upload installer uses: actions/upload-artifact@v4.3.1 with: diff --git a/.github/workflows/verify_plugin_loads.cpp b/.github/workflows/verify_plugin_loads.cpp new file mode 100644 index 000000000..6bc1dbd60 --- /dev/null +++ b/.github/workflows/verify_plugin_loads.cpp @@ -0,0 +1,58 @@ + +#include "ofxhBinary.h" +#include "ofxhPluginCache.h" + +int +main(int argc, const char* argv[]) +{ + if (argc < 2) { + std::cerr << "Usage: " << argv[0] << " \n"; + return 1; + } + + const char* const binaryPath = argv[1]; + + // TODO: Change code to _dlHandle = dlopen(_binaryPath.c_str(), RTLD_NOW|RTLD_LOCAL); + OFX::Binary bin(binaryPath); + + if (bin.isInvalid()) { + std::cerr << "error: '" << binaryPath << "' is invalid.\n"; + return 1; + } + + bin.load(); + + if (!bin.isLoaded()) { + std::cerr << "error: '" << binaryPath << "' failed to load.\n"; + return 1; + } + + auto* getNumberOfPlugins = (OFX::Host::OfxGetNumberOfPluginsFunc)bin.findSymbol("OfxGetNumberOfPlugins"); + auto* getPluginFunc = (OFX::Host::OfxGetPluginFunc)bin.findSymbol("OfxGetPlugin"); + + if (getNumberOfPlugins == nullptr || getPluginFunc == nullptr) { + std::cerr << "error: '" << binaryPath << "' missing required symbols.\n"; + return 1; + } + + const int numPlugins = getNumberOfPlugins(); + + std::cout << "numPlugins: " << numPlugins << "\n"; + + if (numPlugins <= 0) { + std::cerr << "error: unexpected number of plugins.\n"; + return 1; + } + + for (int i = 0; i < numPlugins; ++i) { + auto* plugin = getPluginFunc(i); + if (plugin == nullptr) { + std::cerr << "Failed to get plugin " << i << "\n"; + return 1; + } + + std::cout << "plugin[" << i << "] : " << plugin->pluginIdentifier << " v" << plugin->pluginVersionMajor << "." << plugin->pluginVersionMinor << "\n"; + } + + return 0; +} \ No newline at end of file diff --git a/tools/jenkins/genDllVersions.sh b/tools/jenkins/genDllVersions.sh index 1e5a42814..6503dda63 100755 --- a/tools/jenkins/genDllVersions.sh +++ b/tools/jenkins/genDllVersions.sh @@ -254,6 +254,8 @@ catDll libdatrie- catDll libsnappy #catDll libpugixml catDll libheif +catDll libkvazaar- +catDll libcryptopp catDll rav1e catDll libde265- catDll libx265 From 95fd6d53d858358a8122b1335a84e33eb063ffac Mon Sep 17 00:00:00 2001 From: Aaron Colwell <300262+acolwell@users.noreply.github.com> Date: Tue, 20 Feb 2024 12:17:45 -0800 Subject: [PATCH 27/31] Refactor clipIfOverlaps() so it does not have a return value. (#947) This change removes the return value for clipIfOverlaps() and updates all callers. This was done to address a comment made in https://github.com/NatronGitHub/Natron/pull/930#discussion_r1363398756 - Removed return value from RectI::clipIfOverlaps() and RectD::clipIfOverlaps() - Introduced clip() that updates a RectI or RectD with the intersection of itself and another rectangle. - Reworked several clipIfOverlaps() callers to use clip() or intersect() instead of clipIfOverlaps(). --- Engine/EffectInstanceRenderRoI.cpp | 10 ++-- Engine/Image.cpp | 92 ++++++++++++++++-------------- Engine/Lut.cpp | 42 +++++++------- Engine/RectD.h | 17 ++++-- Engine/RectI.h | 17 ++++-- Engine/ViewerInstance.cpp | 3 +- Gui/ViewerGLPrivate.cpp | 3 +- 7 files changed, 106 insertions(+), 78 deletions(-) diff --git a/Engine/EffectInstanceRenderRoI.cpp b/Engine/EffectInstanceRenderRoI.cpp index dcaa11088..42c080259 100644 --- a/Engine/EffectInstanceRenderRoI.cpp +++ b/Engine/EffectInstanceRenderRoI.cpp @@ -738,7 +738,8 @@ EffectInstance::renderRoI(const RenderRoIArgs & args, roi = args.roi.toNewMipmapLevel(args.mipmapLevel, 0, par, rod); if (frameArgs->tilesSupported) { - if (!roi.clipIfOverlaps(upscaledImageBoundsNc)) { + roi.clip(upscaledImageBoundsNc); + if (roi.isNull()) { return eRenderRoIRetCodeOk; } assert(upscaledImageBoundsNc.contains(roi)); @@ -747,7 +748,8 @@ EffectInstance::renderRoI(const RenderRoIArgs & args, roi = args.roi; if (frameArgs->tilesSupported) { - if (!roi.clipIfOverlaps(downscaledImageBoundsNc)) { + roi.clip(downscaledImageBoundsNc); + if (roi.isNull()) { return eRenderRoIRetCodeOk; } assert(downscaledImageBoundsNc.contains(roi)); @@ -844,8 +846,8 @@ EffectInstance::renderRoI(const RenderRoIArgs & args, renderMappedMipmapLevel = args.mipmapLevel; renderMappedScale = RenderScale::fromMipmapLevel(renderMappedMipmapLevel); if (frameArgs->tilesSupported) { - roi = args.roi; - if ( !roi.clipIfOverlaps(downscaledImageBoundsNc) ) { + roi = args.roi.intersect(downscaledImageBoundsNc); + if ( roi.isNull() ) { return eRenderRoIRetCodeOk; } } else { diff --git a/Engine/Image.cpp b/Engine/Image.cpp index 0b082107d..52b319a4c 100644 --- a/Engine/Image.cpp +++ b/Engine/Image.cpp @@ -463,8 +463,11 @@ RectI Bitmap::minimalNonMarkedBbox(const RectI & roi) const { RectI realRoi = roi; - if (_dirtyZoneSet && !realRoi.clipIfOverlaps(_dirtyZone)) { - return RectI(); + if (_dirtyZoneSet) { + realRoi.clip(_dirtyZone); + if (realRoi.isNull()) { + return RectI(); + } } return minimalNonMarkedBbox_internal<0>(realRoi, _bounds, _map, NULL); @@ -475,8 +478,11 @@ Bitmap::minimalNonMarkedRects(const RectI & roi, std::list& ret) const { RectI realRoi = roi; - if (_dirtyZoneSet && !realRoi.clipIfOverlaps(_dirtyZone)) { - return; + if (_dirtyZoneSet) { + realRoi.clip(_dirtyZone); + if (realRoi.isNull()) { + return; + } } minimalNonMarkedRects_internal<0>(realRoi, _bounds, _map, ret, NULL); } @@ -487,9 +493,12 @@ Bitmap::minimalNonMarkedBbox_trimap(const RectI & roi, bool* isBeingRenderedElsewhere) const { RectI realRoi = roi; - if (_dirtyZoneSet && !realRoi.clipIfOverlaps(_dirtyZone)) { - *isBeingRenderedElsewhere = false; - return RectI(); + if (_dirtyZoneSet) { + realRoi.clip(_dirtyZone); + if (realRoi.isNull()) { + *isBeingRenderedElsewhere = false; + return RectI(); + } } return minimalNonMarkedBbox_internal<1>(realRoi, _bounds, _map, isBeingRenderedElsewhere); @@ -501,9 +510,12 @@ Bitmap::minimalNonMarkedRects_trimap(const RectI & roi, bool* isBeingRenderedElsewhere) const { RectI realRoi = roi; - if (_dirtyZoneSet && !realRoi.clipIfOverlaps(_dirtyZone)) { - *isBeingRenderedElsewhere = false; - return; + if (_dirtyZoneSet) { + realRoi.clip(_dirtyZone); + if (realRoi.isNull()) { + *isBeingRenderedElsewhere = false; + return; + } } minimalNonMarkedRects_internal<1>(realRoi, _bounds, _map, ret, isBeingRenderedElsewhere); } @@ -905,13 +917,10 @@ Image::pasteFromForDepth(const Image & srcImg, assert( !srcBounds.isNull() ); // only copy the intersection of roi, bounds and otherBounds - RectI roi = srcRoi; - if (!roi.clipIfOverlaps(bounds)) { - // no intersection between roi and the bounds of this image - return; - } - if (!roi.clipIfOverlaps(srcBounds)) { - // no intersection between roi and the bounds of the other image + const RectI roi = srcRoi.intersect(bounds).intersect(srcBounds); + if (roi.isNull()) { + // no intersection between srcRoi and the bounds of this image or + // the bounds of the other image. return; } @@ -1229,17 +1238,14 @@ Image::pasteFrom(const Image & src, glCheckError(); } else if ( (thisStorage == eStorageModeGLTex) && (otherStorage != eStorageModeGLTex) ) { // RAM image to OpenGL texture - RectI dstBounds = getBounds(); - RectI srcBounds = src.getBounds(); + const RectI& dstBounds = getBounds(); + const RectI& srcBounds = src.getBounds(); // only copy the intersection of roi, bounds and otherBounds - RectI roi = srcRoi; - if (!roi.clipIfOverlaps(dstBounds)) { - // no intersection between roi and the bounds of this image - return; - } - if (!roi.clipIfOverlaps(srcBounds)) { - // no intersection between roi and the bounds of the other image + const RectI roi = srcRoi.intersect(dstBounds).intersect(srcBounds); + if (roi.isNull()) { + // no intersection between srcRoi and the bounds of this image or + // the bounds of the other image return; } GLuint pboID = glContext->getPBOId(); @@ -1301,17 +1307,14 @@ Image::pasteFrom(const Image & src, } else if ( (thisStorage != eStorageModeGLTex) && (otherStorage == eStorageModeGLTex) ) { // OpenGL texture to RAM image - RectI dstBounds = getBounds(); - RectI srcBounds = src.getBounds(); + const RectI& dstBounds = getBounds(); + const RectI& srcBounds = src.getBounds(); // only copy the intersection of roi, bounds and otherBounds - RectI roi = srcRoi; - if (!roi.clipIfOverlaps(dstBounds)) { - // no intersection between roi and the bounds of this image - return; - } - if (!roi.clipIfOverlaps(srcBounds)) { - // no intersection between roi and the bounds of the other image + const RectI roi = srcRoi.intersect(dstBounds).intersect(srcBounds); + if (roi.isNull()) { + // no intersection between srcRoi and the bounds of this image or + // the bounds of the other image return; } @@ -1385,8 +1388,8 @@ Image::fillForDepthForComponents(const RectI & roi_, { assert( (getBitDepth() == eImageBitDepthByte && sizeof(PIX) == 1) || (getBitDepth() == eImageBitDepthShort && sizeof(PIX) == 2) || (getBitDepth() == eImageBitDepthFloat && sizeof(PIX) == 4) ); - RectI roi = roi_; - if (!roi.clipIfOverlaps(_bounds)) { + const RectI roi = roi_.intersect(_bounds); + if (roi.isNull()) { // no intersection between roi and the bounds of the image return; } @@ -1454,8 +1457,8 @@ Image::fill(const RectI & roi, QWriteLocker k(&_entryLock); if (getStorageMode() == eStorageModeGLTex) { - RectI realRoI = roi; - if (!realRoI.clipIfOverlaps(_bounds)) { + const RectI realRoI = roi.intersect(_bounds); + if (realRoI.isNull()) { // no intersection between roi and the bounds of the image return; } @@ -1788,6 +1791,7 @@ Image::halveRoIForDepth(const RectI & roi, bool copyBitMap, Image* output) const { + assert( _bounds.contains(roi) ); assert( (getBitDepth() == eImageBitDepthByte && sizeof(PIX) == 1) || (getBitDepth() == eImageBitDepthShort && sizeof(PIX) == 2) || (getBitDepth() == eImageBitDepthFloat && sizeof(PIX) == 4) ); @@ -1823,8 +1827,7 @@ Image::halveRoIForDepth(const RectI & roi, assert( getComponents() == output->getComponents() ); RectI dstRoI; - RectI srcRoI = roi; - srcRoI.clipIfOverlaps(srcBounds); // intersect srcRoI with the region of definition + const RectI srcRoI = roi.intersect(srcBounds); // intersect RoI with the region of definition #ifdef DEBUG_NAN assert(!checkForNaNsNoLock(srcRoI)); #endif @@ -1951,6 +1954,7 @@ Image::halveRoI(const RectI & roi, bool copyBitMap, Image* output) const { + assert( _bounds.contains(roi) ); switch ( getBitDepth() ) { case eImageBitDepthByte: halveRoIForDepth(roi, copyBitMap, output); @@ -1980,6 +1984,7 @@ Image::halve1DImageForDepth(const RectI & roi, assert(width == 1 || height == 1); /// must be 1D assert( output->getComponents() == getComponents() ); + assert( _bounds.contains(roi) ); /// Take the lock for both bitmaps since we're about to read/write from them! QWriteLocker k1(&output->_entryLock); @@ -2075,8 +2080,7 @@ Image::downscaleMipmap(const RectD& dstRod, ///You should not call this function with a level equal to 0. assert(toLevel > fromLevel); - assert(_bounds.x1 <= roi.x1 && roi.x2 <= _bounds.x2 && - _bounds.y1 <= roi.y1 && roi.y2 <= _bounds.y2); + assert(_bounds.contains(roi)); double par = getPixelAspectRatio(); unsigned int downscaleLvls = toLevel - fromLevel; @@ -2279,6 +2283,8 @@ Image::buildMipmapLevel(const RectD& dstRoD, bool copyBitMap, Image* output) const { + assert(_bounds.contains(roi)); + ///The last mip map level we will make with closestPo2 RectI lastLevelRoI = roi.downscalePowerOfTwoSmallestEnclosing(level); diff --git a/Engine/Lut.cpp b/Engine/Lut.cpp index 66f557605..beb113935 100644 --- a/Engine/Lut.cpp +++ b/Engine/Lut.cpp @@ -167,11 +167,12 @@ LutManager::~LutManager() } } -static bool -clip(RectI* what, - const RectI & to) +static RectI +clip2(const RectI& what, + const RectI& srcBounds, + const RectI& dstBounds) { - return what->clipIfOverlaps(to); + return what.intersect(srcBounds).intersect(dstBounds); } #ifdef DEAD_CODE @@ -445,9 +446,9 @@ Lut::to_byte_packed(unsigned char* to, bool premult) const { ///clip the conversion rect to srcBounds and dstBounds - RectI rect = conversionRect; + const RectI rect = clip2(conversionRect, srcBounds, dstBounds); - if ( !clip(&rect, srcBounds) || !clip(&rect, dstBounds) ) { + if ( rect.isNull() ) { return; } @@ -546,9 +547,8 @@ Lut::to_float_packed(float* to, bool premult) const { ///clip the conversion rect to srcBounds and dstBounds - RectI rect = conversionRect; - - if ( !clip(&rect, srcBounds) || !clip(&rect, dstBounds) ) { + const RectI rect = clip2(conversionRect, srcBounds, dstBounds); + if ( rect.isNull()) { return; } @@ -658,8 +658,8 @@ Lut::from_byte_packed(float* to, } ///clip the conversion rect to srcBounds and dstBounds - RectI rect = conversionRect; - if ( !clip(&rect, srcBounds) || !clip(&rect, dstBounds) ) { + const RectI rect = clip2(conversionRect, srcBounds, dstBounds); + if ( rect.isNull() ) { return; } @@ -752,8 +752,8 @@ Lut::from_float_packed(float* to, } ///clip the conversion rect to srcBounds and dstBounds - RectI rect = conversionRect; - if ( !clip(&rect, srcBounds) || !clip(&rect, dstBounds) ) { + const RectI rect = clip2(conversionRect, srcBounds, dstBounds); + if ( rect.isNull() ) { return; } @@ -863,8 +863,8 @@ from_byte_packed(float *to, } ///clip the conversion rect to srcBounds and dstBounds - RectI rect = conversionRect; - if ( !clip(&rect, srcBounds) || !clip(&rect, dstBounds) ) { + const RectI rect = clip2(conversionRect, srcBounds, dstBounds); + if ( rect.isNull() ) { return; } @@ -933,8 +933,8 @@ from_float_packed(float *to, ///clip the conversion rect to srcBounds and dstBounds - RectI rect = conversionRect; - if ( !clip(&rect, srcBounds) || !clip(&rect, dstBounds) ) { + const RectI rect = clip2(conversionRect, srcBounds, dstBounds); + if ( rect.isNull()) { return; } @@ -1132,8 +1132,8 @@ to_byte_packed(unsigned char* to, } ///clip the conversion rect to srcBounds and dstBounds - RectI rect = conversionRect; - if ( !clip(&rect, srcBounds) || !clip(&rect, dstBounds) ) { + const RectI rect = clip2(conversionRect, srcBounds, dstBounds); + if ( rect.isNull() ) { return; } @@ -1241,8 +1241,8 @@ to_float_packed(float* to, } ///clip the conversion rect to srcBounds and dstBounds - RectI rect = conversionRect; - if ( !clip(&rect, srcBounds) || !clip(&rect, dstBounds) ) { + const RectI rect = clip2(conversionRect, srcBounds, dstBounds); + if ( rect.isNull() ) { return; } diff --git a/Engine/RectD.h b/Engine/RectD.h index 2309654c6..5ef81d4ea 100644 --- a/Engine/RectD.h +++ b/Engine/RectD.h @@ -265,14 +265,23 @@ class RectD return intersect(RectD(l, b, r, t)); } + /** + * @brief Updates this rectangle to the intersection of this rectangle and |rect|. If there is no overlap, this rectangle is cleared so it represents a + * null rectangle. + **/ + void clip(const RectD& rect) { + if (!intersectInternal(rect, this)) { + // |rect| does not intersect with *this so clear this object so it becomes a null rectangle. + clear(); + } + } + /** * @brief Updates this rectangle to the intersection rectangle if this rectangle overlaps with rect. If there is no overlap then this rectangle remains unchanged. - * - * @returns True if the rectangles overlap and this rectangle was clipped. **/ - bool clipIfOverlaps(const RectD& rect) + void clipIfOverlaps(const RectD& rect) { - return intersectInternal(rect, this); + intersectInternal(rect, this); } /// returns true if the rect passed as parameter is intersects this one diff --git a/Engine/RectI.h b/Engine/RectI.h index 6b6fab9c7..bcdc8c053 100644 --- a/Engine/RectI.h +++ b/Engine/RectI.h @@ -405,14 +405,23 @@ class RectI return intersect(RectI(x1_, y1_, x2_, y2_)); } + /** + * @brief Updates this rectangle to the intersection of this rectangle and |rect|. If there is no overlap, this rectangle is cleared so it represents a + * null rectangle. + **/ + void clip(const RectI& rect) { + if (!intersectInternal(rect, this)) { + // |rect| does not intersect with *this so clear this object so it becomes a null rectangle. + clear(); + } + } + /** * @brief Updates this rectangle to the intersection rectangle if this rectangle overlaps with rect. If there is no overlap then this rectangle remains unchanged. - * - * @returns True if the rectangles overlap and this rectangle was clipped. **/ - bool clipIfOverlaps(const RectI& rect) + void clipIfOverlaps(const RectI& rect) { - return intersectInternal(rect, this); + intersectInternal(rect, this); } /// returns true if the rect passed as parameter intersects this one diff --git a/Engine/ViewerInstance.cpp b/Engine/ViewerInstance.cpp index bb6de8265..75f86ff27 100644 --- a/Engine/ViewerInstance.cpp +++ b/Engine/ViewerInstance.cpp @@ -1003,7 +1003,8 @@ ViewerInstance::getViewerRoIAndTexture(const RectD& rod, for (std::list::iterator it = partialRects.begin(); it != partialRects.end(); ++it) { RectI pixelRect = it->toPixelEnclosing(mipmapLevel, outArgs->params->pixelAspectRatio); ///Intersect to the RoI - if ( pixelRect.clipIfOverlaps(outArgs->params->roi) ) { + pixelRect.clip(outArgs->params->roi); + if ( !pixelRect.isNull() ) { tile.rect.set(pixelRect); tile.rectRounded = pixelRect; tile.rect.closestPo2 = 1 << mipmapLevel; diff --git a/Gui/ViewerGLPrivate.cpp b/Gui/ViewerGLPrivate.cpp index 94ca0709b..72deb4f23 100644 --- a/Gui/ViewerGLPrivate.cpp +++ b/Gui/ViewerGLPrivate.cpp @@ -294,7 +294,8 @@ ViewerGL::Implementation::drawRenderingVAO(unsigned int mipmapLevel, { QMutexLocker l(&this->userRoIMutex); //if the userRoI isn't intersecting the rod, just don't render anything - if ( !rod.clipIfOverlaps(this->userRoI) ) { + rod.clip(this->userRoI); + if ( rod.isNull() ) { return; } } From fea1bbf1b0ccbcfdf88f9419bc67d253a4878077 Mon Sep 17 00:00:00 2001 From: Aaron Colwell <300262+acolwell@users.noreply.github.com> Date: Sun, 10 Mar 2024 11:58:29 -0700 Subject: [PATCH 28/31] Fix QMutexLocker bug (#950) Fixing GenericWatcher::scheduleBlockingTask() so that it actually holds the tasksMutex when it is pushing new task information. --- Engine/GenericSchedulerThreadWatcher.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Engine/GenericSchedulerThreadWatcher.cpp b/Engine/GenericSchedulerThreadWatcher.cpp index 964364e63..59dddd7cf 100644 --- a/Engine/GenericSchedulerThreadWatcher.cpp +++ b/Engine/GenericSchedulerThreadWatcher.cpp @@ -180,7 +180,7 @@ GenericWatcher::scheduleBlockingTask(int taskID, } { - QMutexLocker(&_imp->tasksMutex); + QMutexLocker k(&_imp->tasksMutex); GenericWatcherPrivate::Task t; t.id = taskID; t.args = args; From d03dc06cc92e3d1375c3f22a5e063841573bd951 Mon Sep 17 00:00:00 2001 From: Aaron Colwell <300262+acolwell@users.noreply.github.com> Date: Tue, 12 Mar 2024 05:35:49 -0700 Subject: [PATCH 29/31] Fix more QMutexLocker usage. (#952) Fixes more instances of unnamed QMutexLocker objects that were not holding the lock for the duration of the containing scope. --- Gui/ViewerGL.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/Gui/ViewerGL.cpp b/Gui/ViewerGL.cpp index 70ceaba3c..b8aaf3f12 100644 --- a/Gui/ViewerGL.cpp +++ b/Gui/ViewerGL.cpp @@ -203,7 +203,7 @@ ViewerGL::resizeGL(int w, bool zoomSinceLastFit; double oldWidth, oldHeight; { - QMutexLocker(&_imp->zoomCtxMutex); + QMutexLocker l(&_imp->zoomCtxMutex); oldWidth = _imp->zoomCtx.screenWidth(); oldHeight = _imp->zoomCtx.screenHeight(); _imp->zoomCtx.setScreenSize(zoomWidth, zoomHeight, /*alignTop=*/ true, /*alignRight=*/ false); @@ -2911,7 +2911,7 @@ ViewerGL::fitImageToFormat() double zoomFactor; unsigned int oldMipmapLevel, newMipmapLevel; { - QMutexLocker(&_imp->zoomCtxMutex); + QMutexLocker l(&_imp->zoomCtxMutex); old_zoomFactor = _imp->zoomCtx.factor(); //oldMipmapLevel = std::log( old_zoomFactor >= 1 ? 1 : // std::pow( 2, -std::ceil(std::log(old_zoomFactor) / M_LN2) ) ) / M_LN2; @@ -3467,7 +3467,7 @@ ViewerGL::setUserRoIEnabled(bool b) // always running in the main thread assert( qApp && qApp->thread() == QThread::currentThread() ); { - QMutexLocker(&_imp->userRoIMutex); + QMutexLocker l(&_imp->userRoIMutex); _imp->userRoIEnabled = b; } if (!b) { @@ -3568,7 +3568,7 @@ bool ViewerGL::isUserRegionOfInterestEnabled() const { // MT-SAFE - QMutexLocker(&_imp->userRoIMutex); + QMutexLocker l(&_imp->userRoIMutex); return _imp->userRoIEnabled; } @@ -3577,7 +3577,7 @@ RectD ViewerGL::getUserRegionOfInterest() const { // MT-SAFE - QMutexLocker(&_imp->userRoIMutex); + QMutexLocker l(&_imp->userRoIMutex); return _imp->userRoI; } @@ -3586,7 +3586,7 @@ void ViewerGL::setUserRoI(const RectD & r) { // MT-SAFE - QMutexLocker(&_imp->userRoIMutex); + QMutexLocker l(&_imp->userRoIMutex); _imp->userRoI = r; } From 9679f5727f7819a18965cde96c0115b2f903fbea Mon Sep 17 00:00:00 2001 From: Aaron Colwell <300262+acolwell@users.noreply.github.com> Date: Tue, 12 Mar 2024 22:54:07 -0700 Subject: [PATCH 30/31] Fix crashing on startup with AMD GPUs (#949) * Introduce ScopedGLContext to simplify temporary contexts in OSGLContext_win. * Fix crashing on startup for AMD GPUs. This change makes sure there is an active context when GetGPUInfoAMD() is called. While it is not explicitly stated in https://www.opengl.org/registry/specs/AMD/wgl_gpu_association.txt that a GL context needs to be current, it is somewhat implied by the fact that these extension methods are fetched via wglGetProcAddress(). According to the Windows docs, function addresses are specific to a context so using them without an active context seems to be undefined territory. This should fix #948 --- Engine/OSGLContext_win.cpp | 208 ++++++++++++++++++------------------- 1 file changed, 104 insertions(+), 104 deletions(-) diff --git a/Engine/OSGLContext_win.cpp b/Engine/OSGLContext_win.cpp index 3665c4c03..b9b78ff28 100644 --- a/Engine/OSGLContext_win.cpp +++ b/Engine/OSGLContext_win.cpp @@ -693,7 +693,6 @@ static std::string GetGPUInfoAMDInternal_string(const OSGLContext_wgl_data* wglI static bool GetGPUInfoAMDInternal_int(const OSGLContext_wgl_data* wglInfo, UINT gpuID, int info, int* value) { - std::vector data; int totalSize = 0; @@ -719,6 +718,36 @@ static bool GetGPUInfoAMDInternal_int(const OSGLContext_wgl_data* wglInfo, UINT return true; } +namespace { +class ScopedGLContext { +public: + ScopedGLContext(const GLRendererID& gid) { + assert(!OSGLContext_win::threadHasACurrentContext()); + try { + _context = std::make_unique(FramebufferConfig(), GLVersion.major, GLVersion.minor, false, gid, nullptr); + } catch (const std::exception& e) { + std::cerr << "Failed to create GL context : " << e.what() << std::endl; + return; + } + + if (!OSGLContext_win::makeContextCurrent(_context.get())) { + _context.reset(); + } + } + + ~ScopedGLContext() { + if (_context) { + OSGLContext_win::makeContextCurrent(nullptr); + } + } + + explicit operator bool() const { return (bool)_context; } + +private: + std::unique_ptr _context; +}; +} // namespace + void OSGLContext_win::getGPUInfos(std::list& renderers) { @@ -749,37 +778,27 @@ OSGLContext_win::getGPUInfos(std::list& renderers) for (std::size_t i = 0; i < gpuHandles.size(); ++i) { OpenGLRendererInfo info; info.rendererID.rendererHandle = (void*)gpuHandles[i]; + { + ScopedGLContext scopedContext(info.rendererID); + if (!scopedContext) { + continue; + } - std::unique_ptr context; - try { - GLRendererID gid; - gid.rendererHandle = info.rendererID.rendererHandle; - context.reset( new OSGLContext_win(FramebufferConfig(), GLVersion.major, GLVersion.minor, false, gid, 0) ); - } catch (const std::exception& e) { - continue; - } - - if ( !makeContextCurrent( context.get() ) ) { - continue; - } + try { + OSGLContext::checkOpenGLVersion(); + } catch (const std::exception& e) { + std::cerr << e.what() << std::endl; + continue; + } - try { - OSGLContext::checkOpenGLVersion(); - } catch (const std::exception& e) { - std::cerr << e.what() << std::endl; - makeContextCurrent(nullptr); - continue; + info.vendorName = std::string( (const char *) glGetString(GL_VENDOR) ); + info.rendererName = std::string( (const char *) glGetString(GL_RENDERER) ); + info.glVersionString = std::string( (const char *) glGetString(GL_VERSION) ); + info.glslVersionString = std::string( (const char*)glGetString (GL_SHADING_LANGUAGE_VERSION) ); + info.maxMemBytes = nvx_get_GPU_mem_info(); + glGetIntegerv(GL_MAX_TEXTURE_SIZE, &info.maxTextureSize); + renderers.push_back(info); } - - info.vendorName = std::string( (const char *) glGetString(GL_VENDOR) ); - info.rendererName = std::string( (const char *) glGetString(GL_RENDERER) ); - info.glVersionString = std::string( (const char *) glGetString(GL_VERSION) ); - info.glslVersionString = std::string( (const char*)glGetString (GL_SHADING_LANGUAGE_VERSION) ); - info.maxMemBytes = nvx_get_GPU_mem_info(); - glGetIntegerv(GL_MAX_TEXTURE_SIZE, &info.maxTextureSize); - renderers.push_back(info); - - makeContextCurrent(nullptr); } } else if (wglInfo->AMD_gpu_association && !isApplication32Bits()) { //https://www.opengl.org/registry/specs/AMD/wgl_gpu_association.txt @@ -798,62 +817,52 @@ OSGLContext_win::getGPUInfos(std::list& renderers) UINT gpuID = gpuIDs[index]; OpenGLRendererInfo info; - info.rendererName = GetGPUInfoAMDInternal_string(wglInfo, gpuID, WGL_GPU_RENDERER_STRING_AMD); - if (info.rendererName.empty()) { - continue; - } - - info.vendorName = GetGPUInfoAMDInternal_string(wglInfo, gpuID, WGL_GPU_VENDOR_AMD); - if (info.vendorName.empty()) { - continue; - } + info.rendererID.renderID = gpuID; - info.glVersionString = GetGPUInfoAMDInternal_string(wglInfo, gpuID, WGL_GPU_OPENGL_VERSION_STRING_AMD); - if (info.glVersionString.empty()) { - continue; - } + { + ScopedGLContext scopedContext(info.rendererID); + if (!scopedContext) { + continue; + } - // note: cannot retrieve GL_SHADING_LANGUAGE_VERSION + info.rendererName = GetGPUInfoAMDInternal_string(wglInfo, gpuID, WGL_GPU_RENDERER_STRING_AMD); + if (info.rendererName.empty()) { + continue; + } - info.maxMemBytes = 0; - if (!isApplication32Bits()) { - int ramMB = 0; - // AMD drivers are f*** up in 32 bits, they read a wrong buffer size. - // It works fine in 64 bits mode - if (!GetGPUInfoAMDInternal_int(wglInfo, gpuID, WGL_GPU_RAM_AMD, &ramMB)) { + info.vendorName = GetGPUInfoAMDInternal_string(wglInfo, gpuID, WGL_GPU_VENDOR_AMD); + if (info.vendorName.empty()) { continue; } - info.maxMemBytes = ramMB * 1e6; - } - info.rendererID.renderID = gpuID; - - std::unique_ptr context; + info.glVersionString = GetGPUInfoAMDInternal_string(wglInfo, gpuID, WGL_GPU_OPENGL_VERSION_STRING_AMD); + if (info.glVersionString.empty()) { + continue; + } - GLRendererID gid; - gid.renderID = info.rendererID.renderID; - try { - context.reset( new OSGLContext_win(FramebufferConfig(), GLVersion.major, GLVersion.minor, false, gid, 0) ); - } catch (const std::exception& e) { - continue; - } + // note: cannot retrieve GL_SHADING_LANGUAGE_VERSION + + info.maxMemBytes = 0; + if (!isApplication32Bits()) { + int ramMB = 0; + // AMD drivers are f*** up in 32 bits, they read a wrong buffer size. + // It works fine in 64 bits mode + if (!GetGPUInfoAMDInternal_int(wglInfo, gpuID, WGL_GPU_RAM_AMD, &ramMB)) { + continue; + } + info.maxMemBytes = ramMB * 1e6; + } - if ( !makeContextCurrent( context.get() ) ) { - continue; - } + try { + OSGLContext::checkOpenGLVersion(); + } catch (const std::exception& e) { + std::cerr << e.what() << std::endl; + continue; + } - try { - OSGLContext::checkOpenGLVersion(); - } catch (const std::exception& e) { - std::cerr << e.what() << std::endl; - makeContextCurrent(nullptr); - continue; + glGetIntegerv(GL_MAX_TEXTURE_SIZE, &info.maxTextureSize); + renderers.push_back(info); } - - glGetIntegerv(GL_MAX_TEXTURE_SIZE, &info.maxTextureSize); - renderers.push_back(info); - - makeContextCurrent(nullptr); } } } @@ -863,38 +872,29 @@ OSGLContext_win::getGPUInfos(std::list& renderers) } if (defaultFallback) { // No extension, use default - std::unique_ptr context; - try { - context.reset( new OSGLContext_win(FramebufferConfig(), GLVersion.major, GLVersion.minor, false, GLRendererID(), 0) ); - } catch (const std::exception& e) { - std::cerr << e.what() << std::endl; - - return; - } + { + ScopedGLContext scopedContext{GLRendererID()}; + if (!scopedContext) { + return; + } - if ( !makeContextCurrent( context.get() ) ) { - return; - } + try { + OSGLContext::checkOpenGLVersion(); + } catch (const std::exception& e) { + std::cerr << e.what() << std::endl; + return; + } - try { - OSGLContext::checkOpenGLVersion(); - } catch (const std::exception& e) { - std::cerr << e.what() << std::endl; - makeContextCurrent(nullptr); - return; + OpenGLRendererInfo info; + info.vendorName = std::string( (const char *) glGetString(GL_VENDOR) ); + info.rendererName = std::string( (const char *) glGetString(GL_RENDERER) ); + info.glVersionString = std::string( (const char *) glGetString(GL_VERSION) ); + info.glslVersionString = std::string( (const char *) glGetString (GL_SHADING_LANGUAGE_VERSION) ); + glGetIntegerv(GL_MAX_TEXTURE_SIZE, &info.maxTextureSize); + // We don't have any way to get memory size, set it to 0 + info.maxMemBytes = nvx_get_GPU_mem_info(); + renderers.push_back(info); } - - OpenGLRendererInfo info; - info.vendorName = std::string( (const char *) glGetString(GL_VENDOR) ); - info.rendererName = std::string( (const char *) glGetString(GL_RENDERER) ); - info.glVersionString = std::string( (const char *) glGetString(GL_VERSION) ); - info.glslVersionString = std::string( (const char *) glGetString (GL_SHADING_LANGUAGE_VERSION) ); - glGetIntegerv(GL_MAX_TEXTURE_SIZE, &info.maxTextureSize); - // We don't have any way to get memory size, set it to 0 - info.maxMemBytes = nvx_get_GPU_mem_info(); - renderers.push_back(info); - - makeContextCurrent(nullptr); } } // OSGLContext_win::getGPUInfos From 3a0271d22baffeaeecbc0125a744ce140d400d4e Mon Sep 17 00:00:00 2001 From: Aaron Colwell <300262+acolwell@users.noreply.github.com> Date: Fri, 15 Mar 2024 12:09:58 -0700 Subject: [PATCH 31/31] Fix documentation CSS. (#956) This change fixes the documentation generation so that the CSS styles start working again. --- Documentation/source/conf.py | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/Documentation/source/conf.py b/Documentation/source/conf.py index b11d67b29..118ababa5 100644 --- a/Documentation/source/conf.py +++ b/Documentation/source/conf.py @@ -136,12 +136,7 @@ # so a file named "default.css" will overwrite the builtin "default.css". html_static_path = ['_static'] -# https://rackerlabs.github.io/docs-rackspace/tools/rtd-tables.html -html_context = { - 'css_files': [ - '_static/theme_overrides.css', # override wide tables in RTD theme - ], - } +html_css_files = ['theme_overrides.css'] # If not '', a 'Last updated on:' timestamp is inserted at every page bottom, # using the given strftime format.