MCPcopy Create free account
hub / github.com/HugoSmits86/nativewebp / writeBitStreamHeader

Function writeBitStreamHeader

writer.go:313–326  ·  view source on GitHub ↗
(w *bitWriter, bounds image.Rectangle, hasAlpha bool)

Source from the content-addressed store, hash-verified

311}
312
313func writeBitStreamHeader(w *bitWriter, bounds image.Rectangle, hasAlpha bool) {
314 w.writeBits(0x2f, 8)
315
316 w.writeBits(uint64(bounds.Dx() - 1), 14)
317 w.writeBits(uint64(bounds.Dy() - 1), 14)
318
319 if hasAlpha {
320 w.writeBits(1, 1)
321 } else {
322 w.writeBits(0, 1)
323 }
324
325 w.writeBits(0, 3)
326}
327
328func writeBitStreamData(w *bitWriter, img image.Image, colorBits, histoBits, transBits int, transforms [4]bool) error {
329 pixels, err := flatten(img)

Callers 2

TestWriteBitStreamHeaderFunction · 0.85
writeBitStreamFunction · 0.85

Calls 1

writeBitsMethod · 0.80

Tested by 1

TestWriteBitStreamHeaderFunction · 0.68

Used in the wild real call sites across dependent graphs

searching dependent graphs…