From 7bde128a87268751e1f46174a64ffd78b03bf8bc Mon Sep 17 00:00:00 2001 From: Kae <80987908+Novaenia@users.noreply.github.com> Date: Sat, 24 Jun 2023 19:41:52 +1000 Subject: DirectivesGroup prototype --- source/core/StarImageProcessing.cpp | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) (limited to 'source/core/StarImageProcessing.cpp') diff --git a/source/core/StarImageProcessing.cpp b/source/core/StarImageProcessing.cpp index fc99f69..c2f980e 100644 --- a/source/core/StarImageProcessing.cpp +++ b/source/core/StarImageProcessing.cpp @@ -352,14 +352,17 @@ String printImageOperations(List const& list) { return StringList(list.transformed(imageOperationToString)).join("?"); } +void addImageOperationReferences(ImageOperation const& operation, StringList& out) { + if (auto op = operation.ptr()) + out.appendAll(op->maskImages); + else if (auto op = operation.ptr()) + out.appendAll(op->blendImages); +} + StringList imageOperationReferences(List const& operations) { StringList references; - for (auto const& operation : operations) { - if (auto op = operation.ptr()) - references.appendAll(op->maskImages); - else if (auto op = operation.ptr()) - references.appendAll(op->blendImages); - } + for (auto const& operation : operations) + addImageOperationReferences(operation, references); return references; } @@ -417,7 +420,7 @@ void processImageOperation(ImageOperation const& operation, Image& image, ImageR } else if (auto op = operation.ptr()) { if (op->maskImages.empty()) - continue; + return; if (!refCallback) throw StarException("Missing image ref callback during AlphaMaskImageOperation in ImageProcessor::process"); @@ -449,7 +452,7 @@ void processImageOperation(ImageOperation const& operation, Image& image, ImageR } else if (auto op = operation.ptr()) { if (op->blendImages.empty()) - continue; + return; if (!refCallback) throw StarException("Missing image ref callback during BlendImageOperation in ImageProcessor::process"); -- cgit v1.2.3