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)

84 lines (83 loc) 2.51 kB
/** @format */ /** * Represents a point in 2D space. */ export declare class Point { /** * The x-coordinate of the point. */ private _x; /** * The y-coordinate of the point. */ private _y; /** * Gets the x-coordinate of the point. * @returns {number} The x-coordinate. */ get x(): number; /** * Gets the y-coordinate of the point. * @returns {number} The y-coordinate. */ get y(): number; /** * Gets the truncated x-coordinate of the point. * @returns {number} The truncated x-coordinate. */ get xt(): number; /** * Gets the truncated y-coordinate of the point. * @returns {number} The truncated y-coordinate. */ get yt(): number; /** * Creates an instance of Point. * @param {number} x - The x-coordinate. * @param {number} y - The y-coordinate. */ constructor(x: number, y: number); /** * Creates a new Point from an existing Point. * @param {Point} other - The existing Point. * @returns {Point} A new Point instance. */ static from(other: Point): Point; /** * Moves the point to a new location. * @param {number} x - The new x-coordinate. * @param {number} y - The new y-coordinate. * @returns {Point} A new Point instance at the new location. */ move(x: number, y: number): Point; /** * Offsets the point by the given delta values. * @param {number} dx - The delta x value. * @param {number} dy - The delta y value. * @returns {Point} A new Point instance at the offset location. */ offset(dx: number, dy: number): Point; /** * Multiplies the coordinates of the point by a given factor. * @param {number} n - The factor to multiply by. * @returns {Point} A new Point instance with multiplied coordinates. */ mul(n: number): Point; /** * Adds the coordinates of another point to this point. * @param {Point} p - The other point. * @returns {Point} A new Point instance with added coordinates. */ add(p: Point): Point; /** * Checks if this point is equal to another point. * @param {Point} other - The other point. * @returns {boolean} True if the points are equal, otherwise false. */ equals(other: Point): boolean; /** * Returns a string representation of the point. * @returns {string} A string representing the point. */ toString(): string; }