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.27 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 signed rational IFD value.
*/
export declare class IfdSRationalValue 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 value array.
* @returns {number} The length of the value array.
*/
get length(): number;
/**
* Creates an instance of IfdSRationalValue.
* @param {Rational[] | Rational} value - The rational value(s).
*/
constructor(value: Rational[] | Rational);
/**
* Creates an IfdSRationalValue from input buffer data.
* @param {InputBuffer<Uint8Array>} data - The input buffer.
* @param {number} length - The length of the data.
* @returns {IfdSRationalValue} The created IfdSRationalValue.
*/
static data(data: InputBuffer<Uint8Array>, length: number): IfdSRationalValue;
/**
* Creates an IfdSRationalValue from another Rational.
* @param {Rational} other - The other rational value.
* @returns {IfdSRationalValue} The created IfdSRationalValue.
*/
static from(other: Rational): IfdSRationalValue;
/**
* Converts the value at the specified index to an integer.
* @param {number} [index=0] - The index of the value.
* @returns {number} The integer representation of the value.
*/
toInt(index?: number): number;
/**
* Converts the value at the specified index to a double.
* @param {number} [index=0] - The index of the value.
* @returns {number} The double representation of the value.
*/
toDouble(index?: number): number;
/**
* Gets the rational value at the specified index.
* @param {number} [index=0] - The index of the value.
* @returns {Rational} The rational value.
*/
toRational(index?: number): Rational;
/**
* Writes the value 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} denomitator - The denominator of the rational value.
* @param {number} [index=0] - The index of the value.
*/
setRational(numerator: number, denomitator: number, index?: number): void;
/**
* Checks if this value is equal to another IFD value.
* @param {IfdValue} other - The other IFD value.
* @returns {boolean} True if the values are equal, false otherwise.
*/
equals(other: IfdValue): boolean;
/**
* Clones this IFD value.
* @returns {IfdValue} The cloned IFD value.
*/
clone(): IfdValue;
/**
* Converts the value to a string representation.
* @returns {string} The string representation of the value.
*/
toString(): string;
}