File indexing completed on 2025-01-19 04:22:52

0001 /*
0002     SPDX-FileCopyrightText: 2010 Dirk Vanden Boer <dirk.vdb@gmail.com>
0003 
0004     SPDX-License-Identifier: GPL-2.0-or-later
0005 */
0006 
0007 #include "imagewriter.h"
0008 #include <iostream>
0009 
0010 using namespace std;
0011 
0012 namespace ffmpegthumbnailer
0013 {
0014 
0015 ImageWriter::ImageWriter()
0016 {
0017 }
0018 
0019 void ImageWriter::writeFrame(VideoFrame& frame,  QImage& image)
0020 {
0021     QImage previewImage(frame.width, frame.height, QImage::Format_RGB888);
0022     for (quint32 y = 0; y < frame.height; y++) {
0023         // Copy each line ..
0024         memcpy(previewImage.scanLine(y), &frame.frameData[y*frame.lineSize], frame.width*3);
0025     }
0026 
0027     image = previewImage;
0028 }
0029 }