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)

284 lines (283 loc) 8.45 kB
/** @format */ import { Channel } from '../color/channel.js'; import { Color, ColorConvertOptions } from '../color/color.js'; import { Format } from '../color/format.js'; import { MemoryImageData } from './image-data.js'; import { Palette } from './palette.js'; import { Pixel } from './pixel.js'; /** * Represents an invalid pixel. */ export declare class PixelUndefined implements Pixel, Iterable<Pixel>, Iterator<Pixel> { /** * A static readonly property representing null image data. */ private static readonly _nullImageData; /** * Gets the image data. * @returns {MemoryImageData} The image data. */ get image(): MemoryImageData; /** * Checks if the pixel is valid. * @returns {boolean} Always returns false. */ get isValid(): boolean; /** * Gets the width of the pixel. * @returns {number} Always returns 0. */ get width(): number; /** * Gets the height of the pixel. * @returns {number} Always returns 0. */ get height(): number; /** * Gets the x-coordinate of the pixel. * @returns {number} Always returns 0. */ get x(): number; /** * Gets the y-coordinate of the pixel. * @returns {number} Always returns 0. */ get y(): number; /** * Gets the normalized x-coordinate of the pixel. * @returns {number} Always returns 0. */ get xNormalized(): number; /** * Gets the normalized y-coordinate of the pixel. * @returns {number} Always returns 0. */ get yNormalized(): number; /** * Gets the length of the pixel. * @returns {number} Always returns 0. */ get length(): number; /** * Gets the maximum channel value. * @returns {number} Always returns 0. */ get maxChannelValue(): number; /** * Gets the maximum index value. * @returns {number} Always returns 0. */ get maxIndexValue(): number; /** * Gets the format of the pixel. * @returns {Format} Always returns Format.uint8. */ get format(): Format; /** * Checks if the format is LDR. * @returns {boolean} Always returns false. */ get isLdrFormat(): boolean; /** * Checks if the format is HDR. * @returns {boolean} Always returns false. */ get isHdrFormat(): boolean; /** * Checks if the pixel has a palette. * @returns {boolean} Always returns false. */ get hasPalette(): boolean; /** * Gets the palette of the pixel. * @returns {Palette | undefined} Always returns undefined. */ get palette(): Palette | undefined; /** * Gets the index of the pixel. * @returns {number} Always returns 0. */ get index(): number; /** * Sets the index of the pixel. * @param {number} _i - The index to set. */ set index(_i: number); /** * Gets the red channel value. * @returns {number} Always returns 0. */ get r(): number; /** * Sets the red channel value. * @param {number} _r - The red channel value to set. */ set r(_r: number); /** * Gets the green channel value. * @returns {number} Always returns 0. */ get g(): number; /** * Sets the green channel value. * @param {number} _g - The green channel value to set. */ set g(_g: number); /** * Gets the blue channel value. * @returns {number} Always returns 0. */ get b(): number; /** * Sets the blue channel value. * @param {number} _b - The blue channel value to set. */ set b(_b: number); /** * Gets the alpha channel value. * @returns {number} Always returns 0. */ get a(): number; /** * Sets the alpha channel value. * @param {number} _a - The alpha channel value to set. */ set a(_a: number); /** * Gets the normalized red channel value. * @returns {number} Always returns 0. */ get rNormalized(): number; /** * Sets the normalized red channel value. * @param {number} _v - The normalized red channel value to set. */ set rNormalized(_v: number); /** * Gets the normalized green channel value. * @returns {number} Always returns 0. */ get gNormalized(): number; /** * Sets the normalized green channel value. * @param {number} _v - The normalized green channel value to set. */ set gNormalized(_v: number); /** * Gets the normalized blue channel value. * @returns {number} Always returns 0. */ get bNormalized(): number; /** * Sets the normalized blue channel value. * @param {number} _v - The normalized blue channel value to set. */ set bNormalized(_v: number); /** * Gets the normalized alpha channel value. * @returns {number} Always returns 0. */ get aNormalized(): number; /** * Sets the normalized alpha channel value. * @param {number} _v - The normalized alpha channel value to set. */ set aNormalized(_v: number); /** * Gets the luminance value. * @returns {number} Always returns 0. */ get luminance(): number; /** * Gets the normalized luminance value. * @returns {number} Always returns 0. */ get luminanceNormalized(): number; /** * Gets the value of the specified channel. * @param {number} _channel - The channel to get the value of. * @returns {number} Always returns 0. */ getChannel(_channel: number): number; /** * Gets the normalized value of the specified channel. * @param {Channel} _channel - The channel to get the normalized value of. * @returns {number} Always returns 0. */ getChannelNormalized(_channel: Channel): number; /** * Sets the value of the specified channel. * @param {number} _channel - The channel to set the value of. * @param {number} _value - The value to set. */ setChannel(_channel: number, _value: number): void; /** * Sets the color of the pixel. * @param {Color} _color - The color to set. */ set(_color: Color): void; /** * Sets the RGB values of the pixel. * @param {number} _r - The red value to set. * @param {number} _g - The green value to set. * @param {number} _b - The blue value to set. */ setRgb(_r: number, _g: number, _b: number): void; /** * Sets the RGBA values of the pixel. * @param {number} _r - The red value to set. * @param {number} _g - The green value to set. * @param {number} _b - The blue value to set. * @param {number} _a - The alpha value to set. */ setRgba(_r: number, _g: number, _b: number, _a: number): void; /** * Clones the pixel. * @returns {Color} A new PixelUndefined instance. */ clone(): Color; /** * Converts the pixel to another format. * @param {ColorConvertOptions} _options - The conversion options. * @returns {Color} The converted color. */ convert(_options: ColorConvertOptions): Color; /** * Sets the position of the pixel. * @param {number} _x - The x-coordinate to set. * @param {number} _y - The y-coordinate to set. */ setPosition(_x: number, _y: number): void; /** * Sets the normalized position of the pixel. * @param {number} _x - The normalized x-coordinate to set. * @param {number} _y - The normalized y-coordinate to set. */ setPositionNormalized(_x: number, _y: number): void; /** * Checks if the pixel is equal to another pixel. * @param {Pixel} other - The other pixel to compare. * @returns {boolean} True if the other pixel is an instance of PixelUndefined, false otherwise. */ equals(other: Pixel): boolean; /** * Gets the next iterator result. * @returns {IteratorResult<Pixel>} The next iterator result. */ next(): IteratorResult<Pixel>; /** * Converts the pixel to an array. * @returns {number[]} An empty array. */ toArray(): number[]; /** * Converts the pixel to a string. * @returns {string} A string representation of the pixel. */ toString(): string; /** * Gets the iterator for the pixel. * @returns {Iterator<Pixel>} The iterator. */ [Symbol.iterator](): Iterator<Pixel>; }