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)
90 lines (89 loc) • 3.48 kB
TypeScript
/** @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';
import { Rational } from '../../common/rational.js';
/**
* Class representing a rational value in an IFD (Image File Directory).
*/
export declare class IfdRationalValue extends IfdValue {
/**
* Array of Rational values.
*/
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 rational value array.
* @returns {number} The length of the array.
*/
get length(): number;
/**
* Constructs an IfdRationalValue instance.
* @param {Rational[] | Rational} value - The rational value(s).
*/
constructor(value: Rational[] | Rational);
/**
* Creates an IfdRationalValue from input buffer data.
* @param {InputBuffer<Uint8Array>} data - The input buffer containing the data.
* @param {number} length - The number of rational values to read.
* @returns {IfdRationalValue} The created IfdRationalValue instance.
*/
static data(data: InputBuffer<Uint8Array>, length: number): IfdRationalValue;
/**
* Creates an IfdRationalValue from another Rational instance.
* @param {Rational} other - The other Rational instance.
* @returns {IfdRationalValue} The created IfdRationalValue instance.
*/
static from(other: Rational): IfdRationalValue;
/**
* Converts the rational value at the specified index to an integer.
* @param {number} [index=0] - The index of the rational value.
* @returns {number} The integer representation of the rational value.
*/
toInt(index?: number): number;
/**
* Converts the rational value at the specified index to a double.
* @param {number} [index=0] - The index of the rational value.
* @returns {number} The double representation of the rational value.
*/
toDouble(index?: number): number;
/**
* Gets the rational value at the specified index.
* @param {number} [index=0] - The index of the rational value.
* @returns {Rational} The rational value.
*/
toRational(index?: number): Rational;
/**
* Writes the rational values to the output buffer.
* @param {OutputBuffer} out - The output buffer.
*/
write(out: OutputBuffer): void;
/**
* Sets the rational value at the specified index.
* @param {number} numerator - The numerator of the rational value.
* @param {number} denominator - The denominator of the rational value.
* @param {number} [index=0] - The index to set the rational value at.
*/
setRational(numerator: number, denominator: number, index?: number): void;
/**
* Checks if this IfdRationalValue is equal to another IfdValue.
* @param {IfdValue} other - The other IfdValue to compare with.
* @returns {boolean} True if equal, otherwise false.
*/
equals(other: IfdValue): boolean;
/**
* Clones this IfdRationalValue.
* @returns {IfdValue} The cloned IfdRationalValue.
*/
clone(): IfdValue;
/**
* Converts this IfdRationalValue to a string representation.
* @returns {string} The string representation of this IfdRationalValue.
*/
toString(): string;
}