Пример #1
0
void writer(string args)
{
	if (streql(splitArg(args, 1),"-H"))
	{
		writerHelp();
	}
	else if (streql(splitArg(args, 1),"STABLE"))
	{
		oldWriter();
	}
	else
	{
		//writing = true;
		writerContents = initWriter();
		//writing = false;
		clearScreen();
	}
}
Пример #2
0
int main(){

	bool fin = false;

	int STEP_WAIT = 100;

	Mat HUD = Mat::zeros(Y_RESOLUTION, X_RESOLUTION,  CV_8UC3);

	int step = 0;
	if(initWriter())
		return -1;

	while(!fin){
		step ++;

		int c = waitKey(10);
		if( (char)c == 27 ) { fin = true; } //Esc key
		if( (char)c == '+') { STEP_WAIT = STEP_WAIT + 2; }
		if( (char)c == '-') { STEP_WAIT = STEP_WAIT - 2; }
		if( (char)c == '0') { checkBlink(0); }
		if( (char)c == '1') { checkBlink(1); }
		if( (char)c == '2') { checkBlink(2); }
		if( (char)c == '3') { checkBlink(3); }
		if( (char)c == '4') { checkBlink(4); }

		drawHUD(&HUD);

		std::cout<<"Tasto: "<<c<<std::endl;

		if(step >= STEP_WAIT){
			step = 0;
			stepWriter();
		}

		imshow("Writer",HUD);
	}
	return 0;
}