本文整理汇总了C++中Communicator::receiveWithSelectionByHand方法的典型用法代码示例。如果您正苦于以下问题:C++ Communicator::receiveWithSelectionByHand方法的具体用法?C++ Communicator::receiveWithSelectionByHand怎么用?C++ Communicator::receiveWithSelectionByHand使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Communicator
的用法示例。
在下文中一共展示了Communicator::receiveWithSelectionByHand方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: testSendReceive
//.........这里部分代码省略.........
// get the file name
if (i < argc - 1)
{
type = (argv[++i][0]-'0');
}
else
{
return returnError();
}
}
else if (!strcmp(argv[i], "-t"))
{
// get the file name
if (i < argc - 1)
{
text = argv[++i];
}
else
{
return returnError();
}
}
else if (!strcmp(argv[i], "-roi"))
{
// get the file name
if (i < argc - 1)
{
ROI = stod(string(argv[++i]));
}
else
{
return returnError();
}
}
else if (!strcmp(argv[i], "-v"))
{
realVideo = true;
}
}
if (mode != 0 && mode != 1)
{
return returnError();
}
if (inputFileName == "")
{
return returnError();
}
if (mode == 0 && text == "")
{
return returnError();
}
switch (type)
{
case 1:
communicator = new SplitAmplitudeCommunicator;
break;
case 2:
communicator = new SplitFrequencyCommunicator;
break;
case 3:
communicator = new SplitFrequencyAmplitudeCommunicator;
break;
case 4:
communicator = new SpatialFrequencyCommunicator;
break;
default:
communicator = new Communicator;
}
if (!strcmp(argv[1], "-s"))
{
if (realVideo)
{
communicator->sendVideo(inputFileName, text, outputFileName, 1000);
}
else
{
communicator->sendImage(Utilities::lcm(2 * FREQ[ONE], 2 * FREQ[ZERO]),
inputFileName, text, outputFileName, 1000);
}
}
else if (!strcmp(argv[1], "-r"))
{
if (ROI > 0 && ROI <= 1)
{
// then we have ROI
communicator->receive(inputFileName, 30, ROI);
}
else
{
communicator->receiveWithSelectionByHand(inputFileName, 30);
}
}
else if (!strcmp(argv[1], "-c"))
{
// convert argv2 video to argv3 as a video with the framerate in argv4
// argv3 must end with .avi
Utilities::convertVideo(argv[2], argv[3], stod(string(argv[4])));
}
return 0;
}