My Project: openb3dlib.mod/openb3d/src/stb_image.c File Reference

My Project

Classes | Macros | Typedefs | Enumerations | Functions | Variables
stb_image.c File Reference
`#include <stdio.h>`
`#include <math.h>`
`#include <string.h>`
`#include <stdlib.h>`
`#include <memory.h>`
`#include <assert.h>`
`#include <stdarg.h>`
`#include <stddef.h>`
`#include <stdint.h>`

## Classes

struct | stbi_io_callbacks
struct | stbi
struct | huffman
struct | jpeg
struct | stbi_resample
struct | zhuffman
struct | zbuf
struct | chunk
struct | png
struct | pic_packet_t
struct | stbi_gif_lzw_struct
struct | stbi_gif_struct

## Macros

#define | STBI_INCLUDE_STB_IMAGE_H
#define | STBI_VERSION 1
#define | stbi_inline
#define | STBI_NOTUSED(v) (void)sizeof(v)
#define | stbi_lrot(x, y) (((x) << (y)) | ((x) >> (32 - (y))))
#define | e(x, y) e(x)
#define | epf(x, y) ((float *) (e(x,y)?NULL:NULL))
#define | epuc(x, y) ((unsigned char *) (e(x,y)?NULL:NULL))
#define | COMBO(a, b) ((a)*8+(b))
#define | CASE(a, b) case COMBO(a,b): for(i=x-1; i >= 0; --i, src += a, dest += b)
#define | float2int(x) ((int) (x))
#define | FAST_BITS 9
#define | f2f(x) (int) (((x) * 4096 + 0.5))
#define | fsh(x) ((x) << 12)
#define | IDCT_1D(s0, s1, s2, s3, s4, s5, s6, s7)
#define | MARKER_none 0xff
#define | RESTART(x) ((x) >= 0xd0 && (x) <= 0xd7)
#define | DNL(x) ((x) == 0xdc)
#define | SOI(x) ((x) == 0xd8)
#define | EOI(x) ((x) == 0xd9)
#define | SOF(x) ((x) == 0xc0 || (x) == 0xc1)
#define | SOS(x) ((x) == 0xda)
#define | div4(x) ((stbi__uint8) ((x) >> 2))
#define | div16(x) ((stbi__uint8) ((x) >> 4))
#define | float2fixed(x) ((int) ((x) * 65536 + 0.5))
#define | ZFAST_BITS 9
#define | ZFAST_MASK ((1 << ZFAST_BITS) - 1)
#define | PNG_TYPE(a, b, c, d) (((a) << 24) + ((b) << 16) + ((c) << 8) + (d))
#define | CASE(f)
#define | CASE(f)
#define | HDR_BUFLEN 1024

## Typedefs

typedef unsigned char | stbi_uc
typedef uint8_t | stbi__uint8
typedef uint16_t | stbi__uint16
typedef int16_t | stbi__int16
typedef uint32_t | stbi__uint32
typedef int32_t | stbi__int32
typedef unsigned char | validate_uint32[sizeof(stbi__uint32)==4 ? 1 :-1]
typedef stbi__uint8 | stbi_dequantize_t
typedef stbi__uint8 *(* | resample_row_func) (stbi__uint8 *out, stbi__uint8 *in0, stbi__uint8 *in1, int w, int hs)
typedef struct stbi_gif_lzw_struct | stbi_gif_lzw
typedef struct stbi_gif_struct | stbi_gif

## Enumerations

enum | { STBI_default = 0, STBI_grey = 1, STBI_grey_alpha = 2, STBI_rgb = 3, STBI_rgb_alpha = 4 }
enum | { SCAN_load =0, SCAN_type, SCAN_header }
enum | { F_none =0, F_sub =1, F_up =2, F_avg =3, F_paeth =4, F_avg_first, F_paeth_first }

## Functions

stbi_uc * | stbi_load_from_memory (stbi_uc const *buffer, int len, int *x, int *y, int *comp, int req_comp)
| STBI_NO_STDIO. More...
stbi_uc * | stbi_load (char const *filename, int *x, int *y, int *comp, int req_comp)
stbi_uc * | stbi_load_from_file (FILE *f, int *x, int *y, int *comp, int req_comp)
stbi_uc * | stbi_load_from_callbacks (stbi_io_callbacks const *clbk, void *user, int *x, int *y, int *comp, int req_comp)
float * | stbi_loadf_from_memory (stbi_uc const *buffer, int len, int *x, int *y, int *comp, int req_comp)
float * | stbi_loadf (char const *filename, int *x, int *y, int *comp, int req_comp)
float * | stbi_loadf_from_file (FILE *f, int *x, int *y, int *comp, int req_comp)
float * | stbi_loadf_from_callbacks (stbi_io_callbacks const *clbk, void *user, int *x, int *y, int *comp, int req_comp)
void | stbi_hdr_to_ldr_gamma (float gamma)
void | stbi_hdr_to_ldr_scale (float scale)
void | stbi_ldr_to_hdr_gamma (float gamma)
void | stbi_ldr_to_hdr_scale (float scale)
int | stbi_is_hdr_from_callbacks (stbi_io_callbacks const *clbk, void *user)
int | stbi_is_hdr_from_memory (stbi_uc const *buffer, int len)
int | stbi_is_hdr (char const *filename)
int | stbi_is_hdr_from_file (FILE *f)
const char * | stbi_failure_reason (void)
void | stbi_image_free (void *retval_from_stbi_load)
int | stbi_info_from_memory (stbi_uc const *buffer, int len, int *x, int *y, int *comp)
int | stbi_info_from_callbacks (stbi_io_callbacks const *clbk, void *user, int *x, int *y, int *comp)
int | stbi_info (char const *filename, int *x, int *y, int *comp)
int | stbi_info_from_file (FILE *f, int *x, int *y, int *comp)
void | stbi_set_unpremultiply_on_load (int flag_true_if_should_unpremultiply)
void | stbi_convert_iphone_png_to_rgb (int flag_true_if_should_convert)
char * | stbi_zlib_decode_malloc_guesssize (const char *buffer, int len, int initial_size, int *outlen)
char * | stbi_zlib_decode_malloc_guesssize_headerflag (const char *buffer, int len, int initial_size, int *outlen, int parse_header)
char * | stbi_zlib_decode_malloc (const char *buffer, int len, int *outlen)
int | stbi_zlib_decode_buffer (char *obuffer, int olen, const char *ibuffer, int ilen)
char * | stbi_zlib_decode_noheader_malloc (const char *buffer, int len, int *outlen)
int | stbi_zlib_decode_noheader_buffer (char *obuffer, int olen, const char *ibuffer, int ilen)
float * | stbi_loadf_main (stbi *s, int *x, int *y, int *comp, int req_comp)

## Variables

int | stbi_png_partial

## Macro Definition Documentation

## § CASE [1/3]

#define CASE | ( |  | a,
|  |  | b
| ) |  | case COMBO(a,b): for(i=x-1; i >= 0; --i, src += a, dest += b)

## § CASE [2/3]

#define CASE | ( |  | f | ) |

Value:
case f: \
for (i=x-1; i >= 1; --i, raw+=img_n,cur+=img_n,prior+=img_n) \
for (k=0; k < img_n; ++k)

## § CASE [3/3]

#define CASE | ( |  | f | ) |

Value:
case f: \
for (i=x-1; i >= 1; --i, cur[img_n]=255,raw+=img_n,cur+=out_n,prior+=out_n) \
for (k=0; k < img_n; ++k)

## § COMBO

#define COMBO | ( |  | a,
|  |  | b
| ) |  | ((a)*8+(b))

## § div16

#define div16 | ( |  | x | ) | ((stbi__uint8) ((x) >> 4))

## § div4

#define div4 | ( |  | x | ) | ((stbi__uint8) ((x) >> 2))

## § DNL

#define DNL | ( |  | x | ) | ((x) == 0xdc)

## § e

#define e | ( |  | x,
|  |  | y
| ) |  | e(x)

## § EOI

#define EOI | ( |  | x | ) | ((x) == 0xd9)

## § epf

#define epf | ( |  | x,
|  |  | y
| ) |  | ((float *) (e(x,y)?NULL:NULL))

## § epuc

#define epuc | ( |  | x,
|  |  | y
| ) |  | ((unsigned char *) (e(x,y)?NULL:NULL))

## § f2f

#define f2f | ( |  | x | ) | (int) (((x) * 4096 + 0.5))

## § FAST_BITS

#define FAST_BITS 9

## § float2fixed

#define float2fixed | ( |  | x | ) | ((int) ((x) * 65536 + 0.5))

## § float2int

#define float2int | ( |  | x | ) | ((int) (x))

## § fsh

#define fsh | ( |  | x | ) | ((x) << 12)

## § HDR_BUFLEN

#define HDR_BUFLEN 1024

## § IDCT_1D

#define IDCT_1D | ( |  | s0,
|  |  | s1,
|  |  | s2,
|  |  | s3,
|  |  | s4,
|  |  | s5,
|  |  | s6,
|  |  | s7
| ) |  |

## § MARKER_none

#define MARKER_none 0xff

## § PNG_TYPE

#define PNG_TYPE | ( |  | a,
|  |  | b,
|  |  | c,
|  |  | d
| ) |  | (((a) << 24) + ((b) << 16) + ((c) << 8) + (d))

## § RESTART

#define RESTART | ( |  | x | ) | ((x) >= 0xd0 && (x) <= 0xd7)

## § SOF

#define SOF | ( |  | x | ) | ((x) == 0xc0 || (x) == 0xc1)

## § SOI

#define SOI | ( |  | x | ) | ((x) == 0xd8)

## § SOS

#define SOS | ( |  | x | ) | ((x) == 0xda)

## § STBI_INCLUDE_STB_IMAGE_H

#define STBI_INCLUDE_STB_IMAGE_H

## § stbi_inline

#define stbi_inline

## § stbi_lrot

#define stbi_lrot | ( |  | x,
|  |  | y
| ) |  | (((x) << (y)) | ((x) >> (32 - (y))))

## § STBI_NOTUSED

#define STBI_NOTUSED | ( |  | v | ) | (void)sizeof(v)

## § STBI_VERSION

#define STBI_VERSION 1

## § ZFAST_BITS

#define ZFAST_BITS 9

## § ZFAST_MASK

#define ZFAST_MASK ((1 << ZFAST_BITS) - 1)

## Typedef Documentation

## § resample_row_func

typedef stbi__uint8*(* resample_row_func) (stbi__uint8 *out, stbi__uint8 *in0, stbi__uint8 *in1, int w, int hs)

## § stbi__int16

typedef int16_t stbi__int16

## § stbi__int32

typedef int32_t stbi__int32

## § stbi__uint16

typedef uint16_t stbi__uint16

## § stbi__uint32

typedef uint32_t stbi__uint32

## § stbi__uint8

typedef uint8_t stbi__uint8

## § stbi_dequantize_t

typedef stbi__uint8 stbi_dequantize_t

## § stbi_gif

typedef struct stbi_gif_struct stbi_gif

## § stbi_gif_lzw

typedef struct stbi_gif_lzw_struct stbi_gif_lzw

## § stbi_uc

typedef unsigned char stbi_uc

## § validate_uint32

typedef unsigned char validate_uint32[sizeof(stbi__uint32)==4 ? 1 :-1]

## Enumeration Type Documentation

## § anonymous enum

anonymous enum

Enumerator
F_none |
F_sub |
F_up |
F_avg |
F_paeth |
F_avg_first |
F_paeth_first |

## § anonymous enum

anonymous enum

Enumerator
STBI_default |
STBI_grey |
STBI_grey_alpha |
STBI_rgb |
STBI_rgb_alpha |

## § anonymous enum

anonymous enum

Enumerator
SCAN_load |
SCAN_type |
SCAN_header |

## Function Documentation

## § stbi_convert_iphone_png_to_rgb()

void stbi_convert_iphone_png_to_rgb | ( | int | flag_true_if_should_convert | ) |

## § stbi_failure_reason()

const char * stbi_failure_reason | ( | void |  | ) |

## § stbi_hdr_to_ldr_gamma()

void stbi_hdr_to_ldr_gamma | ( | float | gamma | ) |

## § stbi_hdr_to_ldr_scale()

void stbi_hdr_to_ldr_scale | ( | float | scale | ) |

## § stbi_image_free()

void stbi_image_free | ( | void * | retval_from_stbi_load | ) |

## § stbi_info()

int stbi_info | ( | char const * | filename,
|  | int * | x,
|  | int * | y,
|  | int * | comp
| ) |  |

## § stbi_info_from_callbacks()

int stbi_info_from_callbacks | ( | stbi_io_callbacks const * | clbk,
|  | void * | user,
|  | int * | x,
|  | int * | y,
|  | int * | comp
| ) |  |

## § stbi_info_from_file()

int stbi_info_from_file | ( | FILE * | f,
|  | int * | x,
|  | int * | y,
|  | int * | comp
| ) |  |

## § stbi_info_from_memory()

int stbi_info_from_memory | ( | stbi_uc const * | buffer,
|  | int | len,
|  | int * | x,
|  | int * | y,
|  | int * | comp
| ) |  |

## § stbi_is_hdr()

int stbi_is_hdr | ( | char const * | filename | ) |

## § stbi_is_hdr_from_callbacks()

int stbi_is_hdr_from_callbacks | ( | stbi_io_callbacks const * | clbk,
|  | void * | user
| ) |  |

## § stbi_is_hdr_from_file()

int stbi_is_hdr_from_file | ( | FILE * | f | ) |

## § stbi_is_hdr_from_memory()

int stbi_is_hdr_from_memory | ( | stbi_uc const * | buffer,
|  | int | len
| ) |  |

## § stbi_ldr_to_hdr_gamma()

void stbi_ldr_to_hdr_gamma | ( | float | gamma | ) |

## § stbi_ldr_to_hdr_scale()

void stbi_ldr_to_hdr_scale | ( | float | scale | ) |

## § stbi_load()

unsigned char * stbi_load | ( | char const * | filename,
|  | int * | x,
|  | int * | y,
|  | int * | comp,
|  | int | req_comp
| ) |  |

## § stbi_load_from_callbacks()

unsigned char * stbi_load_from_callbacks | ( | stbi_io_callbacks const * | clbk,
|  | void * | user,
|  | int * | x,
|  | int * | y,
|  | int * | comp,
|  | int | req_comp
| ) |  |

## § stbi_load_from_file()

unsigned char * stbi_load_from_file | ( | FILE * | f,
|  | int * | x,
|  | int * | y,
|  | int * | comp,
|  | int | req_comp
| ) |  |

## § stbi_load_from_memory()

unsigned char * stbi_load_from_memory | ( | stbi_uc const * | buffer,
|  | int | len,
|  | int * | x,
|  | int * | y,
|  | int * | comp,
|  | int | req_comp
| ) |  |

STBI_NO_STDIO.

## § stbi_loadf()

float * stbi_loadf | ( | char const * | filename,
|  | int * | x,
|  | int * | y,
|  | int * | comp,
|  | int | req_comp
| ) |  |

## § stbi_loadf_from_callbacks()

float * stbi_loadf_from_callbacks | ( | stbi_io_callbacks const * | clbk,
|  | void * | user,
|  | int * | x,
|  | int * | y,
|  | int * | comp,
|  | int | req_comp
| ) |  |

## § stbi_loadf_from_file()

float * stbi_loadf_from_file | ( | FILE * | f,
|  | int * | x,
|  | int * | y,
|  | int * | comp,
|  | int | req_comp
| ) |  |

## § stbi_loadf_from_memory()

float * stbi_loadf_from_memory | ( | stbi_uc const * | buffer,
|  | int | len,
|  | int * | x,
|  | int * | y,
|  | int * | comp,
|  | int | req_comp
| ) |  |

## § stbi_loadf_main()

float* stbi_loadf_main | ( | stbi * | s,
|  | int * | x,
|  | int * | y,
|  | int * | comp,
|  | int | req_comp
| ) |  |

## § stbi_set_unpremultiply_on_load()

void stbi_set_unpremultiply_on_load | ( | int | flag_true_if_should_unpremultiply | ) |

## § stbi_zlib_decode_buffer()

int stbi_zlib_decode_buffer | ( | char * | obuffer,
|  | int | olen,
|  | const char * | ibuffer,
|  | int | ilen
| ) |  |

## § stbi_zlib_decode_malloc()

char * stbi_zlib_decode_malloc | ( | const char * | buffer,
|  | int | len,
|  | int * | outlen
| ) |  |

## § stbi_zlib_decode_malloc_guesssize()

char * stbi_zlib_decode_malloc_guesssize | ( | const char * | buffer,
|  | int | len,
|  | int | initial_size,
|  | int * | outlen
| ) |  |

## § stbi_zlib_decode_malloc_guesssize_headerflag()

char * stbi_zlib_decode_malloc_guesssize_headerflag | ( | const char * | buffer,
|  | int | len,
|  | int | initial_size,
|  | int * | outlen,
|  | int | parse_header
| ) |  |

## § stbi_zlib_decode_noheader_buffer()

int stbi_zlib_decode_noheader_buffer | ( | char * | obuffer,
|  | int | olen,
|  | const char * | ibuffer,
|  | int | ilen
| ) |  |

## § stbi_zlib_decode_noheader_malloc()

char * stbi_zlib_decode_noheader_malloc | ( | const char * | buffer,
|  | int | len,
|  | int * | outlen
| ) |  |

## Variable Documentation

## § stbi_png_partial

int stbi_png_partial