MCPcopy Create free account
hub / github.com/AcademySoftwareFoundation/OpenColorIO / main

Function main

src/apps/ocioconvert/main.cpp:44–683  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

42bool StringToInt(int * ival, const char * str);
43
44int main(int argc, const char **argv)
45{
46 ArgParse ap;
47
48 std::vector<std::string> floatAttrs;
49 std::vector<std::string> intAttrs;
50 std::vector<std::string> stringAttrs;
51
52 std::string outputDepth;
53 std::string inputconfig;
54
55 bool usegpu = false;
56 bool usegpuLegacy = false;
57 bool outputgpuInfo = false;
58 bool verbose = false;
59 bool help = false;
60 bool useLut = false;
61 bool useDisplayView = false;
62 bool useInvertView = false;
63 bool useNamedTransform = false;
64 bool useInvNamedTransform = false;
65
66 ap.options("ocioconvert -- apply colorspace transform to an image \n\n"
67 "usage: ocioconvert [options] inputimage inputcolorspace outputimage outputcolorspace\n"
68 " or: ocioconvert [options] --lut lutfile inputimage outputimage\n"
69 " or: ocioconvert [options] --view inputimage inputcolorspace outputimage displayname viewname\n"
70 " or: ocioconvert [options] --invertview inputimage displayname viewname outputimage outputcolorspace\n"
71 " or: ocioconvert [options] --namedtransform transformname inputimage outputimage\n"
72 " or: ocioconvert [options] --invnamedtransform transformname inputimage outputimage\n\n",
73 "%*", parse_end_args, "",
74 "<SEPARATOR>", "Options:",
75 "--lut", &useLut, "Convert using a LUT rather than a config file",
76 "--view", &useDisplayView, "Convert to a (display,view) pair rather than to "
77 "an output color space",
78 "--invertview", &useInvertView, "Convert from a (display,view) pair rather than "
79 "from a color space",
80 "--namedtransform", &useNamedTransform, "Convert using a named transform in the forward direction",
81 "--invnamedtransform", &useInvNamedTransform, "Convert using a named transform in the inverse direction",
82 "--gpu", &usegpu, "Use GPU color processing instead of CPU (CPU is the default)",
83 "--gpulegacy", &usegpuLegacy, "Use the legacy (i.e. baked) GPU color processing "
84 "instead of the CPU one (--gpu is ignored)",
85 "--gpuinfo", &outputgpuInfo, "Output the OCIO shader program",
86 "--h", &help, "Display the help and exit",
87 "--help", &help, "Display the help and exit",
88 "-v" , &verbose, "Display general information",
89 "--iconfig %s", &inputconfig, "Input .ocio configuration file (default: $OCIO)",
90 "<SEPARATOR>", "\nOpenImageIO or OpenEXR options:",
91 "--bitdepth %s", &outputDepth, "Output image bitdepth",
92 "--float-attribute %L", &floatAttrs, "\"name=float\" pair defining OIIO float attribute "
93 "for outputimage",
94 "--int-attribute %L", &intAttrs, "\"name=int\" pair defining an int attribute "
95 "for outputimage",
96 "--string-attribute %L", &stringAttrs, "\"name=string\" pair defining a string attribute "
97 "for outputimage",
98 NULL
99 );
100
101 if (ap.parse (argc, argv) < 0)

Callers

nothing calls this directly

Calls 15

GetEnvVariableFunction · 0.85
GetCurrentConfigFunction · 0.85
GetVersionFunction · 0.85
ParseNameValuePairFunction · 0.85
optionsMethod · 0.80
usageMethod · 0.80
printGLInfoMethod · 0.80
setPrintShaderMethod · 0.80
initImageMethod · 0.80
createGLBuffersMethod · 0.80

Tested by

no test coverage detected