Skip to content

Commit

Permalink
Remove functions not used when STBI_NO_PNG and STBI_NO_HDR are defined
Browse files Browse the repository at this point in the history
  • Loading branch information
slouken committed Feb 10, 2025
1 parent 52bd861 commit fece193
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/video/stb_image.h
Original file line number Diff line number Diff line change
Expand Up @@ -505,6 +505,7 @@ STBIDEF int stbi_is_16_bit_from_file(FILE *f);



#ifndef STBI_NO_PNG
// for image formats that explicitly notate that they have premultiplied alpha,
// we just return the colors as stored in the file. set this flag to force
// unpremultiplication. results are undefined if the unpremultiply overflow.
Expand All @@ -523,16 +524,19 @@ STBIDEF void stbi_set_flip_vertically_on_load(int flag_true_if_should_flip);
STBIDEF void stbi_set_unpremultiply_on_load_thread(int flag_true_if_should_unpremultiply);
STBIDEF void stbi_convert_iphone_png_to_rgb_thread(int flag_true_if_should_convert);
STBIDEF void stbi_set_flip_vertically_on_load_thread(int flag_true_if_should_flip);
#endif

// ZLIB client - used by PNG, available for other purposes

#ifndef STBI_NO_ZLIB
STBIDEF char *stbi_zlib_decode_malloc_guesssize(const char *buffer, int len, int initial_size, int *outlen);
STBIDEF char *stbi_zlib_decode_malloc_guesssize_headerflag(const char *buffer, int len, int initial_size, int *outlen, int parse_header);
STBIDEF char *stbi_zlib_decode_malloc(const char *buffer, int len, int *outlen);
STBIDEF int stbi_zlib_decode_buffer(char *obuffer, int olen, const char *ibuffer, int ilen);

STBIDEF char *stbi_zlib_decode_noheader_malloc(const char *buffer, int len, int *outlen);
STBIDEF int stbi_zlib_decode_noheader_buffer(char *obuffer, int olen, const char *ibuffer, int ilen);
#endif


#ifdef __cplusplus
Expand Down Expand Up @@ -1576,10 +1580,12 @@ STBIDEF void stbi_ldr_to_hdr_gamma(float gamma) { stbi__l2h_gamma = gamma; }
STBIDEF void stbi_ldr_to_hdr_scale(float scale) { stbi__l2h_scale = scale; }
#endif

#ifndef STBI_NO_HDR
static float stbi__h2l_gamma_i=1.0f/2.2f, stbi__h2l_scale_i=1.0f;

STBIDEF void stbi_hdr_to_ldr_gamma(float gamma) { stbi__h2l_gamma_i = 1/gamma; }
STBIDEF void stbi_hdr_to_ldr_scale(float scale) { stbi__h2l_scale_i = 1/scale; }
#endif


//////////////////////////////////////////////////////////////////////////////
Expand Down

0 comments on commit fece193

Please sign in to comment.