reject 1 image cycle

This commit is contained in:
Jared Bruni
2019-09-04 14:00:49 -07:00
parent d1963845a5
commit 6753cb9be8
2 changed files with 11 additions and 9 deletions

View File

@@ -79,7 +79,7 @@ void ImageWindow::image_RowChanged(int index) {
void ImageWindow::image_SetCycle() { void ImageWindow::image_SetCycle() {
QString text_value; QString text_value;
QTextStream stream(&text_value); QTextStream stream(&text_value);
if(image_files->count() < 0 || !image_cycle_on->isChecked()) { if(image_files->count() < 2 || !image_cycle_on->isChecked()) {
playback->setCycle(0); playback->setCycle(0);
stream << "Cycle Turned Off.\n"; stream << "Cycle Turned Off.\n";
blend_set = false; blend_set = false;
@@ -96,9 +96,7 @@ void ImageWindow::image_SetCycle() {
} else { } else {
QString im_cycle = image_cycle->itemText(type); QString im_cycle = image_cycle->itemText(type);
stream << "Image Frames: " << text_items.size() << " Cycle Type: " << im_cycle << " every " << val << " frames.\n"; stream << "Image Frames: " << text_items.size() << " Cycle Type: " << im_cycle << " every " << val << " frames.\n";
blend_image = cv::imread(text_items[0]);
playback->setCycle(type+1, val, text_items); playback->setCycle(type+1, val, text_items);
blend_set = true;
} }
} }
QMessageBox::information(this, "Image Cycle", text_value); QMessageBox::information(this, "Image Cycle", text_value);

View File

@@ -117,12 +117,16 @@ void Playback::setCycle(int type, int frame_skip, std::vector<std::string> &v) {
cycle_on = type; cycle_on = type;
if(!cycle_values.empty()) if(!cycle_values.empty())
cycle_values.erase(cycle_values.begin(), cycle_values.end()); cycle_values.erase(cycle_values.begin(), cycle_values.end());
if(v.size() > 1) {
for(auto &i : v) { for(auto &i : v) {
cv::Mat value = cv::imread(i); cv::Mat value = cv::imread(i);
cycle_values.push_back(value); cycle_values.push_back(value);
} }
cycle_index = 0; cycle_index = 0;
frame_num = frame_skip; frame_num = frame_skip;
blend_image = cv::imread(v[0]);
blend_set = true;
}
mutex.unlock(); mutex.unlock();
} }
@@ -130,10 +134,10 @@ void Playback::setCycle(int type) {
mutex.lock(); mutex.lock();
cycle_on = type; cycle_on = type;
cycle_index = 0; cycle_index = 0;
blend_set = false;
mutex.unlock(); mutex.unlock();
} }
void Playback::reset_filters() { void Playback::reset_filters() {
mutex.lock(); mutex.lock();
if(ac::reset_alpha == false) { if(ac::reset_alpha == false) {