示例#1
0
文件: __func__.c 项目: IMCG/cpptruths
int main(void)
{
Hello_World();
return 0;
}
示例#2
0
SFMLTests::SFMLTests() {
    Hello_World();
}
示例#3
0
文件: c.c 项目: CERN/atlas-adepo
int main (int argc, char** argv, char** envp)
{	
	printf("Main: Hello.\n");
	
	printf("Main: Initialize Pascal library.\n");
	Analysis_Init();
	Hello_World();
	
	printf("Main: Analyze rasnik file.\n");

	// Read name of image file.
	char file_name[256];
	printf("Enter file name, 0 for default: ");
	scanf("%s",file_name);
	if (strcmp(file_name,"0")==0) {
		strcpy(file_name,"Rasnik.daq");
	
	}
	
	// Declare pointer to rasnik_type;
	struct rasnik_type* rp;
	
	// Now we call the rasnik analysis. We pass a string to 
	// it directly, giving a file name. We specify the rasnik
	// mask and image sensor parameters with numbers.
	printf("Main: Opening %s.\n",file_name);
	
	rp=Rasnik_Analyze_File(file_name,0,2,0,0,170,12);
	
	// Here we look at the fields of the rasnik_type pointed
	// to by rp, and write them to the screen.
	printf("Main: Display rasnik results.\n");
	if (rp->valid) {
		printf("Valid %i.\n",(int) rp->valid);
		printf("Maskpoint x %f y %f.\n",rp->mask_point.x,rp->mask_point.y);
		printf("Magnification x %f y %f.\n",rp->magx,rp->magy);
		printf("Rotation %f.\n",rp->rot);
		printf("Error %f.\n",rp->error);
		printf("Mask orientation %i.\n",rp->mask_orientation);
		printf("Reference code %i.\n",rp->reference_code);
		printf("Reference point x %f y %f.\n",rp->reference_point.x,rp->reference_point.y);
		printf("Square size %f.\n",rp->square_size);
		printf("Pixel size %f.\n",rp->pixel_size);
	} else {
		printf("ERROR: Rasnik analysis failed.\n");
	}
	
	// Now we call the routine that disposes of the rasnik_type.
	Dispose_Rasnik(rp);
	
	// Re-open the rasnik image file and analyze in stages.
	printf("Main: Re-Opening %s.\n",file_name);
	char* ip;
	ip=Read_Daq_File(file_name);
	
	// Create derivative images.
	char* jip;
	jip=Image_Grad_J(ip);
	char* iip;
	iip=Image_Grad_I(ip);
	
	// Find the approximate pattern, pass a zero for
	// the show_fitting parameter to turn off the drawing
	// routines that we won't use.
	struct rasnik_pattern_type* pp;
	pp=Rasnik_Find_Pattern(iip,jip,0);
	
	// Show pattern contents.
	printf("Main: Display approximate pattern.\n");
	printf("Origin x %f y %f.\n",pp->origin.x,pp->origin.y);
	printf("Square Width x %f y %f.\n",pp->pattern_x_width,pp->pattern_y_width);
	printf("Rotation %f.\n",pp->rotation);

	// Refine the pattern.
	Rasnik_Refine_Pattern(pp,iip,jip,0);
	
	// Show pattern contents.
	printf("Main: Display refined pattern.\n");
	printf("Origin x %f y %f.\n",pp->origin.x,pp->origin.y);
	printf("Square Width x %f y %f.\n",pp->pattern_x_width,pp->pattern_y_width);
	printf("Rotation %f.\n",pp->rotation);
	
	// Analyze the code squares.
	Rasnik_Adjust_Pattern_Parity(ip,pp);
	Rasnik_Identify_Pattern_Squares(ip,pp);
	Rasnik_Identify_Code_Squares(ip,pp);
	Rasnik_Analyze_Code(pp,0);
	struct xy_point_type ref;
	rp=Rasnik_From_Pattern(ip,pp,2,0,0,170,12);

	// Display results of analysis by stages.
	printf("Main: Display rasnik results.\n");
	if (rp->valid) {
		printf("Maskpoint x %f y %f.\n",rp->mask_point.x,rp->mask_point.y);
		printf("Magnification x %f y %f.\n",rp->magx,rp->magy);
		printf("Rotation %f.\n",rp->rot);
	} else {
		printf("ERROR: Rasnik analysis failed.\n");
	}

	// Extract a square and show its contents. If you specify
	// the default image, this square will be a pivot square,
	// and so have all fields filled with interesting information.
	printf("Main: Display rasnik square contents.\n");
	struct rasnik_square_type rs;
	Rasnik_Get_Square(&rs,pp->squares,0,0);
	printf("is_a_valid_square? %i\n",(int) rs.is_a_valid_square);
	printf("is_a_code_square? %i\n",(int) rs.is_a_code_square);
	printf("is_a_pivot_square? %i\n",(int) rs.is_a_pivot_square);
	printf("Center Location x %f y %f.\n",rs.center_pp.x,rs.center_pp.y);
	printf("Center Intensity %f.\n",rs.center_intensity);
	printf("Center Whiteness %f.\n",rs.center_whiteness);
	printf("Pivot Correlation %i.\n",rs.pivot_correlation);
	printf("Code x %i y %i.\n",rs.x_code,rs.y_code);

	// Dispose of pointers.
	Dispose_Image(ip);
	Dispose_Image(jip);
	Dispose_Image(iip);
	Dispose_Rasnik_Pattern(pp);
	Dispose_Rasnik(rp);
	
    return 0;
}