diff options
Diffstat (limited to 'source/blender/compositor/COM_defines.h')
-rw-r--r-- | source/blender/compositor/COM_defines.h | 53 |
1 files changed, 45 insertions, 8 deletions
diff --git a/source/blender/compositor/COM_defines.h b/source/blender/compositor/COM_defines.h index 266f532ebb8..5a5868f1909 100644 --- a/source/blender/compositor/COM_defines.h +++ b/source/blender/compositor/COM_defines.h @@ -18,6 +18,8 @@ #pragma once +namespace blender::compositor { + /** * \brief possible data types for sockets * \ingroup Model @@ -32,6 +34,25 @@ enum class DataType { }; /** + * Utility to get the number of channels of the given data type. + */ +constexpr int COM_data_type_num_channels(const DataType datatype) +{ + switch (datatype) { + case DataType::Value: + return 1; + case DataType::Vector: + return 3; + case DataType::Color: + default: + return 4; + } +} + +constexpr int COM_DATA_TYPE_VALUE_CHANNELS = COM_data_type_num_channels(DataType::Value); +constexpr int COM_DATA_TYPE_COLOR_CHANNELS = COM_data_type_num_channels(DataType::Color); + +/** * \brief Possible quality settings * \see CompositorContext.quality * \ingroup Execution @@ -58,11 +79,29 @@ enum class CompositorPriority { Low = 0, }; +/** + * \brief the execution state of a chunk in an ExecutionGroup + * \ingroup Execution + */ +enum class eChunkExecutionState { + /** + * \brief chunk is not yet scheduled + */ + NotScheduled = 0, + /** + * \brief chunk is scheduled, but not yet executed + */ + Scheduled = 1, + /** + * \brief chunk is executed. + */ + Executed = 2, +}; + // configurable items // chunk size determination -#define COM_PREVIEW_SIZE 140.0f -//#define COM_DEBUG +// #define COM_DEBUG // chunk order /** @@ -82,10 +121,8 @@ enum class ChunkOrdering { Default = ChunkOrdering::CenterOut, }; -#define COM_RULE_OF_THIRDS_DIVIDER 100.0f - -#define COM_NUM_CHANNELS_VALUE 1 -#define COM_NUM_CHANNELS_VECTOR 3 -#define COM_NUM_CHANNELS_COLOR 4 +constexpr float COM_PREVIEW_SIZE = 140.f; +constexpr float COM_RULE_OF_THIRDS_DIVIDER = 100.0f; +constexpr float COM_BLUR_BOKEH_PIXELS = 512; -#define COM_BLUR_BOKEH_PIXELS 512 +} // namespace blender::compositor |