forked from play-co/native-core
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathimage_writer.h
32 lines (24 loc) · 991 Bytes
/
image_writer.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
#ifndef IMAGE_WRITER_H
#define IMAGE_WRITER_H
#ifdef UNITY
#include "Unity/png.h"
#else
#include "core/deps/png/png.h"
#include "core/deps/png/pngstruct.h"
#endif
#include "core/log.h"
#include "core/types.h"
enum IMAGE_TYPES {IMAGE_TYPE_JPEG, IMAGE_TYPE_PNG};
#ifdef __cplusplus
extern "C" {
#endif
bool write_image_to_file(const char *path, const char *name, unsigned char * data, int width, int height, int channels);
bool write_png_to_file(const char *path, const char *name, unsigned char * data, int width, int height, int channels);
bool write_jpeg_to_file(const char *path, const char *name, unsigned char * data, int width, int height, int channels);
char *write_image_to_base64(const char *image_type, unsigned char *data, int width, int height, int channels);
char *write_png_to_base64(unsigned char * data, int width, int height, int channels);
char *write_jpeg_to_base64(unsigned char * data, int width, int height, int channels);
#ifdef __cplusplus
}
#endif
#endif