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)

47 lines (46 loc) 1.69 kB
/** @format */ import { MemoryImage } from '../../image/image.js'; import { JpegData } from './jpeg-data.js'; /** * Abstract class for JPEG quantization and inverse DCT operations. */ export declare abstract class JpegQuantize { /** * Offset for DCT clipping. */ private static readonly _dctClipOffset; /** * Length for DCT clipping. */ private static readonly _dctClipLength; /** * DCT clipping array. */ private static readonly _dctClip; /** * Creates the DCT clipping array. * @returns {Uint8Array} The DCT clipping array. */ private static createDctClip; /** * Quantizes the coefficients and applies the Inverse Discrete Cosine Transform (IDCT). * * A port of poppler's IDCT method which in turn is taken from: * Christoph Loeffler, Adriaan Ligtenberg, George S. Moschytz, * "Practical Fast 1-D DCT Algorithms with 11 Multiplications", * IEEE Intl. Conf. on Acoustics, Speech & Signal Processing, 1989, 988-991. * * @param {Int16Array} quantizationTable - The quantization table. * @param {Int32Array} coefBlock - The coefficient block. * @param {Uint8Array} dataOut - The output data array. * @param {Int32Array} dataIn - The input data array. */ static quantizeAndInverse(quantizationTable: Int16Array, coefBlock: Int32Array, dataOut: Uint8Array, dataIn: Int32Array): void; /** * Converts a JPEG data object to a MemoryImage object. * * @param {JpegData} jpeg - The JPEG data object. * @returns {MemoryImage} The resulting MemoryImage object. */ static getImageFromJpeg(jpeg: JpegData): MemoryImage; }