import { ByteVector } from "../byteVector"; import { FlacBlock } from "../flac/flacBlock"; import { ILazy } from "../interfaces"; import { IPicture, PictureType } from "../picture"; export default class XiphPicture implements IPicture, ILazy { private _rawDataSource; private _colorDepth; private _data; private _description; private _filename; private _height; private _indexedColors; private _mimeType; private _type; private _width; private constructor(); /** * Constructs and initializes a new instance by decoding and reading the contents of a raw Xiph * image structure. Intended to be used by the {@link XiphComment} class. * @param data Object containing the raw, base64 encoded Xiph image * @param isLazy Whether or not to lazily load the data. For xiph comments, this only delays * decoding the data from base64 */ static fromXiphComment(data: string, isLazy?: boolean): XiphPicture; /** * Constructs and initializes a new instance by reading the contents of the picture from a FLAC * block. Intended to be used by the {@link FlacTag} class. * @param block FLAC block containing the Xiph image. * @param isLazy Whether or not to lazily load the data. For FLAC blocks, this will chain into * the lazy loading capabilities of the block */ static fromFlacBlock(block: FlacBlock, isLazy?: boolean): XiphPicture; /** * Constructs and initializes a new instance by copying the properties of an {@link IPicture} * object. * @param picture Object to copy properties from. */ static fromPicture(picture: IPicture): XiphPicture; /** * Gets the color depth of the picture in the current instance. */ get colorDepth(): number; /** * Sets the color depth of the picture in the current instance. * @param value Color depth of the picture. Must be a positive 32-bit integer */ set colorDepth(value: number); /** @inheritDoc */ get data(): ByteVector; /** @inheritDoc */ set data(value: ByteVector); /** @inheritDoc */ get description(): string; /** @inheritDoc */ set description(value: string); /** * @inheritDoc * @remarks * This value is not stored in a XIPH picture and is only available if copied from * another picture. */ get filename(): string; /** * @inheritDoc * @remarks This value is not stored in a XIPH picture so setting it has no impact. */ set filename(value: string); /** * Gets the height of the picture in the current instance in pixels. */ get height(): number; /** * Sets the height of the picture in the current instance. * @param value height of the picture in pixels, must be a positive 32-bit integer. */ set height(value: number); /** * Gets the number of indexed colors in the picture represented by the current instance. */ get indexedColors(): number; /** * Sets the number of indexed colors in the picture represented by the current instance. * @param value Number of indexed colors in the pictures or `0` if the picture is not stored in * an indexed format. Must be a positive 32-bit integer */ set indexedColors(value: number); /** @inheritDoc */ get isLoaded(): boolean; /** @inheritDoc */ get mimeType(): string; /** @inheritDoc */ set mimeType(value: string); /** @inheritDoc */ get type(): PictureType; /** @inheritDoc */ set type(value: PictureType); /** * Gets the width of the picture in the current instance in pixels. */ get width(): number; /** * Sets the width of the picture in the current instance. * @param value Width of the picture in pixels, must be positive 32-bit integer. */ set width(value: number); /** @inheritDoc */ load(): void; /** * Renders the picture for use in a FLAC block. */ renderForFlacBlock(): ByteVector; /** * Renders the picture for use in a XIPH comment block (ie, the same structure as a FLAC block, * but base64 encoded). */ renderForXiphComment(): string; }