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)
38 lines • 1.2 kB
JavaScript
import { LibError } from '../../../error/lib-error.js';
import { PsdLayerData } from './psd-layer-data.js';
export class PsdLayerSectionDivider extends PsdLayerData {
get type() {
return this._type;
}
get key() {
return this._key;
}
get subType() {
return this._subType;
}
constructor(tag, data) {
super(tag);
this._type = 0;
this._subType = PsdLayerSectionDivider.subTypeNormal;
const len = data.length;
this._type = data.readUint32();
if (len >= 12) {
const sig = data.readString(4);
if (sig !== '8BIM') {
throw new LibError('Invalid key in layer additional data');
}
this._key = data.readString(4);
}
if (len >= 16) {
this._subType = data.readUint32();
}
}
}
PsdLayerSectionDivider.tagName = 'lsct';
PsdLayerSectionDivider.normal = 0;
PsdLayerSectionDivider.openFolder = 1;
PsdLayerSectionDivider.closedFolder = 2;
PsdLayerSectionDivider.sectionDivider = 3;
PsdLayerSectionDivider.subTypeNormal = 0;
PsdLayerSectionDivider.subTypeGroup = 1;
//# sourceMappingURL=psd-layer-section-divider.js.map