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)
66 lines (65 loc) • 2.21 kB
TypeScript
/**
* Class representing the physical pixel dimensions of a PNG image.
*
* @format
*/
export declare class PngPhysicalPixelDimensions {
/**
* Conversion factor from meters to inches.
*/
private static readonly _inchesPerM;
/**
* Unit specifier for unknown units.
*/
static readonly unitUnknown: number;
/**
* Unit specifier for meters.
*/
static readonly unitMeter: number;
/**
* Pixels per unit on the X axis.
*/
private _xPxPerUnit;
/**
* Gets the pixels per unit on the X axis.
* @returns {number} Pixels per unit on the X axis.
*/
get xPxPerUnit(): number;
/**
* Pixels per unit on the Y axis.
*/
private _yPxPerUnit;
/**
* Gets the pixels per unit on the Y axis.
*/
get yPxPerUnit(): number;
/**
* Unit specifier, either `unitUnknown` or `unitMeter`.
*/
private _unitSpecifier;
/**
* Gets the unit specifier.
*/
get unitSpecifier(): number;
/**
* Constructs a dimension descriptor with the given values.
* @param {number} xPxPerUnit - Pixels per unit on the X axis.
* @param {number} yPxPerUnit - Pixels per unit on the Y axis.
* @param {number} unitSpecifier - Unit specifier, either `unitUnknown` or `unitMeter`.
*/
constructor(xPxPerUnit: number, yPxPerUnit: number, unitSpecifier: number);
/**
* Constructs a dimension descriptor specifying x and y resolution in dots per inch (DPI).
* If `dpiY` is unspecified, `dpiX` is used for both x and y axes.
* @param {number} dpiX - Dots per inch on the X axis.
* @param {number} [dpiY] - Dots per inch on the Y axis.
* @returns {PngPhysicalPixelDimensions} A new instance of `PngPhysicalPixelDimensions`.
*/
static fromDPI(dpiX: number, dpiY?: number): PngPhysicalPixelDimensions;
/**
* Checks if this instance is equal to another `PngPhysicalPixelDimensions` instance.
* @param {PngPhysicalPixelDimensions} other - The other instance to compare with.
* @returns {boolean} `true` if the instances are equal, `false` otherwise.
*/
equals(other: PngPhysicalPixelDimensions): boolean;
}