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

Function stbi__get_marker

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

if there's a pending marker from the entropy stream, return that otherwise, fetch from the stream and get a marker. if there's no marker, return 0xff, which is never a valid marker value

Source from the content-addressed store, hash-verified

3126// otherwise, fetch from the stream and get a marker. if there's no
3127// marker, return 0xff, which is never a valid marker value
3128static stbi_uc stbi__get_marker(stbi__jpeg* j) {
3129 stbi_uc x;
3130 if (j->marker != STBI__MARKER_none) {
3131 x = j->marker;
3132 j->marker = STBI__MARKER_none;
3133 return x;
3134 }
3135 x = stbi__get8(j->s);
3136 if (x != 0xff)
3137 return STBI__MARKER_none;
3138 while (x == 0xff)
3139 x = stbi__get8(j->s); // consume repeated 0xff fill bytes
3140 return x;
3141}
3142
3143// in each scan, we'll have scan_n components, and the order
3144// of the components is specified by order[]

Callers 2

stbi__decode_jpeg_headerFunction · 0.85
stbi__decode_jpeg_imageFunction · 0.85

Calls 1

stbi__get8Function · 0.85

Tested by

no test coverage detected