MCPcopy Create free account
hub / github.com/MegEngine/MegEngine / stbi__hdr_gettoken

Function stbi__hdr_gettoken

lite/example/cpp_example/mge/cv/stb_image.h:7769–7788  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

7767
7768#define STBI__HDR_BUFLEN 1024
7769static char* stbi__hdr_gettoken(stbi__context* z, char* buffer) {
7770 int len = 0;
7771 char c = '\0';
7772
7773 c = (char)stbi__get8(z);
7774
7775 while (!stbi__at_eof(z) && c != '\n') {
7776 buffer[len++] = c;
7777 if (len == STBI__HDR_BUFLEN - 1) {
7778 // flush to end of line
7779 while (!stbi__at_eof(z) && stbi__get8(z) != '\n')
7780 ;
7781 break;
7782 }
7783 c = (char)stbi__get8(z);
7784 }
7785
7786 buffer[len] = 0;
7787 return buffer;
7788}
7789
7790static void stbi__hdr_convert(float* output, stbi_uc* input, int req_comp) {
7791 if (input[3] != 0) {

Callers 2

stbi__hdr_loadFunction · 0.85
stbi__hdr_infoFunction · 0.85

Calls 2

stbi__get8Function · 0.85
stbi__at_eofFunction · 0.85

Tested by

no test coverage detected