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)
51 lines • 1.58 kB
JavaScript
export class PsdBlendingRanges {
get grayBlackSrc() {
return this._grayBlackSrc;
}
get grayWhiteSrc() {
return this._grayWhiteSrc;
}
get grayBlackDst() {
return this._grayBlackDst;
}
get grayWhiteDst() {
return this._grayWhiteDst;
}
get blackSrc() {
return this._blackSrc;
}
get whiteSrc() {
return this._whiteSrc;
}
get blackDst() {
return this._blackDst;
}
get whiteDst() {
return this._whiteDst;
}
constructor(input) {
this._grayBlackSrc = 0;
this._grayWhiteSrc = 0;
this._grayBlackDst = 0;
this._grayWhiteDst = 0;
this._grayBlackSrc = input.readUint16();
this._grayWhiteSrc = input.readUint16();
this._grayBlackDst = input.readUint16();
this._grayWhiteDst = input.readUint16();
const len = input.length;
const numChannels = Math.trunc(len / 8);
if (numChannels > 0) {
this._blackSrc = new Uint16Array(numChannels);
this._whiteSrc = new Uint16Array(numChannels);
this._blackDst = new Uint16Array(numChannels);
this._whiteDst = new Uint16Array(numChannels);
for (let i = 0; i < numChannels; ++i) {
this._blackSrc[i] = input.readUint16();
this._whiteSrc[i] = input.readUint16();
this._blackDst[i] = input.readUint16();
this._whiteDst[i] = input.readUint16();
}
}
}
}
//# sourceMappingURL=psd-blending-ranges.js.map