diff options
author | Kae <80987908+Novaenia@users.noreply.github.com> | 2023-06-24 19:41:52 +1000 |
---|---|---|
committer | Kae <80987908+Novaenia@users.noreply.github.com> | 2023-06-24 19:41:52 +1000 |
commit | 7bde128a87268751e1f46174a64ffd78b03bf8bc (patch) | |
tree | b27dd239831fa803d019e35f08f209b1d9e091ea /source/core/StarImageProcessing.cpp | |
parent | 51a9de3af37eb8a6844a2dd5f3f568f3956726db (diff) |
DirectivesGroup prototype
Diffstat (limited to 'source/core/StarImageProcessing.cpp')
-rw-r--r-- | source/core/StarImageProcessing.cpp | 19 |
1 files changed, 11 insertions, 8 deletions
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<ImageOperation> const& list) { return StringList(list.transformed(imageOperationToString)).join("?"); } +void addImageOperationReferences(ImageOperation const& operation, StringList& out) { + if (auto op = operation.ptr<AlphaMaskImageOperation>()) + out.appendAll(op->maskImages); + else if (auto op = operation.ptr<BlendImageOperation>()) + out.appendAll(op->blendImages); +} + StringList imageOperationReferences(List<ImageOperation> const& operations) { StringList references; - for (auto const& operation : operations) { - if (auto op = operation.ptr<AlphaMaskImageOperation>()) - references.appendAll(op->maskImages); - else if (auto op = operation.ptr<BlendImageOperation>()) - 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<AlphaMaskImageOperation>()) { 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<BlendImageOperation>()) { if (op->blendImages.empty()) - continue; + return; if (!refCallback) throw StarException("Missing image ref callback during BlendImageOperation in ImageProcessor::process"); |