Skip to content
Myr

stb_image_write: add missing 'static' on internal functions

Before adoption: this commit came in with the history the project adopted, so no landing records it.

authored by Sean Barrett · committed by Sean Barrett · parent ddccc72 · Browse files · 1 file+6 added−6 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

1 file+6 added−6 removed

  • other:+6 added−6 removed

1 file+6 added−6 removed

modified:stb_image_write.h+6 added-6 removed
600 unmodified lines
601// by Baldur Karlsson602603#define stbiw__max(a, b) ((a) > (b) ? (a) : (b))604605void stbiw__linear_to_rgbe(unsigned char *rgbe, float *linear)605static void stbiw__linear_to_rgbe(unsigned char *rgbe, float *linear)606{607 int exponent;608 float maxcomp = stbiw__max(linear[0], stbiw__max(linear[1], linear[2]));609
8 unmodified lines
618 rgbe[3] = (unsigned char)(exponent + 128);619 }620}621622void stbiw__write_run_data(stbi__write_context *s, int length, unsigned char databyte)622static void stbiw__write_run_data(stbi__write_context *s, int length, unsigned char databyte)623{624 unsigned char lengthbyte = STBIW_UCHAR(length+128);625 STBIW_ASSERT(length+128 <= 255);626 s->func(s->context, &lengthbyte, 1);627 s->func(s->context, &databyte, 1);628}629630void stbiw__write_dump_data(stbi__write_context *s, int length, unsigned char *data)630static void stbiw__write_dump_data(stbi__write_context *s, int length, unsigned char *data)631{632 unsigned char lengthbyte = STBIW_UCHAR(length);633 STBIW_ASSERT(length <= 128); // inconsistent with spec but consistent with official code634 s->func(s->context, &lengthbyte, 1);635 s->func(s->context, data, length);636}637638void stbiw__write_hdr_scanline(stbi__write_context *s, int width, int ncomp, unsigned char *scratch, float *scanline)638static void stbiw__write_hdr_scanline(stbi__write_context *s, int width, int ncomp, unsigned char *scratch, float *scanline)639{640 unsigned char scanlineheader[4] = { 2, 2, 0, 0 };641 unsigned char rgbe[4];642 float linear[3];
215 unmodified lines
858#define stbiw__ZHASH 16384859860#endif // STBIW_ZLIB_COMPRESS861862unsigned char * stbi_zlib_compress(unsigned char *data, int data_len, int *out_len, int quality)862STBIWDEF unsigned char * stbi_zlib_compress(unsigned char *data, int data_len, int *out_len, int quality)863{864#ifdef STBIW_ZLIB_COMPRESS865 // user provided a zlib compress implementation, use that866 return STBIW_ZLIB_COMPRESS(data, data_len, out_len, quality);
207 unmodified lines
1074 case 6: for (i=n; i < width*n; ++i) line_buffer[i] = z[i] - stbiw__paeth(z[i-n], 0,0); break;1075 }1076}10771078unsigned char *stbi_write_png_to_mem(const unsigned char *pixels, int stride_bytes, int x, int y, int n, int *out_len)1078STBIWDEF unsigned char *stbi_write_png_to_mem(const unsigned char *pixels, int stride_bytes, int x, int y, int n, int *out_len)1079{1080 int force_filter = stbi_write_force_png_filter;1081 int ctype[5] = { -1, 0, 4, 2, 6 };1082 unsigned char sig[8] = { 137,80,78,71,13,10,26,10 };
541 unmodified lines