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:
authorManuel Castilla <manzanillawork@gmail.com>2021-06-23 18:21:17 +0300
committerManuel Castilla <manzanillawork@gmail.com>2021-06-23 18:46:53 +0300
commit35db01325f41da34e5a71d2b28cc717cddbdb996 (patch)
tree923bfa9c71e1eda1f1fc25c01a7ebbd0382f0d49 /source/blender/compositor/COM_defines.h
parent8f4d99159404621a9063f4bd155a519baf51f313 (diff)
Compositor: Full frame Image node
Adds full frame implementation to Image node operations. Mostly refactored into buffer utility methods for reuse in other operations. No functional changes. 1.8x faster than tiled fallback. Reviewed By: jbakker Differential Revision: https://developer.blender.org/D11559
Diffstat (limited to 'source/blender/compositor/COM_defines.h')
-rw-r--r--source/blender/compositor/COM_defines.h18
1 files changed, 18 insertions, 0 deletions
diff --git a/source/blender/compositor/COM_defines.h b/source/blender/compositor/COM_defines.h
index 5a52d216117..857cbf0beee 100644
--- a/source/blender/compositor/COM_defines.h
+++ b/source/blender/compositor/COM_defines.h
@@ -62,6 +62,24 @@ constexpr int COM_data_type_num_channels(const DataType datatype)
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);
+constexpr float COM_VALUE_ZERO[1] = {0.0f};
+
+/**
+ * Utility to get data type for given number of channels.
+ */
+constexpr DataType COM_num_channels_data_type(const int num_channels)
+{
+ switch (num_channels) {
+ case 1:
+ return DataType::Value;
+ case 3:
+ return DataType::Vector;
+ case 4:
+ default:
+ return DataType::Color;
+ }
+}
+
// configurable items
// chunk size determination