diff options
author | Jeroen Bakker <jeroen@blender.org> | 2021-03-19 16:05:07 +0300 |
---|---|---|
committer | Jeroen Bakker <jeroen@blender.org> | 2021-03-19 19:11:47 +0300 |
commit | 9c2d4ffbc1d7b25acf865054441b204db04ce1dd (patch) | |
tree | 05aee64a6ffd371907748e4e705dd42f5c21b111 /source/blender/compositor | |
parent | de504e6dec54b7713bea6327005a094e5d2227fc (diff) |
Cleanup: Use enum class for CompositorQuality.
Diffstat (limited to 'source/blender/compositor')
5 files changed, 15 insertions, 15 deletions
diff --git a/source/blender/compositor/COM_defines.h b/source/blender/compositor/COM_defines.h index 014d5a8d8e0..daa64ccef24 100644 --- a/source/blender/compositor/COM_defines.h +++ b/source/blender/compositor/COM_defines.h @@ -36,14 +36,14 @@ typedef enum DataType { * \see CompositorContext.quality * \ingroup Execution */ -typedef enum CompositorQuality { +enum class CompositorQuality { /** \brief High quality setting */ - COM_QUALITY_HIGH = 0, + High = 0, /** \brief Medium quality setting */ - COM_QUALITY_MEDIUM = 1, + Medium = 1, /** \brief Low quality setting */ - COM_QUALITY_LOW = 2, -} CompositorQuality; + Low = 2, +}; /** * \brief Possible priority settings diff --git a/source/blender/compositor/intern/COM_CompositorContext.cc b/source/blender/compositor/intern/COM_CompositorContext.cc index 2e168221b7b..e2447fb5c13 100644 --- a/source/blender/compositor/intern/COM_CompositorContext.cc +++ b/source/blender/compositor/intern/COM_CompositorContext.cc @@ -24,7 +24,7 @@ CompositorContext::CompositorContext() { this->m_scene = nullptr; this->m_rd = nullptr; - this->m_quality = COM_QUALITY_HIGH; + this->m_quality = CompositorQuality::High; this->m_hasActiveOpenCLDevices = false; this->m_fastCalculation = false; this->m_viewSettings = nullptr; diff --git a/source/blender/compositor/nodes/COM_DefocusNode.cc b/source/blender/compositor/nodes/COM_DefocusNode.cc index 393b1f2dabb..2343b14f68d 100644 --- a/source/blender/compositor/nodes/COM_DefocusNode.cc +++ b/source/blender/compositor/nodes/COM_DefocusNode.cc @@ -110,7 +110,7 @@ void DefocusNode::convertToOperations(NodeConverter &converter, VariableSizeBokehBlurOperation *operation = new VariableSizeBokehBlurOperation(); if (data->preview) { - operation->setQuality(COM_QUALITY_LOW); + operation->setQuality(CompositorQuality::Low); } else { operation->setQuality(context.getQuality()); diff --git a/source/blender/compositor/nodes/COM_DisplaceNode.cc b/source/blender/compositor/nodes/COM_DisplaceNode.cc index 0c0c3aad646..5b63bc1f393 100644 --- a/source/blender/compositor/nodes/COM_DisplaceNode.cc +++ b/source/blender/compositor/nodes/COM_DisplaceNode.cc @@ -30,7 +30,7 @@ void DisplaceNode::convertToOperations(NodeConverter &converter, const CompositorContext &context) const { NodeOperation *operation; - if (context.getQuality() == COM_QUALITY_LOW) { + if (context.getQuality() == CompositorQuality::Low) { operation = new DisplaceSimpleOperation(); } else { diff --git a/source/blender/compositor/operations/COM_QualityStepHelper.cc b/source/blender/compositor/operations/COM_QualityStepHelper.cc index 3eb8d528f7a..c0d86314fb7 100644 --- a/source/blender/compositor/operations/COM_QualityStepHelper.cc +++ b/source/blender/compositor/operations/COM_QualityStepHelper.cc @@ -20,7 +20,7 @@ QualityStepHelper::QualityStepHelper() { - this->m_quality = COM_QUALITY_HIGH; + this->m_quality = CompositorQuality::High; this->m_step = 1; this->m_offsetadd = 4; } @@ -30,16 +30,16 @@ void QualityStepHelper::initExecution(QualityHelper helper) switch (helper) { case COM_QH_INCREASE: switch (this->m_quality) { - case COM_QUALITY_HIGH: + case CompositorQuality::High: default: this->m_step = 1; this->m_offsetadd = 1; break; - case COM_QUALITY_MEDIUM: + case CompositorQuality::Medium: this->m_step = 2; this->m_offsetadd = 2; break; - case COM_QUALITY_LOW: + case CompositorQuality::Low: this->m_step = 3; this->m_offsetadd = 3; break; @@ -47,16 +47,16 @@ void QualityStepHelper::initExecution(QualityHelper helper) break; case COM_QH_MULTIPLY: switch (this->m_quality) { - case COM_QUALITY_HIGH: + case CompositorQuality::High: default: this->m_step = 1; this->m_offsetadd = 4; break; - case COM_QUALITY_MEDIUM: + case CompositorQuality::Medium: this->m_step = 2; this->m_offsetadd = 8; break; - case COM_QUALITY_LOW: + case CompositorQuality::Low: this->m_step = 4; this->m_offsetadd = 16; break; |