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)
146 lines (145 loc) • 3.94 kB
TypeScript
/** @format */
import { InputBuffer } from '../../common/input-buffer.js';
import { MemoryImage } from '../../image/image.js';
import { PsdEffect } from './effect/psd-effect.js';
import { PsdLayerData } from './layer-data/psd-layer-data.js';
import { PsdBlendingRanges } from './psd-blending-ranges.js';
import { PsdChannel } from './psd-channel.js';
import { PsdImage } from './psd-image.js';
import { PsdMask } from './psd-mask.js';
/**
* Represents a layer in a PSD file.
*/
export declare class PsdLayer {
/**
* The signature for PSD layers.
*/
static readonly signature: number;
private _top;
/**
* Gets the top position of the layer.
*/
get top(): number | undefined;
private _left;
/**
* Gets the left position of the layer.
*/
get left(): number | undefined;
private _bottom;
/**
* Gets the bottom position of the layer.
*/
get bottom(): number;
private _right;
/**
* Gets the right position of the layer.
*/
get right(): number;
private _width;
/**
* Gets the width of the layer.
*/
get width(): number;
private _height;
/**
* Gets the height of the layer.
*/
get height(): number;
private _blendMode;
/**
* Gets the blend mode of the layer.
*/
get blendMode(): number;
private _opacity;
/**
* Gets the opacity of the layer.
*/
get opacity(): number;
private _clipping;
/**
* Gets the clipping value of the layer.
*/
get clipping(): number | undefined;
private _flags;
/**
* Gets the flags of the layer.
*/
get flags(): number;
private _compression;
/**
* Gets the compression value of the layer.
*/
get compression(): number | undefined;
private _name;
/**
* Gets the name of the layer.
*/
get name(): string | undefined;
private _channels;
/**
* Gets the channels of the layer.
*/
get channels(): PsdChannel[];
private _mask;
/**
* Gets the mask of the layer.
*/
get mask(): PsdMask | undefined;
private _blendingRanges;
/**
* Gets the blending ranges of the layer.
*/
get blendingRanges(): PsdBlendingRanges | undefined;
private _additionalData;
/**
* Gets the additional data of the layer.
*/
get additionalData(): Map<string, PsdLayerData>;
private _children;
/**
* Gets the children layers.
*/
get children(): PsdLayer[];
private _parent;
/**
* Gets the parent layer.
*/
get parent(): PsdLayer | undefined;
private _layerImage;
/**
* Gets the image of the layer.
*/
get layerImage(): MemoryImage | undefined;
private _effects;
/**
* Gets the effects applied to the layer.
*/
get effects(): PsdEffect[];
/**
* Checks if the layer is visible.
*/
get isVisible(): boolean;
/**
* Checks if the layer is a folder.
*/
get type(): number;
/**
* Initializes a new instance of the PsdLayer class.
* @param {InputBuffer<Uint8Array>} input - The input buffer to read the layer data from.
* @throws {LibError} If the PSD layer signature is invalid.
* @throws {LibError} If the PSD layer data is invalid.
*/
constructor(input: InputBuffer<Uint8Array>);
/**
* Gets the channel for the given id.
* @param {number} id - The id of the channel.
* @returns {PsdChannel | undefined} The channel with the given id, or undefined if not found.
*/
getChannel(id: number): PsdChannel | undefined;
/**
* Reads the image data for the layer.
* @param {InputBuffer<Uint8Array>} input - The input buffer to read the image data from.
* @param {PsdImage} psd - The PSD image containing the layer.
*/
readImageData(input: InputBuffer<Uint8Array>, psd: PsdImage): void;
}