-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathEXROperation_WriteLayers.h
77 lines (61 loc) · 1.97 KB
/
EXROperation_WriteLayers.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
#ifndef EXROperation_WriteLayers_h
#define EXROperation_WriteLayers_h
#include <memory>
#include <string>
using namespace std;
#include "EXROperation.h"
#include "DeepImage.h"
#include "SimpleImage.h"
class EXROperation_WriteLayers: public EXROperation
{
public:
EXROperation_WriteLayers(const SharedConfig &sharedConfig, string opt, vector<pair<string,string>> arguments);
void AddChannels(shared_ptr<DeepImage> image, Imf::DeepFrameBuffer &frameBuffer) const;
void Run(shared_ptr<EXROperationState> state) const;
private:
const SharedConfig &sharedConfig;
string outputPattern = "<inputname> <ordername> <layer>.exr";
// This represents a single output file.
struct OutputImage
{
string filename;
string layerName;
string layerType;
int order = 0;
vector<SimpleImage::EXRLayersToWrite> layers;
OutputImage()
{
}
};
struct MaskDesc
{
void ParseOptionsString(string optionsString);
enum MaskType
{
// The mask value will be output on the RGB channels.
MaskType_Greyscale,
// The mask value will be output on the alpha channel.
MaskType_Alpha,
// The mask will be composited with the color channel and output as a pre-masked
// RGBA image.
MaskType_CompositedRGB,
// The mask will be output as a luminance channel in the output EXR file.
MaskType_EXRLayer,
};
MaskType maskType = MaskType_Greyscale;
string maskChannel;
string maskName;
};
struct LayerDesc
{
string layerName;
int objectId;
vector<MaskDesc> masks;
};
vector<LayerDesc> layerDescs;
// A list of (dst, src) pairs to combine layers before writing them.
vector<pair<int,int>> combines;
string MakeOutputFilename(const OutputImage &layer) const;
string GetFrameNumberFromFilename(string s) const;
};
#endif