-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathfunctions.h
More file actions
69 lines (61 loc) · 1.49 KB
/
Copy pathfunctions.h
File metadata and controls
69 lines (61 loc) · 1.49 KB
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
// Leca Maria Catalina 315CA
#ifndef FUNCTIONS_H
#define FUNCTIONS_H
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#define NMAX 100
typedef struct {
int red;
int green;
int blue;
} rgb;
typedef struct {
int type;
int height;
int width;
int max;
int **gray;
rgb **color;
} img;
typedef struct {
int r_start;
int r_stop;
int c_start;
int c_stop;
} coordinates;
typedef struct {
double mat[9][9];
int x;
} kernel;
int is_number(char s[]);
int to_number(char *s);
img load_ascii(char *filename);
int **gray_mat(int height, int width);
rgb **color_mat(int height, int width);
void free_image(img image);
void init_img(img *image);
void init_coord(img image, coordinates *coord);
img load_bin(char *filename);
int get_number(FILE *filename);
int magic_number(char *filename);
void select_all(img image, coordinates *coord);
void select_coord(img image, coordinates *coord, char *arg);
void crop(img *image, coordinates *coord);
void hist(img image, char arg[]);
double *freq(img image, int y);
int clamp(int x, int max);
int eq_pixel(img image, int a, double *fr);
void eq(img *image);
rgb new_pixel(img image, kernel ker, int i, int j);
void apply(img *image, coordinates coord, char *arg);
void to_string(int n, char *s);
void save(img image, char *arg);
void save_text(char *filename, img image);
void save_binary(char *filename, img image);
void comments(FILE *filename);
void remove_spaces(char *str);
void read_arg(char *arg);
void load(img *image, char *arg);
int my_round(double x);
#endif