Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<stdio.h>
- int main(int argc, char *argv[])
- {
- //Decralation of variables
- FILE *fpi1,*fpi2,*fpo;
- int id,ix,iy,i,j,width,height;
- float x,y,z;
- unsigned char dn;
- unsigned char *buffer1;
- unsigned char *buffer2;
- unsigned char r,g,b;
- //Open CSV file
- if((fpi1=fopen(argv[1],"rb"))==NULL)
- {
- printf ("The file can't be opened. The program is exit.\n");
- return 0;
- }
- fread((unsigned char*)buffer1,sizeof(char),width*height*3,fpi1);
- if((fpi2=fopen(argv[2],"rb"))==NULL)
- {
- printf ("The file can't be opened. The program is exit.\n");
- return 0;
- }
- r=atoi(argv[6]);
- g=atoi(argv[7]);
- b=atoi(argv[8]);
- time=atoi(argv[9]);
- width = atoi(argv[4]); printf("W = %d,", width);
- height = atoi(argv[5]); printf("H = %d\n", height);
- buffer1= (unsigned char*)malloc(width*height*3);
- fread((unsigned char*)buffer1,sizeof(char),width*height*3,fpi1);
- fread((unsigned char*)buffer2,sizeof(char),width*height*3,fpi2);
- if((fpo=fopen(argv[3],"wb"))==NULL)
- {
- printf("The file can't be opened. The program is exit.\n");
- return 0;
- }
- imeco[i*2+j]
- buffer[3*(iy*width+ix)]=r;
- buffer[3*(iy*width+ix)+1]=g;
- buffer[3*(iy*width+ix)+2]=b;
- fclose(fpi1);
- fclose(fpi2);
- fclose(fpo);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement