- Change display options to be passed down from the window, and have the imageselector pass a struct back that contains image metadata

- Added ImageDisplayOptions_t to control user controllable options for how we show an image (aspect filtering, stretching)
- Added ImageDetails_t to encapsulate image metadata along with its image options
This commit is contained in:
Alfred Reynolds
2021-08-03 14:14:11 +12:00
parent e09c4d4f9f
commit 096a68636c
9 changed files with 225 additions and 161 deletions

View File

@@ -21,16 +21,15 @@ ImageSwitcher::ImageSwitcher(MainWindow& w, unsigned int timeout, std::unique_pt
void ImageSwitcher::updateImage()
{
ImageOptions_t options;
std::string filename(selector->getNextImage(options));
if (filename == "")
ImageDetails_t imageDetails = selector->getNextImage(window.getBaseOptions());
if (imageDetails.filename == "")
{
window.warn("No image found.");
timerNoContent.start(timeoutNoContent);
}
else
{
window.setImage(filename, options);
window.setImage(imageDetails);
timerNoContent.stop(); // we have loaded content so stop the fast polling
}
}