void Video::extrapolateMasks(std::string folder) { // load first frame and info QImage mask((folder+"/frame_0.png").c_str()); if(mask.width() != 0) return; for(int i = 0; i < _totalFrames; ++i) { goToFrame(i); Filter f; f.setAvg(); RX::ImageProcessor::applyFilter(&_frame, f); RX::ImageProcessor::applyFilter(&_frame, f); RX::ImageProcessor::applyFilter(&_frame, f); RX::ImageProcessor::applyFilter(&_frame, f); RX::ImageProcessor::applyFilter(&_frame, f); RX::ImageProcessor::toAlpha(&_frame); char buffer[30]; sprintf(buffer, "/frame_%d.png", i); _frame.save((folder+buffer).c_str()); } _folder = folder; }
void PhMediaPanel::onSliderChanged(int position) { PhFrame frame = (PhFrame)position; if(_clock) _clock->setFrame(frame); emit goToFrame(frame, timeCodeType()); }
void Video::start(std::string filename, std::string folder) { _folder = folder; // load first frame and info QImage frame((folder+"/frame_0.png").c_str()); // if first frame doesnt exist, create all if(frame.width() == 0) { int f = -1; _decoder.openFile(filename.c_str()); while(_decoder.seekNextFrame()) { char buffer[30]; sprintf(buffer, "/frame_%d.png", ++f); _decoder.getFrame(frame); frame.save((folder+buffer).c_str()); ++_totalFrames; } } else _totalFrames = QDir(QString(_folder.c_str())).count()-2; _width = frame.width(); _height = frame.height(); _started = true; goToFrame(0); }
void QCvVideo::seekFrame(int increment) { int pos = static_cast<int>(m_capture->get(CV_CAP_PROP_POS_FRAMES)); pos += increment; if (increment < 0) { pos--; } goToFrame(pos); }
void ProtoTree::itemDoubleClick(QTreeWidgetItem *item, int column) { Q_UNUSED(column); field_info *fi; fi = item->data(0, Qt::UserRole).value<field_info *>(); if(fi->hfinfo->type == FT_FRAMENUM) { emit goToFrame(fi->value.value.uinteger); } if(FI_GET_FLAG(fi, FI_URL) && IS_FT_STRING(fi->hfinfo->type)) { gchar *url; url = fvalue_to_string_repr(&fi->value, FTREPR_DISPLAY, NULL); if(url){ // browser_open_url(url); QDesktopServices::openUrl(QUrl(url)); g_free(url); } } }