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)

139 lines (138 loc) 5.63 kB
/** @format */ import { Color } from '../../color/color.js'; import { DecodeInfo } from '../decode-info.js'; import { PngColorType } from './png-color-type.js'; import { PngFrame } from './png-frame.js'; import { PngPhysicalPixelDimensions } from './png-physical-pixel-dimensions.js'; /** * Interface for initializing PNG information options. */ export interface PngInfoInitOptions { /** Width of the PNG image. */ width?: number; /** Height of the PNG image. */ height?: number; /** Bit depth of the PNG image. */ bits?: number; /** Color type of the PNG image. */ colorType?: number; /** Compression method used in the PNG image. */ compressionMethod?: number; /** Filter method used in the PNG image. */ filterMethod?: number; /** Interlace method used in the PNG image. */ interlaceMethod?: number; } /** * Class representing PNG information. */ export declare class PngInfo implements DecodeInfo { private _width; /** Gets the width of the PNG image. */ get width(): number; /** Sets the width of the PNG image. */ set width(v: number); private _height; /** Sets the height of the PNG image. */ set height(v: number); /** Gets the height of the PNG image. */ get height(): number; private _backgroundColor; /** Gets the background color of the PNG image. */ get backgroundColor(): Color | undefined; /** Sets the background color of the PNG image. */ set backgroundColor(v: Color | undefined); private _numFrames; /** Gets the number of frames in the PNG image. */ get numFrames(): number; /** Sets the number of frames in the PNG image. */ set numFrames(v: number); private _bits; /** Gets the bit depth of the PNG image. */ get bits(): number; /** Sets the bit depth of the PNG image. */ set bits(v: number); private _colorType; /** Gets the color type of the PNG image. */ get colorType(): PngColorType | undefined; /** Sets the color type of the PNG image. */ set colorType(v: PngColorType | undefined); private _compressionMethod; /** Gets the compression method of the PNG image. */ get compressionMethod(): number; /** Sets the compression method of the PNG image. */ set compressionMethod(v: number); private _filterMethod; /** Gets the filter method of the PNG image. */ get filterMethod(): number; /** Sets the filter method of the PNG image. */ set filterMethod(v: number); private _interlaceMethod; /** Gets the interlace method of the PNG image. */ get interlaceMethod(): number; /** Sets the interlace method of the PNG image. */ set interlaceMethod(v: number); private _palette?; /** Gets the palette of the PNG image. */ get palette(): Uint8Array | undefined; /** Sets the palette of the PNG image. */ set palette(v: Uint8Array | undefined); private _transparency?; /** Gets the transparency data of the PNG image. */ get transparency(): Uint8Array | undefined; /** Sets the transparency data of the PNG image. */ set transparency(v: Uint8Array | undefined); private _gamma?; /** Gets the gamma value of the PNG image. */ get gamma(): number | undefined; /** Sets the gamma value of the PNG image. */ set gamma(v: number | undefined); private _iccpName; /** Gets the ICC profile name of the PNG image. */ get iccpName(): string; /** Sets the ICC profile name of the PNG image. */ set iccpName(v: string); private _iccpCompression; /** Gets the ICC profile compression method of the PNG image. */ get iccpCompression(): number; /** Sets the ICC profile compression method of the PNG image. */ set iccpCompression(v: number); private _iccpData?; /** Gets the ICC profile data of the PNG image. */ get iccpData(): Uint8Array | undefined; /** Sets the ICC profile data of the PNG image. */ set iccpData(v: Uint8Array | undefined); private _textData; /** Gets the text data of the PNG image. */ get textData(): Map<string, string>; private _pixelDimensions; /** Gets the physical pixel dimensions of the PNG image. */ get pixelDimensions(): PngPhysicalPixelDimensions | undefined; /** Sets the physical pixel dimensions of the PNG image. */ set pixelDimensions(v: PngPhysicalPixelDimensions | undefined); private _repeat; /** Gets the repeat count of the PNG image. */ get repeat(): number; /** Sets the repeat count of the PNG image. */ set repeat(v: number); private readonly _idat; /** Gets the IDAT chunk data of the PNG image. */ get idat(): number[]; private readonly _frames; /** Gets the frames of the PNG image. */ get frames(): PngFrame[]; /** Checks if the PNG image is animated. */ get isAnimated(): boolean; /** * Initializes a new instance of the PngInfo class. * @param {PngInfoInitOptions} [opt] - Options for initializing the PNG information. * @param {number} [opt.width] - The width of the PNG image. * @param {number} [opt.height] - The height of the PNG image. * @param {number} [opt.bits] - The bit depth of the PNG image. * @param {number} [opt.colorType] - The color type of the PNG image. * @param {number} [opt.compressionMethod] - The compression method used for the PNG image. * @param {number} [opt.filterMethod] - The filter method used for the PNG image. * @param {number} [opt.interlaceMethod] - The interlace method used for the PNG image. */ constructor(opt?: PngInfoInitOptions); }