-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathheader.h
69 lines (63 loc) · 3.04 KB
/
header.h
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
68
69
#include<bits/stdc++.h>
using namespace std;
#include<graphics.h>
#include<conio.h>
#pragma pack(push, 1)
typedef struct
{
char bitmapSignatureBytes[2];
uint32_t sizeOfBitmapImageBytes;
uint16_t reserved1;
uint16_t reserved2;
uint32_t pixelOffset[1][1];
}bmpFileHeader;
#pragma pack(pop)
#pragma pack(push, 1)
typedef struct
{
uint32_t dib_header_size; // DIB Header size in bytes (40 bytes)
int32_t width; // Width of the image
int32_t height; // Height of image
uint16_t num_planes; // Number of color planes
uint16_t bits_per_pixel; // Bits per pixel
uint32_t compression; // Compression type
uint32_t image_size_bytes; // Image size in bytes
int32_t x_resolution_ppm; // Pixels per meter
int32_t y_resolution_ppm; // Pixels per meter
uint32_t num_colors; // Number of colors
uint32_t important_colors; // Important colors
}bmpInfoHeader;
#pragma pack(pop)
#pragma pack(push,1)
typedef struct
{
uint8_t blue;
uint8_t green;
uint8_t red;
}pixel;
#pragma pack(pop)
int options();
int randNum(void);
void edgeDetection();
void viewOptions();
void viewInput(bmpFileHeader myBmpFileHeader, bmpInfoHeader myBmpInfoHeader,
FILE *newBmpImage,FILE *bmpImage, int width, int height, int padding, pixel image_modified[1000][1000],char*);
void readImage(char ipath[100]);
void greyscale(pixel temp[1000][1000], pixel outemp[1000][1000],int height, int width);
void edgeDetection(pixel image[1000][1000],pixel image_modified[1000][1000],pixel image_temp[1000][1000],int height,int width);
void smoothing(pixel temp[1000][1000], pixel outemp[1000][1000],int height,int width);
void brightening(pixel image[1000][1000],pixel image_modified[1000][1000],int height,int width);
void image_blur(pixel temp[1000][1000], pixel outemp[1000][1000],int height,int width);
void noise(pixel temp[1000][1000], pixel outemp[1000][1000],int height, int width);
void halftoning(pixel image[1000][1000],pixel image_modified[1000][1000],pixel image_temp[1000][1000],int height,int width);
void sharpen(pixel temp[1000][1000], pixel outemp[1000][1000],int height, int width);
void viewOptions(bmpFileHeader myBmpFileHeader, bmpInfoHeader myBmpInfoHeader,
FILE *newBmpImage,FILE *bmpImage,int padding,pixel image[1000][1000],pixel image_modified[1000][1000],pixel image_temp[1000][1000],int height,int width);
void showMainMenu(bmpFileHeader myBmpFileHeader, bmpInfoHeader myBmpInfoHeader,
FILE *newBmpImage,FILE *bmpImage,int padding,pixel image[1000][1000],pixel image_modified[1000][1000],pixel image_temp[1000][1000],int height,int width);
void writeImage(bmpFileHeader myBmpFileHeader, bmpInfoHeader myBmpInfoHeader,
FILE *newBmpImage,FILE *bmpImage, int width, int height, int padding, pixel image_modified[1000][1000]
);
void saveImage(bmpFileHeader myBmpFileHeader, bmpInfoHeader myBmpInfoHeader,
FILE *newBmpImage,FILE *bmpImage, int width, int height, int padding, pixel image_modified[1000][1000], char name[50]
);