-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathimage_io.h
57 lines (34 loc) · 1.84 KB
/
image_io.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
/* Developed by Jimmy Hu */
#ifndef TINYDIP_IMAGE_IO_H // image_io.h header guard, follow the suggestion from https://codereview.stackexchange.com/a/293832/231235
#define TINYDIP_IMAGE_IO_H
#include <cstring>
#include <iostream>
#include <memory>
#include <string>
#include "image.h"
namespace TinyDIP
{
Image<RGB> raw_image_to_array(const int xsize, const int ysize, const unsigned char * const image);
unsigned long bmp_read_x_size(const char *filename, const bool extension);
unsigned long bmp_read_y_size(const char *filename, const bool extension);
char bmp_read_detail(unsigned char *image, const int xsize, const int ysize, const char *filename, const bool extension);
BMPIMAGE bmp_file_read(const char *filename, const bool extension);
Image<RGB> bmp_read(const char* filename, const bool extension);
int bmp_write(std::string filename, Image<RGB> input);
int bmp_write(const char *filename, Image<RGB> input);
int bmp_write(const char *filename, const int xsize, const int ysize, const unsigned char *image);
unsigned char *array_to_raw_image(Image<RGB> input);
unsigned char bmp_filling_byte_calc(const unsigned int xsize, const int mod_num = 4);
namespace double_image
{
double* array_to_raw_image(Image<double> input);
int write(const char* filename, const int xsize, const int ysize, const double* image);
int write(const char* filename, Image<double> input);
TinyDIP::Image<double> read(const char* const filename, const bool extension);
double* array_to_raw_image(Image<HSV> input);
}
int hsv_write_detail(const char* const filename, const int xsize, const int ysize, const double* const image);
int hsv_write(const char* const filename, Image<HSV> input);
Image<HSV> hsv_read(const char* const filename, const bool extension);
}
#endif