]> rtime.felk.cvut.cz Git - l4.git/blob - l4/pkg/libpng/include/l4png_wrap.h
db620a56fa94d2feae82ab7ff66928530ca87390
[l4.git] / l4 / pkg / libpng / include / l4png_wrap.h
1 #ifndef __L4PNG_WRAP_H__
2 #define __L4PNG_WRAP_H__
3
4 #define ARGB_BUF_TO_SMALL -2
5 #define ENOPNG -3;
6 #define EDAMAGEDPNG -4;
7
8 /**
9  * \brief Get the dimension of an PNG picture.
10  * \return 0 on success, negative on error
11  */
12 int png_get_size_mem(void *png_data, int png_data_size, int *width, int *height);
13 int png_get_size_file(const char *fp, int *width, int *height);
14
15 /** CONVERT PNG TO A ARGB-BUFFER (ALPHA, RED, GREEN, BLUE) **/
16 int png_convert_ARGB_mem(void *png_data, void *argb_buf,
17                          int png_data_size, unsigned argb_max_size);
18 int png_convert_ARGB_file(const char *filename, void *argb_buf,
19                           unsigned argb_max_size);
20 int png_convert_RGB16bit_mem(void *png_data, void *argb_buf,
21                              int png_data_size, unsigned argb_max_size,
22                              int line_offset);
23 int png_convert_RGB16bit_file(const char *filename, void *argb_buf,
24                               unsigned argb_max_size,
25                               int line_offset);
26
27 #endif /* ! __L4PNG_WRAP_H__ */