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)

81 lines (80 loc) 3 kB
/** @format */ import { InputBuffer } from '../../common/input-buffer.js'; import { OutputBuffer } from '../../common/output-buffer.js'; import { IfdValue } from './ifd-value.js'; import { IfdValueType } from '../ifd-value-type.js'; /** * Class representing an IFD (Image File Directory) value that stores an offset to another IFD. * This is typically used for tags that point to sub-IFDs or linked directories within EXIF/TIFF metadata. */ export declare class IfdIfdValue extends IfdValue { /** * The offset value pointing to another IFD. */ private _offset; /** * Gets the type of the IFD value. * @returns {IfdValueType} The type of the IFD value. */ get type(): IfdValueType; /** * Gets the length of the IFD value. * Always returns 1, as IFD offsets are single 32-bit values. * @returns {number} The length of the IFD value. */ get length(): number; /** * Constructs an IfdIfdValue instance. * @param {number} value - The offset value pointing to another IFD. */ constructor(value: number); /** * Creates an IfdIfdValue from input buffer data. * Reads a 32-bit unsigned integer as the offset. * @param {InputBuffer<Uint8Array>} data - The input buffer containing the offset data. * @returns {IfdIfdValue} The created IfdIfdValue instance. */ static data(data: InputBuffer<Uint8Array>): IfdIfdValue; /** * Gets the offset value as an integer. * Only index 0 is valid, as there is always a single offset. * @param {number} [index=0] - The index of the value to retrieve. * @returns {number} The offset value. * @throws {LibError} If index is not 0. */ toInt(index?: number): number; /** * Converts the offset value to a Uint8Array (big-endian order). * @returns {Uint8Array} The offset value as a Uint8Array. */ toData(): Uint8Array; /** * Writes the offset value to an output buffer as a 32-bit unsigned integer. * @param {OutputBuffer} out - The output buffer to write to. */ write(out: OutputBuffer): void; /** * Sets the offset value. * Only index 0 is valid, as there is always a single offset. * @param {number} v - The new offset value. * @param {number} [index=0] - The index to set (must be 0). * @throws {LibError} If index is not 0. */ setInt(v: number, index?: number): void; /** * Checks if this value is equal to another IFD value. * @param {IfdValue} other - The other IFD value to compare with. * @returns {boolean} True if the values are equal, false otherwise. */ equals(other: IfdValue): boolean; /** * Creates a clone of this IFD value. * @returns {IfdValue} The cloned IFD value. */ clone(): IfdValue; /** * Converts the IFD value to a string representation. * @returns {string} The string representation of the IFD value. */ toString(): string; }