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)

42 lines (41 loc) 1.47 kB
/** @format */ import { InputBuffer } from '../../common/input-buffer.js'; /** * Represents the header of a BMP file. */ export declare class BmpFileHeader { /** * Signature for BMP files: 'BM' */ static readonly signature = 19778; private readonly _fileLength; /** * Gets the length of the file. */ get fileLength(): number; private _imageOffset; /** * Sets the offset of the image data in the file. * @param {number} v - The offset value. */ set imageOffset(v: number); /** * Gets the offset of the image data in the file. * @returns {number} The offset of the image data in the file. */ get imageOffset(): number; /** * Constructs a BmpFileHeader instance from the given input buffer. * @param {InputBuffer<Uint8Array>} b - The input buffer containing the BMP file data. * @throws {LibError} If the buffer does not represent a valid BMP file. */ constructor(b: InputBuffer<Uint8Array>); /** * Checks if the given input buffer represents a valid BMP file. * @param {InputBuffer<Uint8Array>} b - The input buffer to check. * @param {number} b.length - The length of the buffer. * @param {function(): number} b.readUint16 - Reads a 16-bit unsigned integer from the buffer. * @returns {boolean} True if the buffer is a valid BMP file, false otherwise. */ static isValidFile(b: InputBuffer<Uint8Array>): boolean; }