MCPcopy Create free account
hub / github.com/KhronosGroup/KTX-Software / main

Function main

tests/ktxdiff/ktxdiff_main.cpp:445–461  ·  view source on GitHub ↗

EXIT CODES: 0 - Matching files 1 - Mismatching files 2 - Error while loading, decoding or processing an input file

Source from the content-addressed store, hash-verified

443/// 1 - Mismatching files
444/// 2 - Error while loading, decoding or processing an input file
445int main(int argc, char* argv[]) {
446 InitUTF8CLI(argc, argv);
447
448 if (argc < 3) {
449 fmt::print("Missing input file arguments\n");
450 fmt::print("Usage: ktxdiff <expected-ktx2> <received-ktx2> [tolerance]\n");
451 return EXIT_FAILURE;
452 }
453
454 const float tolerance = argc > 3 ? std::stof(argv[3]) : 0.05f;
455
456 Texture lhs(argv[1]);
457 Texture rhs(argv[2]);
458 const auto match = compare(lhs, rhs, tolerance);
459
460 return match ? 0 : 1;
461}

Callers

nothing calls this directly

Calls 3

InitUTF8CLIFunction · 0.85
compareFunction · 0.70
printFunction · 0.50

Tested by

no test coverage detected