Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CLI options for playback #266

Merged
merged 2 commits into from
Mar 19, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions include/tev/ImageViewer.h
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,8 @@ class ImageViewer : public nanogui::Screen {

bool setFilter(const std::string& filter);

void setFps(int value);

bool useRegex() const;
void setUseRegex(bool value);

Expand Down
4 changes: 4 additions & 0 deletions src/ImageViewer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1699,6 +1699,10 @@ bool ImageViewer::setFilter(const string& filter) {
return true;
}

void ImageViewer::setFps(int value) {
mFpsTextBox->set_value(value);
}

bool ImageViewer::useRegex() const { return mRegexButton->pushed(); }

void ImageViewer::setUseRegex(bool value) {
Expand Down
22 changes: 22 additions & 0 deletions src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,13 @@ static int mainFunc(const vector<string>& arguments) {
{'f', "filter"},
};

ValueFlag<int> fpsFlag{
parser,
"FPS",
"Frames per second during playback",
{"fps"},
};

Flag gainmapFlagOff{
parser,
"NO GAINMAPS",
Expand Down Expand Up @@ -259,6 +266,13 @@ static int mainFunc(const vector<string>& arguments) {
{'o', "offset"},
};

Flag playFlag{
parser,
"PLAY",
"Play back images as a video.",
{'p', "play"},
};

ValueFlag<string> tonemapFlag{
parser,
"TONEMAP",
Expand Down Expand Up @@ -543,6 +557,10 @@ static int mainFunc(const vector<string>& arguments) {
sImageViewer->setFilter(get(filterFlag));
}

if (fpsFlag) {
sImageViewer->setFps(get(fpsFlag));
}

if (gammaFlag) {
sImageViewer->setGamma(get(gammaFlag));
}
Expand All @@ -555,6 +573,10 @@ static int mainFunc(const vector<string>& arguments) {
sImageViewer->setOffset(get(offsetFlag));
}

if (playFlag) {
sImageViewer->setPlayingBack(true);
}

if (tonemapFlag) {
sImageViewer->setTonemap(toTonemap(get(tonemapFlag)));
}
Expand Down
Loading