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)
42 lines (41 loc) • 1.54 kB
TypeScript
/** @format */
import { HuffmanCode } from './webp-huffman-code.js';
/**
* Represents a list of Huffman codes with offset support for efficient access and manipulation.
*/
export declare class HuffmanCodeList {
/** Internal array of Huffman codes */
private _htree;
/** Offset for logical start of the list */
private _offset;
/** Returns the number of codes in the list, considering the offset */
get length(): number;
/**
* Creates a new HuffmanCodeList.
* @param htree Array of Huffman codes
* @param offset Logical offset in the array
*/
constructor(htree: HuffmanCode[], offset?: number);
/**
* Creates a HuffmanCodeList of a given size, filled with new HuffmanCode instances.
* @param size Number of codes to generate
*/
static sized(size: number): HuffmanCodeList;
/**
* Creates a new HuffmanCodeList from another list, applying an additional offset.
* @param other Source HuffmanCodeList
* @param offset Additional offset to apply
*/
static from(other: HuffmanCodeList, offset: number): HuffmanCodeList;
/**
* Gets the HuffmanCode at the specified index, considering the offset.
* @param index Index relative to the logical start
*/
get(index: number): HuffmanCode;
/**
* Sets the HuffmanCode at the specified index, copying bits and value.
* @param index Index relative to the logical start
* @param code HuffmanCode to copy from
*/
set(index: number, code: HuffmanCode): void;
}