MCPcopy Create free account
hub / github.com/ARM-software/ComputeLibrary / stbi__refill_buffer

Function stbi__refill_buffer

include/stb/stb_image.h:1597–1612  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1595};
1596
1597static void stbi__refill_buffer(stbi__context *s)
1598{
1599 int n = (s->io.read)(s->io_user_data,(char*)s->buffer_start,s->buflen);
1600 s->callback_already_read += (int) (s->img_buffer - s->img_buffer_original);
1601 if (n == 0) {
1602 // at end of file, treat same as if from memory, but need to handle case
1603 // where s->img_buffer isn't pointing to safe memory, e.g. 0-byte file
1604 s->read_from_callbacks = 0;
1605 s->img_buffer = s->buffer_start;
1606 s->img_buffer_end = s->buffer_start+1;
1607 *s->img_buffer = 0;
1608 } else {
1609 s->img_buffer = s->buffer_start;
1610 s->img_buffer_end = s->buffer_start + n;
1611 }
1612}
1613
1614stbi_inline static stbi_uc stbi__get8(stbi__context *s)
1615{

Callers 2

stbi__start_callbacksFunction · 0.85
stbi__get8Function · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected