MCPcopy Create free account
hub / github.com/DISTRHO/Cardinal / stbiw__writefv

Function stbiw__writefv

include/stb_image_write.h:243–270  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

241#endif
242
243static void stbiw__writefv(stbi__write_context *s, const char *fmt, va_list v)
244{
245 while (*fmt) {
246 switch (*fmt++) {
247 case ' ': break;
248 case '1': { unsigned char x = STBIW_UCHAR(va_arg(v, int));
249 s->func(s->context,&x,1);
250 break; }
251 case '2': { int x = va_arg(v,int);
252 unsigned char b[2];
253 b[0] = STBIW_UCHAR(x);
254 b[1] = STBIW_UCHAR(x>>8);
255 s->func(s->context,b,2);
256 break; }
257 case '4': { stbiw_uint32 x = va_arg(v,int);
258 unsigned char b[4];
259 b[0]=STBIW_UCHAR(x);
260 b[1]=STBIW_UCHAR(x>>8);
261 b[2]=STBIW_UCHAR(x>>16);
262 b[3]=STBIW_UCHAR(x>>24);
263 s->func(s->context,b,4);
264 break; }
265 default:
266 STBIW_ASSERT(0);
267 return;
268 }
269 }
270}
271
272static void stbiw__writef(stbi__write_context *s, const char *fmt, ...)
273{

Callers 2

stbiw__writefFunction · 0.85
stbiw__outfileFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected