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

Function QImageFromRgbaFrame

examples/VulkanBenchmark.cpp:755–766  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

753};
754
755static QImage QImageFromRgbaFrame(const AVFrame* frame) {
756 if (!frame || frame->format != AV_PIX_FMT_RGBA)
757 throw std::runtime_error("Expected an RGBA software frame");
758
759 QImage image(frame->width, frame->height, QImage::Format_RGBA8888);
760 for (int y = 0; y < frame->height; ++y) {
761 std::memcpy(image.scanLine(y),
762 frame->data[0] + y * frame->linesize[0],
763 static_cast<size_t>(frame->width) * 4);
764 }
765 return image;
766}
767
768static void ForceOpaqueAlpha(AVFrame* frame) {
769 if (!frame || frame->format != AV_PIX_FMT_RGBA)

Callers 1

RunCpuCompositeBenchmarkFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected