image-in-browser
Version:
Package for encoding / decoding images, transforming images, applying filters, drawing primitives on images on the client side (no need for server Node.js)
88 lines (87 loc) • 2.33 kB
TypeScript
/** @format */
import { InputBuffer } from '../../common/input-buffer.js';
/**
* Class representing a VP8L Bit Reader.
*/
export declare class VP8LBitReader {
/**
* Input buffer for reading bits.
*/
private readonly _input;
/**
* Buffer for storing bits.
*/
private readonly _buffer;
/**
* 8-bit view of the buffer.
*/
private readonly _buffer8;
/**
* Current bit position in the buffer.
*/
private _bitPos;
/**
* Gets the current bit position.
* @returns {number} The current bit position.
*/
get bitPos(): number;
/**
* Sets the current bit position.
* @param {number} v - The new bit position.
*/
set bitPos(v: number);
/**
* Checks if end of stream is reached.
* @returns {boolean} True if end of stream is reached, otherwise false.
*/
get isEOS(): boolean;
/**
* Creates an instance of VP8LBitReader.
* @param {InputBuffer<Uint8Array>} input - The input buffer.
*/
constructor(input: InputBuffer<Uint8Array>);
/**
* If not at EOS, reload up to lBits byte-by-byte.
*/
private shiftBytes;
/**
* Return the prefetched bits, so they can be looked up.
* @returns {number} The prefetched bits.
*/
prefetchBits(): number;
/**
* Advances the read buffer by 4 bytes to make room for reading next 32 bits.
*/
fillBitWindow(): void;
/**
* Reads the specified number of bits from Read Buffer.
* @param {number} numBits - The number of bits to read.
* @returns {number} The bits read.
* @throws {LibError} If not enough data in input.
*/
readBits(numBits: number): number;
/**
* The number of bytes used for the bit buffer.
*/
private static readonly valueSize;
/**
* Maximum number of bits that can be read.
*/
private static readonly maxNumBitRead;
/**
* Number of bits prefetched.
*/
private static readonly lBits;
/**
* Minimum number of bytes needed after **fillBitWindow**.
*/
private static readonly wBits;
/**
* Number of bytes needed to store wBits bits.
*/
private static readonly log8WBits;
/**
* Bit masks for reading bits.
*/
private static readonly bitMask;
}