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

Function stbi__getn

include/stb/stb_image.h:1666–1688  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1664// nothing
1665#else
1666static int stbi__getn(stbi__context *s, stbi_uc *buffer, int n)
1667{
1668 if (s->io.read) {
1669 int blen = (int) (s->img_buffer_end - s->img_buffer);
1670 if (blen < n) {
1671 int res, count;
1672
1673 memcpy(buffer, s->img_buffer, blen);
1674
1675 count = (s->io.read)(s->io_user_data, (char*) buffer + blen, n - blen);
1676 res = (count == (n-blen));
1677 s->img_buffer = s->img_buffer_end;
1678 return res;
1679 }
1680 }
1681
1682 if (s->img_buffer+n <= s->img_buffer_end) {
1683 memcpy(buffer, s->img_buffer, n);
1684 s->img_buffer += n;
1685 return 1;
1686 } else
1687 return 0;
1688}
1689#endif
1690
1691#if defined(STBI_NO_JPEG) && defined(STBI_NO_PNG) && defined(STBI_NO_PSD) && defined(STBI_NO_PIC)

Callers 4

stbi__parse_png_fileFunction · 0.85
stbi__tga_loadFunction · 0.85
stbi__hdr_loadFunction · 0.85
stbi__pnm_loadFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected