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:
Diffstat (limited to 'source/blender/compositor/intern/COM_MemoryBuffer.cpp')
-rw-r--r--source/blender/compositor/intern/COM_MemoryBuffer.cpp27
1 files changed, 27 insertions, 0 deletions
diff --git a/source/blender/compositor/intern/COM_MemoryBuffer.cpp b/source/blender/compositor/intern/COM_MemoryBuffer.cpp
index 0aae8853795..f8c842d8e67 100644
--- a/source/blender/compositor/intern/COM_MemoryBuffer.cpp
+++ b/source/blender/compositor/intern/COM_MemoryBuffer.cpp
@@ -87,6 +87,33 @@ float *MemoryBuffer::convertToValueBuffer()
return result;
}
+float MemoryBuffer::getMaximumValue()
+{
+ float result = this->m_buffer[0];
+ const unsigned int size = this->determineBufferSize();
+ unsigned int i;
+
+ const float *fp_src = this->m_buffer;
+
+ for (i = 0; i < size; i++, fp_src += COM_NUMBER_OF_CHANNELS) {
+ float value = *fp_src;
+ if (value > result) {
+ result = value;
+ }
+ }
+
+ return result;
+}
+
+float MemoryBuffer::getMaximumValue(rcti* rect)
+{
+ MemoryBuffer *temp = new MemoryBuffer(NULL, rect);
+ temp->copyContentFrom(this);
+ float result = temp->getMaximumValue();
+ delete temp;
+ return result;
+}
+
MemoryBuffer::~MemoryBuffer()
{
if (this->m_buffer) {