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)
60 lines • 1.48 kB
JavaScript
export class PsdMask {
get top() {
return this._top;
}
get left() {
return this._left;
}
get right() {
return this._right;
}
get bottom() {
return this._bottom;
}
get defaultColor() {
return this._defaultColor;
}
get flags() {
return this._flags;
}
get params() {
return this._params;
}
get relative() {
return (this._flags & 1) !== 0;
}
get disabled() {
return (this._flags & 2) !== 0;
}
get invert() {
return (this._flags & 4) !== 0;
}
constructor(input) {
this._top = 0;
this._left = 0;
this._right = 0;
this._bottom = 0;
this._defaultColor = 0;
this._flags = 0;
this._params = 0;
const len = input.length;
this._top = input.readUint32();
this._left = input.readUint32();
this._right = input.readUint32();
this._bottom = input.readUint32();
this._defaultColor = input.read();
this._flags = input.read();
if (len === 20) {
input.skip(2);
}
else {
this._flags = input.read();
this._defaultColor = input.read();
this._top = input.readUint32();
this._left = input.readUint32();
this._right = input.readUint32();
this._bottom = input.readUint32();
}
}
}
//# sourceMappingURL=psd-mask.js.map