12345678910111213141516171819202122232425262728293031323334353637383940414243 |
- #include "imagemanager.h"
- #include <QDebug>
- #include <QFile>
- ImageManager::ImageManager(QObject *parent) : QObject(parent),
- screens(new QList<QImage>),
- vManager(new VideoManger),
- imagesCount(0),
- imagesFolder("C://Documents/")
- {
- connect(vManager.get(), SIGNAL(videoSaved()), this, SLOT(onVideoSaved()));
- }
- void ImageManager::append(QVariant image)
- {
- // Q_UNUSED(image)
- QImage tmpImg = qvariant_cast<QImage>(image);
- screens.get()->push_back(tmpImg);
- }
- void ImageManager::saveAll() const
- {
- int counter = 0;
- for(int i = 0; i < screens.get()->count(); ++i){
- screens.get()->at(i).save(imagesFolder + QString("%1.png").arg(counter++));
- }
- }
- void ImageManager::createVideo() const
- {
- // vManager.get()->makeVideo(screens.get(), imagesFolder);
- }
- void ImageManager::onVideoSaved()
- {
- // for(int i = 0; i < screens.get()->count(); ++i){
- // QFile file(imagesFolder + QString::number(i) + ".png");
- // }
- screens.get()->clear();
- }
|