Example #1
0
void RealPaintWidget::setFrame( qreal f , bool played)
{
	for(int i=0; i<layers.size(); i++)
		layers[i]->setCurrentFrameForLayer((int)(f),played);

	if(currentFrame != int(f) && !played)
	{
		currentFrame = int(f);
		emit frameChanged( qreal(currentFrame) );
		selection.reset();
	}

	update();

	if(played)
	{
		this->setEnabled(false);
		emit isPlayed();
		return;
	}

	if( !layers[currentLayer]->isContainsFrame( currentFrame ))
	{
		this->setEnabled(false);
		emit isFrame(false);
	}
	else
	{
		this->setEnabled(true);
		emit isFrame(true);
	}
}
Example #2
0
void begin(Status status) {
	
	if(!g_enabled || status == None) {
		return;
	}
	
	if(status != g_currentStatus) {
		end();
		g_currentStatus = status;
	}
	
	if(g_startTime < SkipFrames && isFrame(status)) {
			// Skip the first frames - they may not be reperasentative
		g_startTime++;
	} else if(g_startTime <= SkipFrames) {
		g_startTime = platform::getTimeUs();
	} else {
		endFrame();
	}
	
	if(g_timeLimit != std::numeric_limits<u64>::max() && isNormalFrame(g_currentStatus)
	   && g_results[0].m_totalTime + g_current.m_totalTime >= g_timeLimit) {
		mainApp->quit();
	}
	
}
Example #3
0
//! End the current benchmark
static void end() {
	
	if(!g_enabled || g_currentStatus == None) {
		return;
	}
	
	if(g_currentStatus != None && g_startTime > SkipFrames) {
		
		if(isFrame(g_currentStatus)) {
			// Skip the last frame - it may not be reperasentative
		} else {
			endFrame();
		}
		
		display(g_currentStatus, g_current);
		
		arx_assert(size_t(g_currentStatus) < ARRAY_SIZE(g_results));
		g_results[g_currentStatus] += g_current;
		if(isNormalFrame(g_currentStatus)) {
			g_results[0] += g_current;
		}
		
	}
	
	g_currentStatus = None;
	g_startTime = 0;
	g_current = Result();
	
}
Example #4
0
SEXP c_check_dataframe(SEXP x, SEXP any_missing, SEXP all_missing, SEXP min_rows, SEXP min_cols, SEXP rows, SEXP cols, SEXP row_names, SEXP col_names) {
    if (!isFrame(x))
        return make_type_error(x, "data.frame");
    assert(check_matrix_dims(x, min_rows, min_cols, rows, cols));

    if (!isNull(row_names)) {
        SEXP nn = getAttrib(x, install("row.names"));
        msg_t msg;

        if (isInteger(nn)) {
            nn = PROTECT(coerceVector(nn, STRSXP));
            msg = check_names(nn, row_names, "Rows");
            UNPROTECT(1);
        } else {
            msg = check_names(nn, row_names, "Rows");
        }
        if (!msg.ok)
            return make_result(msg.msg);
    }

    if (!isNull(col_names))
        assert(check_names(getAttrib(x, R_NamesSymbol), col_names, "Columns"));
    if (!asFlag(any_missing, "any.missing") && any_missing_frame(x))
        return make_result("Contains missing values");
    if (!asFlag(all_missing, "all.missing") && all_missing_frame(x))
        return make_result("Contains only missing values");
    return ScalarLogical(TRUE);
}
Example #5
0
void CachedNode::clearFocus(CachedFrame* parent)
{
    if (isFrame()) {
        CachedFrame* child = const_cast<CachedFrame*>(parent->hasFrame(this));
        child->clearFocus();
    }
    mIsFocus = false;
}
Example #6
0
void CachedNode::hideCursor(CachedFrame* parent)
{
    if (isFrame()) {
        CachedFrame* child = const_cast<CachedFrame*>(parent->hasFrame(this));
        child->hideCursor();
    }
    mIsHidden = true;
}
Example #7
0
void KfmView::slotUpdateView( bool _reload )
{
    if ( isFrame() )
    {
	KfmView *v;
	for ( v = childViewList.first(); v != 0L; v = childViewList.next() )
	    v->slotUpdateView( _reload );
    }
    else {
        if (!manager->getURL().isEmpty())
            manager->openURL( manager->getURL().data(), _reload );
    }
}
		bool isWestFrame( int id )
		{
			static int WestFrames[] = {
				0x0007,0x000C,0x001A,0x001C,0x0021,0x0039,0x0058,0x0059,
				0x005C,0x005E,0x0080,0x0081,0x0082,0x0084,0x0090,0x0092,
				0x0095,0x0097,0x0098,0x00A6,0x00A8,0x00AD,0x00AE,0x00AF,
				0x00B5,0x00C7,0x00C8,0x00EA,0x00F8,0x00F9,0x00FC,0x00FE,
				0x00FF,0x0102,0x0104,0x0105,0x0108,0x0127,0x0128,0x012C,
				0x012E,0x0130,0x0132,0x0133,0x0135,0x0136,0x0138,0x013A,
				0x014C,0x014D,0x014F,0x0150,0x0152,0x0154,0x0156,0x0158,
				0x0159,0x015C,0x015E,0x0160,0x0163,0x01CF,0x01D0,0x01D3,
				0x01FF,0x0200,0x0203,0x0207,0x0209 };
			return isFrame( id, WestFrames, sizeof( WestFrames ) );
		}
Example #9
0
int main()
{
    int i,j,n;
    scanf("%d",&n);
    for(i=0;i<n;i++)
    {
        for(j=0;j<n;j++){
            if(isFrame(i,j,n))
            printf(" ");
            else
            printf("*");
        }
        printf("\n");
    }
    return 0;
}
		bool isNorthFrame( int id )
		{
			static int NorthFrames[] = {
				0x0006,0x0008,0x000D,0x001A,0x001B,0x0020,
				0x003A,0x0057,0x0059,0x005B,0x005D,0x0080,
				0x0081,0x0082,0x0084,0x0090,0x0091,0x0094,
                0x0096,0x0099,0x00A6,0x00A7,0x00AC,0x00AE,
				0x00B0,0x00C7,0x00C9,0x00F8,0x00FA,0x00FD,
                0x00FE,0x0100,0x0103,0x0104,0x0106,0x0109,
				0x0127,0x0129,0x012B,0x012D,0x012F,0x0131,
				0x0132,0x0134,0x0135,0x0137,0x0139,0x013B,
				0x014C,0x014E,0x014F,0x0151,0x0153,0x0155,
                0x0157,0x0158,0x015A,0x015D,0x015E,0x015F,
				0x0162,0x01CF,0x01D1,0x01D4,0x01FF,0x0201,
				0x0204,0x0208,0x020A };
			return isFrame( id, NorthFrames, sizeof( NorthFrames ) );
		}
Example #11
0
void Client::takeButtonRelease( Window w, unsigned int button, bool mod1,
				int x, int y )
{
    if ( w == close_button ) {
 	if ( awaiting_close &&
	    ( x > 0 && y > 0 && x < button_size && y < button_size )) {
	    ws->tryDelete( window );
	}
	ws->painter()->setButtonBackground( close_button, 
					    Painter::CLOSE_BUTTON,
					    active, 
					    false,
					    button_size,
					    button_size );
	awaiting_close = false;
    }
    if ( w == iconize_button ) {
 	if ( awaiting_iconize &&
	    ( x > 0 && y > 0 && x < button_size && y < button_size )) {
	    iconize();
	}
	ws->painter()->setButtonBackground( iconize_button, 
					    Painter::ICONIZE_BUTTON,
					    active, 
					    false,
					    button_size,
					    button_size );
	awaiting_iconize = false;
    }
    if ( isFrame( w ) ) {
	switch (button) {
	case 1:
	    break;
	case 2:
	    break;
	case 3:
	    break;
	}
    } else {
	awaiting_close = false;
	awaiting_iconize = false;
    }
}
Example #12
0
double time2msec(string timeString){
	if (isFrame(timeString))
		return atoi(timeString.c_str());
	
	string hrsSting = "0",minSting = "0",secSting = "0";
	
	if(timeString.find_first_of(':')==timeString.find_last_of(':')){
		minSting = timeString.substr(0,timeString.find_first_of(':'));
		secSting = timeString.substr(timeString.find_last_of(':')+1);
	}
	else {
		hrsSting = timeString.substr(0,timeString.find_first_of(':'));
		minSting = timeString.substr(timeString.find_first_of(':')+1,
									 timeString.find_last_of(':')-timeString.find_first_of(':')-1);
		secSting = timeString.substr(timeString.find_last_of(':')+1);
	}
	
	return atoi(hrsSting.c_str())*3600000+atoi(minSting.c_str())*60000+atof(secSting.c_str())*1000;
}
Example #13
0
void setSistemConfig(config_SystemParameter *param, string fileParam){
	
	//system param - Directory
	param->angleVector.clear();
	param->scaleVector.clear();
	
	//READING THE PATCH'S POSITION
	int length;
	char * buffer;
	
	ifstream is;
	is.open (fileParam.c_str(), ios::binary );
	
	// get length of file:
	is.seekg (0, ios::end);
	length = is.tellg();
	is.seekg (0, ios::beg);
	// allocate memory:
	buffer = new char [length];
	// read data as a block:
	is.read (buffer,length);
	
	string content(buffer,length);
	stringstream ss(content);
	string centerS,centerS_x,centerS_y,sizeS,sizeS_w,sizeS_h,angleS, 
	       norm,rgb,videoPath,
	       modelMemory,alpha,
	       areaSearch,angleVector,scaleVector,
		   time;
	
	getline(ss, time);
	getline(ss, centerS);
	getline(ss, sizeS);
	getline(ss, angleS);
	getline(ss, norm);
	getline(ss, videoPath);
	getline(ss, rgb);
	getline(ss, modelMemory);
	getline(ss, alpha);
	getline(ss, areaSearch);
	getline(ss, scaleVector);
	getline(ss, angleVector);
	
	//Time range
	param->startTimeOnFrames = isFrame(time.substr(0,time.find(',')));
	param->endTimeOnFrames = isFrame(time.substr(time.find(',')+1));
	
	param->startTime = time2msec(time.substr(0,time.find(',')));
	param->endTime = time2msec(time.substr(time.find(',')+1));
	
	//initialRect
	centerS_x = centerS.substr(0,centerS.find(','));
	centerS_y = centerS.substr(centerS.find(',')+1);
	sizeS_w = sizeS.substr(0,sizeS.find(','));
	sizeS_h = sizeS.substr(sizeS.find(',')+1);
	
	
	Point2f center(atof(centerS_x.c_str()),atof(centerS_y.c_str()));
	cv::Size size(atof(sizeS_w.c_str()),atof(sizeS_h.c_str()));
	
	param->initialRect = RotatedRect(center,size,atof(angleS.c_str()));
	
	//NormType
	if (!norm.compare("FACE")) param->normType = FACE;//*normType = FACE;
	else if(!norm.compare("PEDESTRIAN")) param->normType = PEDESTRIAN;//*normType = PEDESTRIAN;
	else {
		cout << "NOT SUCH NORM: "<<norm<<endl;
		CV_Assert(false);
	}
	
	//RGB
	if (!rgb.compare("1")){ 
		param->isRGB = true;
		param->numFeature = 12;
	}
	else if(!rgb.compare("0")){
		param->isRGB = false;
		param->numFeature = 10;
	}
	else {
		cout << "INVALID RGB VALUE: "<<rgb<<endl;
		CV_Assert(false);
	}
	
	//video path
	param->videoPath = videoPath;
	
	//modelMemory
	param->modelMemory = atof(modelMemory.c_str());
	//alpha
	param->alpha = atof(alpha.c_str());
	//areaSearch
	param->areaSearch = atof(areaSearch.c_str());
	
	//scaleVector
	int index = 0;
	string aux;
	while (index<scaleVector.length()) {
		aux = scaleVector.substr(index,scaleVector.length());
		aux = aux.substr(0,aux.find_first_of(','));
		index += aux.length()+1;
		param->scaleVector.push_back(atof(aux.c_str()));
	}
	//anglesVector
	index = 0;
	while (index<angleVector.length()) {
		aux = angleVector.substr(index,angleVector.length());
		aux = aux.substr(0,aux.find_first_of(','));
		index += aux.length()+1;
		param->angleVector.push_back(atof(aux.c_str()));
	}
	is.close();
	delete[] buffer;
}