| 42 | bool StringToInt(int * ival, const char * str); |
| 43 | |
| 44 | int 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) |
nothing calls this directly
no test coverage detected