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

Method AddImage

src/Frame.cpp:712–731  ·  view source on GitHub ↗

Add (or replace) pixel data to the frame

Source from the content-addressed store, hash-verified

710
711// Add (or replace) pixel data to the frame
712void Frame::AddImage(
713 int new_width, int new_height, int bytes_per_pixel,
714 QImage::Format type, const unsigned char *pixels_)
715{
716 if (has_image_data) {
717 // Delete the previous QImage
718 image.reset();
719 }
720
721 // Create new image object from pixel data
722 auto new_image = std::make_shared<QImage>(
723 pixels_,
724 new_width, new_height,
725 new_width * bytes_per_pixel,
726 type,
727 (QImageCleanupFunction) &openshot::cleanUpBuffer,
728 (void*) pixels_
729 );
730 AddImage(new_image);
731}
732
733// Add (or replace) pixel data to the frame
734void Frame::AddImage(std::shared_ptr<QImage> new_image)

Callers 15

GetFrameMethod · 0.80
apply_backgroundMethod · 0.80
apply_keyframesMethod · 0.80
apply_waveformMethod · 0.80
ReadStreamMethod · 0.80
ProcessVideoPacketMethod · 0.80
CheckWorkingFramesMethod · 0.80
GetFrameMethod · 0.80
GetFrameMethod · 0.80
GetFrameMethod · 0.80
GetFrameMethod · 0.80
GetFrameMethod · 0.80

Calls 1

resetMethod · 0.80

Tested by

no test coverage detected