Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeroen Bakker <jeroen@blender.org>2021-03-30 13:27:53 +0300
committerJeroen Bakker <jeroen@blender.org>2021-03-30 17:03:43 +0300
commit04a92297ddfb86b1766733461f01104bcbd5b38e (patch)
treede724e43767f0bd01b51517c9a4684a2b9c5271c /source/blender/compositor/operations/COM_CryptomatteOperation.cc
parentd4e76712d4fdf55815cf59df52ffa35df84ed09a (diff)
Cleanup: Replace std::vector with blender::Vector.
Diffstat (limited to 'source/blender/compositor/operations/COM_CryptomatteOperation.cc')
-rw-r--r--source/blender/compositor/operations/COM_CryptomatteOperation.cc10
1 files changed, 5 insertions, 5 deletions
diff --git a/source/blender/compositor/operations/COM_CryptomatteOperation.cc b/source/blender/compositor/operations/COM_CryptomatteOperation.cc
index 63bbca66296..52ae1d6d5b5 100644
--- a/source/blender/compositor/operations/COM_CryptomatteOperation.cc
+++ b/source/blender/compositor/operations/COM_CryptomatteOperation.cc
@@ -22,10 +22,10 @@ namespace blender::compositor {
CryptomatteOperation::CryptomatteOperation(size_t num_inputs)
{
+ inputs.resize(num_inputs);
for (size_t i = 0; i < num_inputs; i++) {
this->addInputSocket(DataType::Color);
}
- inputs.resize(num_inputs);
this->addOutputSocket(DataType::Color);
this->flags.complex = true;
}
@@ -40,7 +40,7 @@ void CryptomatteOperation::initExecution()
void CryptomatteOperation::addObjectIndex(float objectIndex)
{
if (objectIndex != 0.0f) {
- m_objectIndex.push_back(objectIndex);
+ m_objectIndex.append(objectIndex);
}
}
@@ -60,11 +60,11 @@ void CryptomatteOperation::executePixel(float output[4], int x, int y, void *dat
output[1] = ((float)((m3hash << 8)) / (float)UINT32_MAX);
output[2] = ((float)((m3hash << 16)) / (float)UINT32_MAX);
}
- for (size_t i = 0; i < m_objectIndex.size(); i++) {
- if (m_objectIndex[i] == input[0]) {
+ for (float hash : m_objectIndex) {
+ if (input[0] == hash) {
output[3] += input[1];
}
- if (m_objectIndex[i] == input[2]) {
+ if (input[2] == hash) {
output[3] += input[3];
}
}