1 #ifndef STBI_INCLUDE_STB_IMAGE_H
2 #define STBI_INCLUDE_STB_IMAGE_H
124 #ifndef STBI_NO_STDIO
126 #if defined(_MSC_VER) && _MSC_VER >= 0x1400
127 #define _CRT_SECURE_NO_WARNINGS // suppress bogus warnings about fopen()
133 #define STBI_VERSION 1
145 typedef unsigned char stbi_uc;
160 extern stbi_uc *stbi_load_from_memory(stbi_uc
const *buffer,
int len,
int *x,
int *y,
int *comp,
int req_comp);
162 #ifndef STBI_NO_STDIO
163 extern stbi_uc *stbi_load (
char const *filename,
int *x,
int *y,
int *comp,
int req_comp);
164 extern stbi_uc *stbi_load_from_file (FILE *f,
int *x,
int *y,
int *comp,
int req_comp);
170 int (*read) (
void *user,
char *data,
int size);
171 void (*skip) (
void *user,
unsigned n);
172 int (*eof) (
void *user);
175 extern stbi_uc *stbi_load_from_callbacks (
stbi_io_callbacks const *clbk,
void *user,
int *x,
int *y,
int *comp,
int req_comp);
178 extern float *stbi_loadf_from_memory(stbi_uc
const *buffer,
int len,
int *x,
int *y,
int *comp,
int req_comp);
180 #ifndef STBI_NO_STDIO
181 extern float *stbi_loadf (
char const *filename,
int *x,
int *y,
int *comp,
int req_comp);
182 extern float *stbi_loadf_from_file (FILE *f,
int *x,
int *y,
int *comp,
int req_comp);
185 extern float *stbi_loadf_from_callbacks (
stbi_io_callbacks const *clbk,
void *user,
int *x,
int *y,
int *comp,
int req_comp);
187 extern void stbi_hdr_to_ldr_gamma(
float gamma);
188 extern void stbi_hdr_to_ldr_scale(
float scale);
190 extern void stbi_ldr_to_hdr_gamma(
float gamma);
191 extern void stbi_ldr_to_hdr_scale(
float scale);
192 #endif // STBI_NO_HDR
195 extern int stbi_is_hdr_from_callbacks(
stbi_io_callbacks const *clbk,
void *user);
196 extern int stbi_is_hdr_from_memory(stbi_uc
const *buffer,
int len);
197 #ifndef STBI_NO_STDIO
198 extern int stbi_is_hdr (
char const *filename);
199 extern int stbi_is_hdr_from_file(FILE *f);
200 #endif // STBI_NO_STDIO
205 extern const char *stbi_failure_reason (
void);
208 extern void stbi_image_free (
void *retval_from_stbi_load);
211 extern int stbi_info_from_memory(stbi_uc
const *buffer,
int len,
int *x,
int *y,
int *comp);
212 extern int stbi_info_from_callbacks(
stbi_io_callbacks const *clbk,
void *user,
int *x,
int *y,
int *comp);
214 #ifndef STBI_NO_STDIO
215 extern int stbi_info (
char const *filename,
int *x,
int *y,
int *comp);
216 extern int stbi_info_from_file (FILE *f,
int *x,
int *y,
int *comp);
225 extern void stbi_set_unpremultiply_on_load(
int flag_true_if_should_unpremultiply);
229 extern void stbi_convert_iphone_png_to_rgb(
int flag_true_if_should_convert);
234 extern char *stbi_zlib_decode_malloc_guesssize(
const char *buffer,
int len,
int initial_size,
int *outlen);
235 extern char *stbi_zlib_decode_malloc(
const char *buffer,
int len,
int *outlen);
236 extern int stbi_zlib_decode_buffer(
char *obuffer,
int olen,
const char *ibuffer,
int ilen);
238 extern char *stbi_zlib_decode_noheader_malloc(
const char *buffer,
int len,
int *outlen);
239 extern int stbi_zlib_decode_noheader_buffer(
char *obuffer,
int olen,
const char *ibuffer,
int ilen);
244 typedef void (*stbi_idct_8x8)(stbi_uc *out,
int out_stride,
short data[64],
unsigned short *dequantize);
249 typedef void (*stbi_YCbCr_to_RGB_run)(stbi_uc *output, stbi_uc
const *y, stbi_uc
const *cb, stbi_uc
const *cr,
int count,
int step);
257 extern void stbi_install_idct(stbi_idct_8x8 func);
258 extern void stbi_install_YCbCr_to_RGB(stbi_YCbCr_to_RGB_run func);
269 #endif // STBI_INCLUDE_STB_IMAGE_H