#include "cmdline.h"//命令行解析 #include #include #include #include "image_data.h" #include "TestAPI_Profile.h" using namespace std; int main(int argc, char *argv[]) { // 映射表 std::unordered_map> handlerMap = { {"sky:Y16", TestAPI_SOT_Sky_Y16}, {"ground:Y8", TestAPI_SOT_Ground_Y8}, {"ground:RGB", TestAPI_SOT_Ground_RGB}, {"ground:Y16", TestAPI_SOT_Ground_Y16}, {"ground:NV12", TestAPI_SOT_Ground_NV12}, }; cmdline::parser a; a.add("scen",'s',"sky or ground",true,""); a.add("dataType",'d',"Y8/Y16/RGB/NV12",true,""); a.parse_check(argc, argv); cout << "scen:" << a.get("scen") << "datatype:" << a.get("dataType") << endl; cout << "------------------ " << endl; std::string scen = a.get("scen"); std::string dataType = a.get("dataType"); std::string key = scen + ":" + dataType; // 查找并执行逻辑 if (handlerMap.find(key) != handlerMap.end()) { handlerMap[key](); } else { std::cout << "Invalid combination of scen and dataType: " << key << std::endl; } return 0; }