- 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

28
src/imagestructs.h Normal file
View File

@@ -0,0 +1,28 @@
#ifndef IMAGESTRUCTS_H
#define IMAGESTRUCTS_H
#include <string>
// possible aspect ratios of an image
enum EImageAspect { EImageAspect_Landscape = 0, EImageAspect_Portrait, EImageAspect_Any };
// options to consider when displaying an image
struct ImageDisplayOptions_t
{
EImageAspect onlyAspect = EImageAspect_Any;
bool fitAspectAxisToWindow = false;
};
// details of a particular image
struct ImageDetails_t
{
int width = 0;
int height = 0;
int rotation = 0;
EImageAspect aspect = EImageAspect_Any;
std::string filename;
ImageDisplayOptions_t options;
};
#endif // IMAGESTRUCTS_H