MCPcopy Create free account
hub / github.com/OpenShot/libopenshot / DeepCopy

Method DeepCopy

src/Frame.cpp:86–107  ·  view source on GitHub ↗

Copy data and pointers from another Frame instance

Source from the content-addressed store, hash-verified

84
85// Copy data and pointers from another Frame instance
86void Frame::DeepCopy(const Frame& other)
87{
88 number = other.number;
89 channels = other.channels;
90 width = other.width;
91 height = other.height;
92 channel_layout = other.channel_layout;
93 has_audio_data = other.has_audio_data;
94 has_image_data = other.has_image_data;
95 sample_rate = other.sample_rate;
96 pixel_ratio = Fraction(other.pixel_ratio.num, other.pixel_ratio.den);
97 color = other.color;
98 max_audio_sample = other.max_audio_sample;
99 audio_is_increasing = other.audio_is_increasing;
100
101 if (other.image)
102 image = std::make_shared<QImage>(*(other.image));
103 if (other.audio)
104 audio = std::make_shared<juce::AudioBuffer<float>>(*(other.audio));
105 if (other.wave_image)
106 wave_image = std::make_shared<QImage>(*(other.wave_image));
107}
108
109// Destructor
110Frame::~Frame() {

Callers

nothing calls this directly

Calls 1

FractionClass · 0.85

Tested by

no test coverage detected