UNPKG

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)

40 lines (39 loc) 1.51 kB
/** @format */ import { HuffmanCodeList } from './webp-huffman-code-list.js'; import { HuffmanCode32 } from './webp-huffman-code-32.js'; import { VP8LBitReader } from './vp8l-bit-reader.js'; /** * Represents a group of Huffman trees used for decoding WebP lossless images. * Manages Huffman tables and provides symbol reading functionality. */ export declare class HuffmanTreeGroup { /** Huffman trees for each meta code. */ readonly htrees: HuffmanCodeList[]; /** Packed Huffman tables for fast decoding. */ readonly packedTable: HuffmanCode32[]; /** Indicates if the literal code is trivial (single symbol). */ isTrivialLiteral: boolean; /** Stores the value of the trivial literal if present. */ literalArb: number; /** Indicates if the code is trivial (single symbol). */ isTrivialCode: boolean; /** Enables use of packed tables for decoding. */ usePackedTable: boolean; private static readonly _huffmanTableBits; private static readonly _huffmanTableMask; /** * Initializes Huffman trees and packed tables. */ constructor(); /** * Returns the HuffmanCodeList at the specified index. * @param index Index of the Huffman tree. */ get(index: number): HuffmanCodeList; /** * Reads a symbol from the specified Huffman table using the bit reader. * @param table Index of the Huffman table. * @param br Bit reader for input data. */ readSymbol(table: number, br: VP8LBitReader): number; }