216 #ifndef STBI_INCLUDE_STB_IMAGE_H
217 #define STBI_INCLUDE_STB_IMAGE_H
389 #ifndef STBI_NO_STDIO
391 #endif // STBI_NO_STDIO
393 #define STBI_VERSION 1
405 typedef unsigned char stbi_uc;
411 #ifdef STB_IMAGE_STATIC
412 #define STBIDEF static
414 #define STBIDEF extern
428 int (*read) (
void *user,
char *data,
int size);
429 void (*skip) (
void *user,
int n);
430 int (*eof) (
void *user);
433 STBIDEF stbi_uc *stbi_load (
char const *filename,
int *x,
int *y,
int *comp,
int req_comp);
434 STBIDEF stbi_uc *stbi_load_from_memory (stbi_uc
const *buffer,
int len ,
int *x,
int *y,
int *comp,
int req_comp);
435 STBIDEF stbi_uc *stbi_load_from_callbacks(
stbi_io_callbacks const *clbk ,
void *user,
int *x,
int *y,
int *comp,
int req_comp);
437 #ifndef STBI_NO_STDIO
438 STBIDEF stbi_uc *stbi_load_from_file (FILE *f,
int *x,
int *y,
int *comp,
int req_comp);
442 #ifndef STBI_NO_LINEAR
443 STBIDEF
float *stbi_loadf (
char const *filename,
int *x,
int *y,
int *comp,
int req_comp);
444 STBIDEF
float *stbi_loadf_from_memory (stbi_uc
const *buffer,
int len,
int *x,
int *y,
int *comp,
int req_comp);
445 STBIDEF
float *stbi_loadf_from_callbacks (
stbi_io_callbacks const *clbk,
void *user,
int *x,
int *y,
int *comp,
int req_comp);
447 #ifndef STBI_NO_STDIO
448 STBIDEF
float *stbi_loadf_from_file (FILE *f,
int *x,
int *y,
int *comp,
int req_comp);
453 STBIDEF
void stbi_hdr_to_ldr_gamma(
float gamma);
454 STBIDEF
void stbi_hdr_to_ldr_scale(
float scale);
457 #ifndef STBI_NO_LINEAR
458 STBIDEF
void stbi_ldr_to_hdr_gamma(
float gamma);
459 STBIDEF
void stbi_ldr_to_hdr_scale(
float scale);
460 #endif // STBI_NO_HDR
463 STBIDEF
int stbi_is_hdr_from_callbacks(
stbi_io_callbacks const *clbk,
void *user);
464 STBIDEF
int stbi_is_hdr_from_memory(stbi_uc
const *buffer,
int len);
465 #ifndef STBI_NO_STDIO
466 STBIDEF
int stbi_is_hdr (
char const *filename);
467 STBIDEF
int stbi_is_hdr_from_file(FILE *f);
468 #endif // STBI_NO_STDIO
473 STBIDEF
const char *stbi_failure_reason (
void);
476 STBIDEF
void stbi_image_free (
void *retval_from_stbi_load);
479 STBIDEF
int stbi_info_from_memory(stbi_uc
const *buffer,
int len,
int *x,
int *y,
int *comp);
480 STBIDEF
int stbi_info_from_callbacks(
stbi_io_callbacks const *clbk,
void *user,
int *x,
int *y,
int *comp);
482 #ifndef STBI_NO_STDIO
483 STBIDEF
int stbi_info (
char const *filename,
int *x,
int *y,
int *comp);
484 STBIDEF
int stbi_info_from_file (FILE *f,
int *x,
int *y,
int *comp);
493 STBIDEF
void stbi_set_unpremultiply_on_load(
int flag_true_if_should_unpremultiply);
497 STBIDEF
void stbi_convert_iphone_png_to_rgb(
int flag_true_if_should_convert);
500 STBIDEF
void stbi_set_flip_vertically_on_load(
int flag_true_if_should_flip);
504 STBIDEF
char *stbi_zlib_decode_malloc_guesssize(
const char *buffer,
int len,
int initial_size,
int *outlen);
505 STBIDEF
char *stbi_zlib_decode_malloc_guesssize_headerflag(
const char *buffer,
int len,
int initial_size,
int *outlen,
int parse_header);
506 STBIDEF
char *stbi_zlib_decode_malloc(
const char *buffer,
int len,
int *outlen);
507 STBIDEF
int stbi_zlib_decode_buffer(
char *obuffer,
int olen,
const char *ibuffer,
int ilen);
509 STBIDEF
char *stbi_zlib_decode_noheader_malloc(
const char *buffer,
int len,
int *outlen);
510 STBIDEF
int stbi_zlib_decode_noheader_buffer(
char *obuffer,
int olen,
const char *ibuffer,
int ilen);
520 #endif // STBI_INCLUDE_STB_IMAGE_H