1 #pragma once
2 
3 #ifndef CAPTUREPARAMETERS_H
4 #define CAPTUREPARAMETERS_H
5 
6 #include "tfilepath.h"
7 #include "tgeometry.h"
8 
9 #undef DVAPI
10 #undef DVVAR
11 #ifdef TOONZLIB_EXPORTS
12 #define DVAPI DV_EXPORT_API
13 #define DVVAR DV_EXPORT_VAR
14 #else
15 #define DVAPI DV_IMPORT_API
16 #define DVVAR DV_IMPORT_VAR
17 #endif
18 
19 //=============================================================================
20 // forward declarations
21 class TIStream;
22 class TOStream;
23 class TPropertyGroup;
24 
25 class DVAPI CaptureParameters {
26   std::wstring m_deviceName;
27   TDimension m_resolution;
28   int m_brightness;
29   int m_contranst;
30   bool m_useWhiteImage;
31   bool m_upsideDown;
32   int m_increment;
33   int m_step;
34 
35   TFilePath m_filePath;
36   std::string m_format;
37   std::map<std::string, TPropertyGroup *> m_formatProperties;
38 
39 public:
40   CaptureParameters();
~CaptureParameters()41   ~CaptureParameters() {}
42 
getDeviceName()43   std::wstring getDeviceName() const { return m_deviceName; }
setDeviceName(std::wstring name)44   void setDeviceName(std::wstring name) { m_deviceName = name; }
45 
getResolution()46   TDimension getResolution() const { return m_resolution; }
setResolution(TDimension res)47   void setResolution(TDimension res) { m_resolution = res; }
48 
getBrightness()49   int getBrightness() const { return m_brightness; }
setBrightness(int value)50   void setBrightness(int value) { m_brightness = value; }
51 
getContranst()52   int getContranst() const { return m_contranst; }
setContranst(int value)53   void setContranst(int value) { m_contranst = value; }
54 
isUseWhiteImage()55   bool isUseWhiteImage() const { return m_useWhiteImage; }
useWhiteImage(bool value)56   void useWhiteImage(bool value) { m_useWhiteImage = value; }
57 
isUpsideDown()58   bool isUpsideDown() const { return m_upsideDown; }
upsideDown(bool value)59   void upsideDown(bool value) { m_upsideDown = value; }
60 
getFilePath()61   TFilePath getFilePath() const { return m_filePath; }
setFilePath(TFilePath value)62   void setFilePath(TFilePath value) { m_filePath = value; }
63 
getIncrement()64   int getIncrement() const { return m_increment; }
setIncrement(int value)65   void setIncrement(int value) { m_increment = value; }
66 
getStep()67   int getStep() const { return m_step; }
setStep(int value)68   void setStep(int value) { m_step = value; }
69 
getFileFormat()70   std::string getFileFormat() const { return m_format; }
setFileFormat(std::string value)71   void setFileFormat(std::string value) { m_format = value; }
72 
73   TPropertyGroup *getFileFormatProperties(std::string ext);
74 
75   void assign(const CaptureParameters *params);
76   void saveData(TOStream &os);
77   void loadData(TIStream &is);
78 
79 protected:
80   void getFileFormatPropertiesExtensions(std::vector<std::string> &v) const;
81 };
82 #endif  // CAPTUREPARAMETERS_H
83