MCPcopy Create free account
hub / github.com/Tencent/libpag / ReadImageInfo

Function ReadImageInfo

src/codec/utils/WebpDecoder.cpp:349–357  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

347}
348
349static int ReadImageInfo(VP8LBitReader* const br, int* const width, int* const height,
350 int* const has_alpha) {
351 if (VP8LReadBits(br, 8) != VP8L_MAGIC_BYTE) return 0;
352 *width = VP8LReadBits(br, VP8L_IMAGE_SIZE_BITS) + 1;
353 *height = VP8LReadBits(br, VP8L_IMAGE_SIZE_BITS) + 1;
354 *has_alpha = VP8LReadBits(br, 1);
355 if (VP8LReadBits(br, VP8L_VERSION_BITS) != 0) return 0;
356 return !br->eos_;
357}
358
359int VP8LGetInfo(const uint8_t* data, size_t data_size, int* const width, int* const height,
360 int* const has_alpha) {

Callers 1

VP8LGetInfoFunction · 0.85

Calls 1

VP8LReadBitsFunction · 0.85

Tested by

no test coverage detected