Commit 5d8d60b4 authored by Hugo Beauzée-Luyssen's avatar Hugo Beauzée-Luyssen

Frame: Adding a clone method.

parent 45e99e69
......@@ -24,6 +24,8 @@
using namespace Workflow;
#include <cstring> //memcpy
Frame::Frame( quint32 width, quint32 height ) :
ptsDiff( 0 ),
m_width( width ),
......@@ -67,3 +69,11 @@ Frame::size() const
{
return m_size;
}
Frame*
Frame::clone() const
{
Frame *f = new Frame( m_width, m_height );
memcpy( f->buffer(), m_buffer, m_size );
return f;
}
......@@ -38,6 +38,7 @@ namespace Workflow
quint32 height() const;
quint8 *buffer();
const quint8 *buffer() const;
Frame *clone() const;
/**
* \returns The frame size in pixels
*
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment