rename stbi_load parameters to reduce confusion
This commit is contained in:
parent
996ccf2159
commit
239a6718e1
27
stb_image.h
27
stb_image.h
@ -238,10 +238,10 @@ publish, and distribute this file as you see fit.
|
|||||||
// stbi_image_free(data)
|
// stbi_image_free(data)
|
||||||
//
|
//
|
||||||
// Standard parameters:
|
// Standard parameters:
|
||||||
// int *x -- outputs image width in pixels
|
// int *x -- outputs image width in pixels
|
||||||
// int *y -- outputs image height in pixels
|
// int *y -- outputs image height in pixels
|
||||||
// int *comp -- outputs # of image components in image file
|
// int *channels_in_file -- outputs # of image components in image file
|
||||||
// int req_comp -- if non-zero, # of image components requested in result
|
// int desired_channels -- if non-zero, # of image components requested in result
|
||||||
//
|
//
|
||||||
// The return value from an image loader is an 'unsigned char *' which points
|
// The return value from an image loader is an 'unsigned char *' which points
|
||||||
// to the pixel data, or NULL on an allocation failure or if the image is
|
// to the pixel data, or NULL on an allocation failure or if the image is
|
||||||
@ -406,6 +406,7 @@ enum
|
|||||||
};
|
};
|
||||||
|
|
||||||
typedef unsigned char stbi_uc;
|
typedef unsigned char stbi_uc;
|
||||||
|
typedef unsigned short stbi_us;
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
extern "C" {
|
extern "C" {
|
||||||
@ -433,22 +434,24 @@ typedef struct
|
|||||||
int (*eof) (void *user); // returns nonzero if we are at end of file/data
|
int (*eof) (void *user); // returns nonzero if we are at end of file/data
|
||||||
} stbi_io_callbacks;
|
} stbi_io_callbacks;
|
||||||
|
|
||||||
STBIDEF stbi_uc *stbi_load (char const *filename, int *x, int *y, int *comp, int req_comp);
|
STBIDEF stbi_uc *stbi_load (char const *filename, int *x, int *y, int *channels_in_file, int desired_channels);
|
||||||
STBIDEF stbi_uc *stbi_load_from_memory (stbi_uc const *buffer, int len , int *x, int *y, int *comp, int req_comp);
|
STBIDEF stbi_uc *stbi_load_from_memory (stbi_uc const *buffer, int len , int *x, int *y, int *channels_in_file, int desired_channels);
|
||||||
STBIDEF stbi_uc *stbi_load_from_callbacks(stbi_io_callbacks const *clbk , void *user, int *x, int *y, int *comp, int req_comp);
|
STBIDEF stbi_uc *stbi_load_from_callbacks(stbi_io_callbacks const *clbk , void *user, int *x, int *y, int *channels_in_file, int desired_channels);
|
||||||
|
|
||||||
#ifndef STBI_NO_STDIO
|
#ifndef STBI_NO_STDIO
|
||||||
STBIDEF stbi_uc *stbi_load_from_file (FILE *f, int *x, int *y, int *comp, int req_comp);
|
STBIDEF stbi_uc *stbi_load_from_file (FILE *f, int *x, int *y, int *channels_in_file, int desired_channels);
|
||||||
// for stbi_load_from_file, file pointer is left pointing immediately after image
|
// for stbi_load_from_file, file pointer is left pointing immediately after image
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
//STBIDEF stbi_us *stbi_load_16(char const *filename, int *x, int *y, int *channels_in_file, int desired_channels);
|
||||||
|
|
||||||
#ifndef STBI_NO_LINEAR
|
#ifndef STBI_NO_LINEAR
|
||||||
STBIDEF float *stbi_loadf (char const *filename, int *x, int *y, int *comp, int req_comp);
|
STBIDEF float *stbi_loadf (char const *filename, int *x, int *y, int *channels_in_file, int desired_channels);
|
||||||
STBIDEF float *stbi_loadf_from_memory (stbi_uc const *buffer, int len, int *x, int *y, int *comp, int req_comp);
|
STBIDEF float *stbi_loadf_from_memory (stbi_uc const *buffer, int len, int *x, int *y, int *channels_in_file, int desired_channels);
|
||||||
STBIDEF float *stbi_loadf_from_callbacks (stbi_io_callbacks const *clbk, void *user, int *x, int *y, int *comp, int req_comp);
|
STBIDEF float *stbi_loadf_from_callbacks (stbi_io_callbacks const *clbk, void *user, int *x, int *y, int *channels_in_file, int desired_channels);
|
||||||
|
|
||||||
#ifndef STBI_NO_STDIO
|
#ifndef STBI_NO_STDIO
|
||||||
STBIDEF float *stbi_loadf_from_file (FILE *f, int *x, int *y, int *comp, int req_comp);
|
STBIDEF float *stbi_loadf_from_file (FILE *f, int *x, int *y, int *channels_in_file, int desired_channels);
|
||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user