-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathimage_io.h
More file actions
74 lines (66 loc) · 1.84 KB
/
image_io.h
File metadata and controls
74 lines (66 loc) · 1.84 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
70
71
72
73
74
/** Copyright (C) 2016, Gavin J Stark. All rights reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
* @file image_io.h
* @brief Image reading/writing library, using libpng/libjpeg
*
*/
/*a Wrapper
*/
#ifdef __INC_IMAGE_IO
#else
#define __INC_IMAGE_IO
/*a Defines
*/
/*a Types
*/
/*t c_image_io
*/
class c_image_io
{
struct prvt_data *prvt;
public:
c_image_io(void);
~c_image_io(void);
void free_image_data(void);
int jpeg_read(FILE *f);
int png_read(FILE *f);
int read_init(FILE *f);
int read_set_rgb8(void);
int read_alloc(void);
int read_image(void);
void read_finalize(void);
int write_init(FILE *f);
int write_image(void);
int write_finalize(void);
int png_write(FILE *f);
unsigned char *image_data;
unsigned int width;
unsigned int height;
int byte_width;
int bit_depth;
int color_type;
int free_image_data_on_destruction;
};
extern int image_write_rgba(const char *filename, const unsigned char *image_data, int width, int height);
extern unsigned char *image_read_rgba(const char *filename, int *width, int *height);
/*a Wrapper
*/
#endif
/*a Editor preferences and notes
mode: c ***
c-basic-offset: 4 ***
c-default-style: (quote ((c-mode . "k&r") (c++-mode . "k&r"))) ***
outline-regexp: "/\\\*a\\\|[\t ]*\/\\\*[b-z][\t ]" ***
*/