class

CrImage::JPEG::BitWriter

Inherits Reference / Object

BitWriter for writing bits to an IO stream Handles JPEG byte stuffing (0xFF -> 0xFF 0x00)

Constructors

new(io : IO)
Source

Instance methods

flush

Flush remaining bits to the stream with padding Pads with 1s as per JPEG spec

Source
write_bit(bit : UInt8) : Nil

Write a single bit to the stream

Source
write_bits(value : UInt16, n : Number) : Nil

Write n bits from value to the stream n must be between 1 and 16

Source