-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.cpp
67 lines (61 loc) · 1.83 KB
/
main.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
#include"header.h";
pixel image[1000][1000];
pixel image_modified[1000][1000];
pixel image_temp[1000][1000];
bmpFileHeader myBmpFileHeader;
bmpInfoHeader myBmpInfoHeader;
FILE *bmpImage;
FILE *newBmpImage;
int width;
int height;
char out[100]="image1.bmp";
int padding = (4 - (width * sizeof(pixel)) % 4) % 4;
//int options()
//{
// viewOptions(myBmpFileHeader,myBmpInfoHeader, newBmpImage,bmpImage, padding, image,image_modified,image_temp,height,width);
// options();
//}
//
//void readImage(char ipath[100]){
//
// bmpImage = fopen(ipath, "rb");
// viewInput(myBmpFileHeader,myBmpInfoHeader, newBmpImage,bmpImage, width,height,padding,image_modified,ipath);
// if (bmpImage == NULL)
// {
// printf("Error occured when opening file\n");
// }
// fread(&myBmpFileHeader, sizeof(myBmpFileHeader), 1, bmpImage);
// fread(&myBmpInfoHeader, sizeof(myBmpInfoHeader), 1, bmpImage);
//
// if (myBmpFileHeader.bitmapSignatureBytes[0]==0x42 && myBmpFileHeader.bitmapSignatureBytes[1]==0x4D && myBmpInfoHeader.dib_header_size == 40 && myBmpInfoHeader.bits_per_pixel == 24 && myBmpInfoHeader.compression ==0 )
// {
// printf("\nFile Format is BMP\n");
// }
// else
// {
// printf("Error\n");
//
// }
// width = myBmpInfoHeader.width;
// height = abs(myBmpInfoHeader.height);
//
//
// for (int i = 0; i < height; ++i)
// {
// fread(image[i], sizeof(pixel), width, bmpImage);
// fseek(bmpImage, padding, SEEK_CUR);
//
// }
// options();
//
//}
int main(void)
{
// char ipath[100];
// printf("Enter Path : ");
// scanf("%s",ipath);
// options();
viewOptions(myBmpFileHeader,myBmpInfoHeader, newBmpImage,bmpImage, padding, image,image_modified,image_temp,height,width);
free(image);
return 0;
}