66 QList<QColor> colors = { Qt::red, Qt::green, Qt::blue, Qt::yellow };
67 const int width = image.width();
68 const int height = image.height();
70 for (
int j = 0; j < height; ++j) {
71 for (
int i = 0; i < width; ++i) {
72 const int colorX = i < width / 2 ? 0 : 1;
73 const int colorY = j < height / 2 ? 0 : 1;
74 const int colorIndex = colorX + 2 * colorY;
75 image.setPixel(i, j, colors[colorIndex].rgb());
82 using namespace std::chrono;
84 QImage image(m_size, QImage::Format_ARGB32);
86 case ImagePattern::SingleColor:
87 image.fill(m_colors[m_frameIndex % m_colors.size()]);
89 case ImagePattern::ColoredSquares:
90 fillColoredSquares(image);
94 QVideoFrame rgbFrame(image);
95 QVideoFrameFormat outputFormat { m_size, m_pixelFormat };
97 QPlatformMediaIntegration::instance()->convertVideoFrame(rgbFrame, outputFormat);
100 frame.setStreamFrameRate(*m_frameRate);
103 frame.setStartTime(m_period->count() * m_frameIndex);
104 if (m_endTimeIsReported)
105 frame.setEndTime(m_period->count() * (m_frameIndex + 1));
108 if (m_presentationRotation)
109 frame.setRotation(*m_presentationRotation);
111 if (m_presentationMirrored)
112 frame.setMirrored(*m_presentationMirrored);