| 168 | } |
| 169 | |
| 170 | int main(int argc, const char **argv) |
| 171 | { |
| 172 | bool help = false; |
| 173 | bool verbose = false; |
| 174 | signed int testType = -1; |
| 175 | std::string transformFile; |
| 176 | std::string inColorSpace, outColorSpace, display, view; |
| 177 | std::string inBitDepthStr("f32"), outBitDepthStr("f32"); |
| 178 | unsigned iterations = 50; |
| 179 | bool nocache = false, nooptim = false; |
| 180 | |
| 181 | bool useColorspaces = false; |
| 182 | bool useDisplayview = false; |
| 183 | bool useInvertview = false; |
| 184 | |
| 185 | std::string inputconfig; |
| 186 | OCIO::ConstConfigRcPtr srcConfig; |
| 187 | |
| 188 | |
| 189 | ArgParse ap; |
| 190 | ap.options("ocioperf -- apply and measure a color transformation processing\n\n" |
| 191 | "usage: ocioperf [options] --transform /path/to/file.clf\n\n", |
| 192 | "--h", &help, |
| 193 | "Display the help and exit", |
| 194 | "--help", &help, |
| 195 | "Display the help and exit", |
| 196 | "--verbose", &verbose, |
| 197 | "Display some general information", |
| 198 | "--test %d", &testType, |
| 199 | "Define the type of processing to measure: "\ |
| 200 | "0 means on the complete image (the default), 1 is line-by-line, "\ |
| 201 | "2 is pixel-per-pixel and -1 performs all the test types", |
| 202 | "--transform %s", &transformFile, |
| 203 | "Provide the transform file to apply on the image", |
| 204 | "--colorspaces %s %s", &inColorSpace, &outColorSpace, |
| 205 | "Provide the input and output color spaces to apply on the image", |
| 206 | "--view %s %s %s", &inColorSpace, &display, &view, |
| 207 | "Provide the input color space and (display, view) pair to apply on the image", |
| 208 | "--displayview %s %s %s", &inColorSpace, &display, &view, |
| 209 | "(Deprecated) Provide the input and (display, view) pair to apply on the image", |
| 210 | "--invertview %s %s %s", &display, &view, &outColorSpace, |
| 211 | "Provide the (display, view) pair and output color space to apply on the image", |
| 212 | "--iconfig %s", &inputconfig, |
| 213 | "Input .ocio configuration file (default: $OCIO)", |
| 214 | "--iter %d", &iterations, "Provide the number of iterations on the processing. Default is 50", |
| 215 | "--bitdepths %s %s", &inBitDepthStr, &outBitDepthStr, |
| 216 | "Provide input and output bit-depths (i.e. ui16, f32). Default is f32", |
| 217 | "--nocache", &nocache, |
| 218 | "Bypass all caches. Default is false", |
| 219 | "--nooptim", &nooptim, |
| 220 | "Disable the processor optimizations. Default is false", |
| 221 | NULL); |
| 222 | |
| 223 | if (ap.parse (argc, argv) < 0) |
| 224 | { |
| 225 | std::cerr << ap.geterror() << std::endl; |
| 226 | ap.usage(); |
| 227 | return 1; |
nothing calls this directly
no test coverage detected