HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
IMG_SaveRastersToFilesParms.h
Go to the documentation of this file.
1 /*
2  * PROPRIETARY INFORMATION. This software is proprietary to
3  * Side Effects Software Inc., and is not to be reproduced,
4  * transmitted, or disclosed in any way without written permission.
5  *
6  * NAME: IMG_File.h ( IMG Library, C++)
7  *
8  * COMMENTS:
9  * Generic interface for loading and saving image files.
10  */
11 
12 #ifndef __IMG_SaveRastersToFilesParms__
13 #define __IMG_SaveRastersToFilesParms__
14 
15 #include "IMG_API.h"
16 
17 #include <UT/UT_StringHolder.h>
18 #include <UT/UT_StringMap.h>
19 class UT_StringArray;
20 class IMG_FileParms;
21 class IMG_Format;
22 
23 /// Parameters for the @c saveRaster[s]AsFile[s]() methods of IMG_File
25 {
26 public:
28  UT_StringArray *created_files=nullptr,
29  const IMG_FileParms *fparms=nullptr,
30  const UT_StringHolder &linear_planes=UT_StringHolder(),
31  const UT_StringHolder &separator="_",
33  : myFileParms(nullptr)
34  , myFormat(nullptr)
35  , myCreatedFiles(nullptr)
36  {
37  init(format, created_files, fparms, linear_planes, separator, planeToVarMap);
38  }
40  const IMG_Format *format)
41  {
42  init(UT_StringHolder(), nullptr, fparms,
45  myFormat = format;
46  }
48  const IMG_Format *override_format,
49  const IMG_FileParms *override_parms)
50  {
51  if (!override_parms)
52  override_parms = myFileParms;
53  init(src.myFormatName, src.myCreatedFiles, override_parms,
54  src.myLinearPlanes, src.mySeparator,
55  src.myPlaneToVar);
56  if (override_format)
57  myFormat = override_format;
58  }
59  void init(const UT_StringHolder &format_name,
60  UT_StringArray *created_files,
61  const IMG_FileParms *fparms,
62  const UT_StringHolder &linear_planes,
63  const UT_StringHolder &separator,
64  const UT_StringMap<UT_StringHolder> &planeToVarMap);
65  const IMG_Format *format() const { return myFormat; }
66  const UT_StringHolder &formatName() const { return myFormatName; }
67  const IMG_FileParms *fileParms() const { return myFileParms; }
68  UT_StringArray *createdFiles() const { return myCreatedFiles; }
69  const UT_StringHolder &linearPlanes() const { return myLinearPlanes; }
70  const UT_StringHolder &separator() const { return mySeparator; }
71  const UT_StringMap<UT_StringHolder> &planeToVar() const { return myPlaneToVar; }
72 
73  void setFormat(const IMG_Format *format) { myFormat = format; }
74  void setFileParms(const IMG_FileParms *p) { myFileParms = p; }
75 private:
76  const IMG_FileParms *myFileParms;
77  const IMG_Format *myFormat;
78  UT_StringArray *myCreatedFiles;
79  UT_StringHolder myFormatName;
80  UT_StringHolder myLinearPlanes;
81  UT_StringHolder mySeparator;
82  UT_StringMap<UT_StringHolder> myPlaneToVar;
83 };
84 
85 #endif
IMG_SaveRastersToFilesParms(const UT_StringHolder &format=UT_StringHolder(), UT_StringArray *created_files=nullptr, const IMG_FileParms *fparms=nullptr, const UT_StringHolder &linear_planes=UT_StringHolder(), const UT_StringHolder &separator="_", const UT_StringMap< UT_StringHolder > &planeToVarMap=UT_StringMap< UT_StringHolder >())
IMG_SaveRastersToFilesParms(const IMG_FileParms *fparms, const IMG_Format *format)
void setFormat(const IMG_Format *format)
void setFileParms(const IMG_FileParms *p)
UT_StringArray * createdFiles() const
const UT_StringMap< UT_StringHolder > & planeToVar() const
const UT_StringHolder & separator() const
const IMG_Format * format() const
#define IMG_API
Definition: IMG_API.h:10
const UT_StringHolder & formatName() const
GLint GLint GLsizei GLint GLenum format
Definition: glcorearb.h:108
const UT_StringHolder & linearPlanes() const
const IMG_FileParms * fileParms() const
File options for manipulating image data on load or save. This class allows you to modify the incomin...
Definition: IMG_FileParms.h:38
Parameters for the saveRaster[s]AsFile[s]() methods of IMG_File.
IMG_SaveRastersToFilesParms(const IMG_SaveRastersToFilesParms &src, const IMG_Format *override_format, const IMG_FileParms *override_parms)
GLenum src
Definition: glcorearb.h:1793