-
Notifications
You must be signed in to change notification settings - Fork 4
/
Epeg.h
90 lines (81 loc) · 3.28 KB
/
Epeg.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
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
#ifndef _EPEG_H
#define _EPEG_H
#ifdef EAPI
#undef EAPI
#endif
#ifdef WIN32
# ifdef BUILDING_DLL
# define EAPI __declspec(dllexport)
# else
# define EAPI __declspec(dllimport)
# endif
#else
# ifdef __GNUC__
# if __GNUC__ >= 4
# define EAPI __attribute__ ((visibility("default")))
# else
# define EAPI
# endif
# else
# define EAPI
# endif
#endif
#ifdef __cplusplus
extern "C" {
#endif
typedef enum _Epeg_Colorspace
{
EPEG_GRAY8,
EPEG_YUV8,
EPEG_RGB8,
EPEG_BGR8,
EPEG_RGBA8,
EPEG_BGRA8,
EPEG_ARGB32,
EPEG_CMYK
}
Epeg_Colorspace;
typedef enum _Epeg_Transform {
EPEG_TRANSFORM_NONE, /* no transformation */
EPEG_TRANSFORM_FLIP_H, /* horizontal flip */
EPEG_TRANSFORM_FLIP_V, /* vertical flip */
EPEG_TRANSFORM_TRANSPOSE, /* transpose across UL-to-LR axis */
EPEG_TRANSFORM_TRANSVERSE, /* transpose across UR-to-LL axis */
EPEG_TRANSFORM_ROT_90, /* 90-degree clockwise rotation */
EPEG_TRANSFORM_ROT_180, /* 180-degree rotation */
EPEG_TRANSFORM_ROT_270 /* 270-degree clockwise (or 90 ccw) */
}
Epeg_Transform;
typedef struct _Epeg_Image Epeg_Image;
typedef struct _Epeg_Thumbnail_Info Epeg_Thumbnail_Info;
struct _Epeg_Thumbnail_Info {
char *uri;
unsigned long long int mtime;
int w, h;
char *mimetype;
};
EAPI Epeg_Image *epeg_file_open (const char *file);
EAPI Epeg_Image *epeg_memory_open (unsigned char *data, int size);
EAPI void epeg_size_get (Epeg_Image *im, int *w, int *h);
EAPI void epeg_decode_size_set (Epeg_Image *im, int w, int h);
EAPI void epeg_colorspace_get (Epeg_Image *im, int *space);
EAPI void epeg_decode_colorspace_set (Epeg_Image *im, Epeg_Colorspace colorspace);
EAPI void epeg_transform_set (Epeg_Image *im, Epeg_Transform transform);
EAPI const void *epeg_pixels_get (Epeg_Image *im, int x, int y, int w, int h);
EAPI void epeg_pixels_free (Epeg_Image *im, const void *data);
EAPI const char *epeg_comment_get (Epeg_Image *im);
EAPI void epeg_thumbnail_comments_get (Epeg_Image *im, Epeg_Thumbnail_Info *info);
EAPI void epeg_comment_set (Epeg_Image *im, const char *comment);
EAPI void epeg_quality_set (Epeg_Image *im, int quality);
EAPI void epeg_thumbnail_comments_enable (Epeg_Image *im, int onoff);
EAPI void epeg_file_output_set (Epeg_Image *im, const char *file);
EAPI void epeg_memory_output_set (Epeg_Image *im, unsigned char **data, int *size);
EAPI int epeg_encode (Epeg_Image *im);
EAPI int epeg_transform (Epeg_Image *im);
EAPI int epeg_trim (Epeg_Image *im);
EAPI void epeg_error (Epeg_Image *im, char* buffer);
EAPI void epeg_close (Epeg_Image *im);
#ifdef __cplusplus
}
#endif
#endif