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)

76 lines (75 loc) 2.71 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 a byte value in an IFD (Image File Directory). */ export declare class IfdByteValue extends IfdValue { /** * The byte value stored as a Uint8Array. */ private _value; /** * Gets the type of the IFD value. * @returns {IfdValueType} The type of the IFD value. */ get type(): IfdValueType; /** * Gets the length of the byte value. * @returns {number} The length of the byte value. */ get length(): number; /** * Creates an instance of IfdByteValue. * @param {Uint8Array | number} value - The byte value or a number to initialize the byte value. */ constructor(value: Uint8Array | number); /** * Creates an IfdByteValue from input buffer data. * @param {InputBuffer<Uint8Array>} data - The input buffer containing the data. * @param {number} [offset] - The offset to start reading from. * @param {number} [length] - The length of data to read. * @returns {IfdByteValue} The created IfdByteValue instance. */ static data(data: InputBuffer<Uint8Array>, offset?: number, length?: number): IfdByteValue; /** * Converts the byte value to an integer. * @param {number} [index=0] - The index of the byte to convert. * @returns {number} The integer representation of the byte. */ toInt(index?: number): number; /** * Converts the byte value to a Uint8Array. * @returns {Uint8Array} The byte value as a Uint8Array. */ toData(): Uint8Array; /** * Writes the byte value to an output buffer. * @param {OutputBuffer} out - The output buffer to write to. */ write(out: OutputBuffer): void; /** * Sets the byte value at a specific index. * @param {number} v - The value to set. * @param {number} [index=0] - The index to set the value at. */ setInt(v: number, index?: number): void; /** * Checks if this byte 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 byte value. * @returns {IfdValue} The cloned byte value. */ clone(): IfdValue; /** * Converts the byte value to a string representation. * @returns {string} The string representation of the byte value. */ toString(): string; }