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) • 2.91 kB
TypeScript
/** @format */
import { PvrColorRgbCore } from './pvr-color-rgb-core.js';
/**
* Class representing an RGB color.
*/
export declare class PvrColorRgb implements PvrColorRgbCore<PvrColorRgb> {
/**
* Red component of the color.
* @private
*/
private _r;
/**
* Gets the red component of the color.
* @returns {number} The red component.
*/
get r(): number;
/**
* Green component of the color.
* @private
*/
private _g;
/**
* Gets the green component of the color.
* @returns {number} The green component.
*/
get g(): number;
/**
* Blue component of the color.
* @private
*/
private _b;
/**
* Gets the blue component of the color.
* @returns {number} The blue component.
*/
get b(): number;
/**
* Creates an instance of PvrColorRgb.
* @param {number} [r=0] - The red component.
* @param {number} [g=0] - The green component.
* @param {number} [b=0] - The blue component.
*/
constructor(r?: number, g?: number, b?: number);
/**
* Creates a new PvrColorRgb instance from another instance.
* @param {PvrColorRgb} other - The other PvrColorRgb instance.
* @returns {PvrColorRgb} A new PvrColorRgb instance.
*/
static from(other: PvrColorRgb): PvrColorRgb;
/**
* Creates a copy of the current PvrColorRgb instance.
* @returns {PvrColorRgb} A new PvrColorRgb instance.
*/
copy(): PvrColorRgb;
/**
* Sets the minimum RGB values between the current instance and another instance.
* @param {PvrColorRgb} c - The other PvrColorRgb instance.
*/
setMin(c: PvrColorRgb): void;
/**
* Sets the maximum RGB values between the current instance and another instance.
* @param {PvrColorRgb} c - The other PvrColorRgb instance.
*/
setMax(c: PvrColorRgb): void;
/**
* Multiplies the RGB values by a scalar.
* @param {number} x - The scalar value.
* @returns {PvrColorRgb} A new PvrColorRgb instance with multiplied values.
*/
mul(x: number): PvrColorRgb;
/**
* Adds the RGB values of another instance to the current instance.
* @param {PvrColorRgb} x - The other PvrColorRgb instance.
* @returns {PvrColorRgb} A new PvrColorRgb instance with added values.
*/
add(x: PvrColorRgb): PvrColorRgb;
/**
* Subtracts the RGB values of another instance from the current instance.
* @param {PvrColorRgb} x - The other PvrColorRgb instance.
* @returns {PvrColorRgb} A new PvrColorRgb instance with subtracted values.
*/
sub(x: PvrColorRgb): PvrColorRgb;
/**
* Calculates the dot product of the current instance and another instance.
* @param {PvrColorRgb} x - The other PvrColorRgb instance.
* @returns {number} The dot product.
*/
dotProd(x: PvrColorRgb): number;
}