Edit File by line

Deprecated: str_replace(): Passing null to parameter #2 ($replace) of type array|string is deprecated in /home/sportsfever/public_html/filemanger/function.php on line 93

Warning: Undefined array key "page_file_edit_line" in /home/sportsfever/public_html/filemanger/edit_text_line.php on line 32
/home/sportsfe.../httpdocs/clone/wp-conte.../plugins/embedpre.../assets/pdf/build
File: pdf.worker.js
}
[31000] Fix | Delete
}
[31001] Fix | Delete
class LocalImageCache extends BaseLocalCache {
[31002] Fix | Delete
set(name, ref = null, data) {
[31003] Fix | Delete
if (typeof name !== "string") {
[31004] Fix | Delete
throw new Error('LocalImageCache.set - expected "name" argument.');
[31005] Fix | Delete
}
[31006] Fix | Delete
if (ref) {
[31007] Fix | Delete
if (this._imageCache.has(ref)) {
[31008] Fix | Delete
return;
[31009] Fix | Delete
}
[31010] Fix | Delete
this._nameRefMap.set(name, ref);
[31011] Fix | Delete
this._imageCache.put(ref, data);
[31012] Fix | Delete
return;
[31013] Fix | Delete
}
[31014] Fix | Delete
if (this._imageMap.has(name)) {
[31015] Fix | Delete
return;
[31016] Fix | Delete
}
[31017] Fix | Delete
this._imageMap.set(name, data);
[31018] Fix | Delete
}
[31019] Fix | Delete
}
[31020] Fix | Delete
class LocalColorSpaceCache extends BaseLocalCache {
[31021] Fix | Delete
set(name = null, ref = null, data) {
[31022] Fix | Delete
if (typeof name !== "string" && !ref) {
[31023] Fix | Delete
throw new Error('LocalColorSpaceCache.set - expected "name" and/or "ref" argument.');
[31024] Fix | Delete
}
[31025] Fix | Delete
if (ref) {
[31026] Fix | Delete
if (this._imageCache.has(ref)) {
[31027] Fix | Delete
return;
[31028] Fix | Delete
}
[31029] Fix | Delete
if (name !== null) {
[31030] Fix | Delete
this._nameRefMap.set(name, ref);
[31031] Fix | Delete
}
[31032] Fix | Delete
this._imageCache.put(ref, data);
[31033] Fix | Delete
return;
[31034] Fix | Delete
}
[31035] Fix | Delete
if (this._imageMap.has(name)) {
[31036] Fix | Delete
return;
[31037] Fix | Delete
}
[31038] Fix | Delete
this._imageMap.set(name, data);
[31039] Fix | Delete
}
[31040] Fix | Delete
}
[31041] Fix | Delete
class LocalFunctionCache extends BaseLocalCache {
[31042] Fix | Delete
constructor(options) {
[31043] Fix | Delete
super({
[31044] Fix | Delete
onlyRefs: true
[31045] Fix | Delete
});
[31046] Fix | Delete
}
[31047] Fix | Delete
set(name = null, ref, data) {
[31048] Fix | Delete
if (!ref) {
[31049] Fix | Delete
throw new Error('LocalFunctionCache.set - expected "ref" argument.');
[31050] Fix | Delete
}
[31051] Fix | Delete
if (this._imageCache.has(ref)) {
[31052] Fix | Delete
return;
[31053] Fix | Delete
}
[31054] Fix | Delete
this._imageCache.put(ref, data);
[31055] Fix | Delete
}
[31056] Fix | Delete
}
[31057] Fix | Delete
class LocalGStateCache extends BaseLocalCache {
[31058] Fix | Delete
set(name, ref = null, data) {
[31059] Fix | Delete
if (typeof name !== "string") {
[31060] Fix | Delete
throw new Error('LocalGStateCache.set - expected "name" argument.');
[31061] Fix | Delete
}
[31062] Fix | Delete
if (ref) {
[31063] Fix | Delete
if (this._imageCache.has(ref)) {
[31064] Fix | Delete
return;
[31065] Fix | Delete
}
[31066] Fix | Delete
this._nameRefMap.set(name, ref);
[31067] Fix | Delete
this._imageCache.put(ref, data);
[31068] Fix | Delete
return;
[31069] Fix | Delete
}
[31070] Fix | Delete
if (this._imageMap.has(name)) {
[31071] Fix | Delete
return;
[31072] Fix | Delete
}
[31073] Fix | Delete
this._imageMap.set(name, data);
[31074] Fix | Delete
}
[31075] Fix | Delete
}
[31076] Fix | Delete
class LocalTilingPatternCache extends BaseLocalCache {
[31077] Fix | Delete
constructor(options) {
[31078] Fix | Delete
super({
[31079] Fix | Delete
onlyRefs: true
[31080] Fix | Delete
});
[31081] Fix | Delete
}
[31082] Fix | Delete
set(name = null, ref, data) {
[31083] Fix | Delete
if (!ref) {
[31084] Fix | Delete
throw new Error('LocalTilingPatternCache.set - expected "ref" argument.');
[31085] Fix | Delete
}
[31086] Fix | Delete
if (this._imageCache.has(ref)) {
[31087] Fix | Delete
return;
[31088] Fix | Delete
}
[31089] Fix | Delete
this._imageCache.put(ref, data);
[31090] Fix | Delete
}
[31091] Fix | Delete
}
[31092] Fix | Delete
class RegionalImageCache extends BaseLocalCache {
[31093] Fix | Delete
constructor(options) {
[31094] Fix | Delete
super({
[31095] Fix | Delete
onlyRefs: true
[31096] Fix | Delete
});
[31097] Fix | Delete
}
[31098] Fix | Delete
set(name = null, ref, data) {
[31099] Fix | Delete
if (!ref) {
[31100] Fix | Delete
throw new Error('RegionalImageCache.set - expected "ref" argument.');
[31101] Fix | Delete
}
[31102] Fix | Delete
if (this._imageCache.has(ref)) {
[31103] Fix | Delete
return;
[31104] Fix | Delete
}
[31105] Fix | Delete
this._imageCache.put(ref, data);
[31106] Fix | Delete
}
[31107] Fix | Delete
}
[31108] Fix | Delete
class GlobalImageCache {
[31109] Fix | Delete
static NUM_PAGES_THRESHOLD = 2;
[31110] Fix | Delete
static MIN_IMAGES_TO_CACHE = 10;
[31111] Fix | Delete
static MAX_BYTE_SIZE = 5 * MAX_IMAGE_SIZE_TO_CACHE;
[31112] Fix | Delete
#decodeFailedSet = new RefSet();
[31113] Fix | Delete
constructor() {
[31114] Fix | Delete
this._refCache = new RefSetCache();
[31115] Fix | Delete
this._imageCache = new RefSetCache();
[31116] Fix | Delete
}
[31117] Fix | Delete
get #byteSize() {
[31118] Fix | Delete
let byteSize = 0;
[31119] Fix | Delete
for (const imageData of this._imageCache) {
[31120] Fix | Delete
byteSize += imageData.byteSize;
[31121] Fix | Delete
}
[31122] Fix | Delete
return byteSize;
[31123] Fix | Delete
}
[31124] Fix | Delete
get #cacheLimitReached() {
[31125] Fix | Delete
if (this._imageCache.size < GlobalImageCache.MIN_IMAGES_TO_CACHE) {
[31126] Fix | Delete
return false;
[31127] Fix | Delete
}
[31128] Fix | Delete
if (this.#byteSize < GlobalImageCache.MAX_BYTE_SIZE) {
[31129] Fix | Delete
return false;
[31130] Fix | Delete
}
[31131] Fix | Delete
return true;
[31132] Fix | Delete
}
[31133] Fix | Delete
shouldCache(ref, pageIndex) {
[31134] Fix | Delete
let pageIndexSet = this._refCache.get(ref);
[31135] Fix | Delete
if (!pageIndexSet) {
[31136] Fix | Delete
pageIndexSet = new Set();
[31137] Fix | Delete
this._refCache.put(ref, pageIndexSet);
[31138] Fix | Delete
}
[31139] Fix | Delete
pageIndexSet.add(pageIndex);
[31140] Fix | Delete
if (pageIndexSet.size < GlobalImageCache.NUM_PAGES_THRESHOLD) {
[31141] Fix | Delete
return false;
[31142] Fix | Delete
}
[31143] Fix | Delete
if (!this._imageCache.has(ref) && this.#cacheLimitReached) {
[31144] Fix | Delete
return false;
[31145] Fix | Delete
}
[31146] Fix | Delete
return true;
[31147] Fix | Delete
}
[31148] Fix | Delete
addDecodeFailed(ref) {
[31149] Fix | Delete
this.#decodeFailedSet.put(ref);
[31150] Fix | Delete
}
[31151] Fix | Delete
hasDecodeFailed(ref) {
[31152] Fix | Delete
return this.#decodeFailedSet.has(ref);
[31153] Fix | Delete
}
[31154] Fix | Delete
addByteSize(ref, byteSize) {
[31155] Fix | Delete
const imageData = this._imageCache.get(ref);
[31156] Fix | Delete
if (!imageData) {
[31157] Fix | Delete
return;
[31158] Fix | Delete
}
[31159] Fix | Delete
if (imageData.byteSize) {
[31160] Fix | Delete
return;
[31161] Fix | Delete
}
[31162] Fix | Delete
imageData.byteSize = byteSize;
[31163] Fix | Delete
}
[31164] Fix | Delete
getData(ref, pageIndex) {
[31165] Fix | Delete
const pageIndexSet = this._refCache.get(ref);
[31166] Fix | Delete
if (!pageIndexSet) {
[31167] Fix | Delete
return null;
[31168] Fix | Delete
}
[31169] Fix | Delete
if (pageIndexSet.size < GlobalImageCache.NUM_PAGES_THRESHOLD) {
[31170] Fix | Delete
return null;
[31171] Fix | Delete
}
[31172] Fix | Delete
const imageData = this._imageCache.get(ref);
[31173] Fix | Delete
if (!imageData) {
[31174] Fix | Delete
return null;
[31175] Fix | Delete
}
[31176] Fix | Delete
pageIndexSet.add(pageIndex);
[31177] Fix | Delete
return imageData;
[31178] Fix | Delete
}
[31179] Fix | Delete
setData(ref, data) {
[31180] Fix | Delete
if (!this._refCache.has(ref)) {
[31181] Fix | Delete
throw new Error('GlobalImageCache.setData - expected "shouldCache" to have been called.');
[31182] Fix | Delete
}
[31183] Fix | Delete
if (this._imageCache.has(ref)) {
[31184] Fix | Delete
return;
[31185] Fix | Delete
}
[31186] Fix | Delete
if (this.#cacheLimitReached) {
[31187] Fix | Delete
warn("GlobalImageCache.setData - cache limit reached.");
[31188] Fix | Delete
return;
[31189] Fix | Delete
}
[31190] Fix | Delete
this._imageCache.put(ref, data);
[31191] Fix | Delete
}
[31192] Fix | Delete
clear(onlyData = false) {
[31193] Fix | Delete
if (!onlyData) {
[31194] Fix | Delete
this.#decodeFailedSet.clear();
[31195] Fix | Delete
this._refCache.clear();
[31196] Fix | Delete
}
[31197] Fix | Delete
this._imageCache.clear();
[31198] Fix | Delete
}
[31199] Fix | Delete
}
[31200] Fix | Delete
[31201] Fix | Delete
;// CONCATENATED MODULE: ./src/core/function.js
[31202] Fix | Delete
[31203] Fix | Delete
[31204] Fix | Delete
[31205] Fix | Delete
[31206] Fix | Delete
[31207] Fix | Delete
[31208] Fix | Delete
[31209] Fix | Delete
[31210] Fix | Delete
[31211] Fix | Delete
[31212] Fix | Delete
[31213] Fix | Delete
[31214] Fix | Delete
[31215] Fix | Delete
[31216] Fix | Delete
class PDFFunctionFactory {
[31217] Fix | Delete
constructor({
[31218] Fix | Delete
xref,
[31219] Fix | Delete
isEvalSupported = true
[31220] Fix | Delete
}) {
[31221] Fix | Delete
this.xref = xref;
[31222] Fix | Delete
this.isEvalSupported = isEvalSupported !== false;
[31223] Fix | Delete
}
[31224] Fix | Delete
create(fn) {
[31225] Fix | Delete
const cachedFunction = this.getCached(fn);
[31226] Fix | Delete
if (cachedFunction) {
[31227] Fix | Delete
return cachedFunction;
[31228] Fix | Delete
}
[31229] Fix | Delete
const parsedFunction = PDFFunction.parse({
[31230] Fix | Delete
xref: this.xref,
[31231] Fix | Delete
isEvalSupported: this.isEvalSupported,
[31232] Fix | Delete
fn: fn instanceof Ref ? this.xref.fetch(fn) : fn
[31233] Fix | Delete
});
[31234] Fix | Delete
this._cache(fn, parsedFunction);
[31235] Fix | Delete
return parsedFunction;
[31236] Fix | Delete
}
[31237] Fix | Delete
createFromArray(fnObj) {
[31238] Fix | Delete
const cachedFunction = this.getCached(fnObj);
[31239] Fix | Delete
if (cachedFunction) {
[31240] Fix | Delete
return cachedFunction;
[31241] Fix | Delete
}
[31242] Fix | Delete
const parsedFunction = PDFFunction.parseArray({
[31243] Fix | Delete
xref: this.xref,
[31244] Fix | Delete
isEvalSupported: this.isEvalSupported,
[31245] Fix | Delete
fnObj: fnObj instanceof Ref ? this.xref.fetch(fnObj) : fnObj
[31246] Fix | Delete
});
[31247] Fix | Delete
this._cache(fnObj, parsedFunction);
[31248] Fix | Delete
return parsedFunction;
[31249] Fix | Delete
}
[31250] Fix | Delete
getCached(cacheKey) {
[31251] Fix | Delete
let fnRef;
[31252] Fix | Delete
if (cacheKey instanceof Ref) {
[31253] Fix | Delete
fnRef = cacheKey;
[31254] Fix | Delete
} else if (cacheKey instanceof Dict) {
[31255] Fix | Delete
fnRef = cacheKey.objId;
[31256] Fix | Delete
} else if (cacheKey instanceof BaseStream) {
[31257] Fix | Delete
fnRef = cacheKey.dict?.objId;
[31258] Fix | Delete
}
[31259] Fix | Delete
if (fnRef) {
[31260] Fix | Delete
const localFunction = this._localFunctionCache.getByRef(fnRef);
[31261] Fix | Delete
if (localFunction) {
[31262] Fix | Delete
return localFunction;
[31263] Fix | Delete
}
[31264] Fix | Delete
}
[31265] Fix | Delete
return null;
[31266] Fix | Delete
}
[31267] Fix | Delete
_cache(cacheKey, parsedFunction) {
[31268] Fix | Delete
if (!parsedFunction) {
[31269] Fix | Delete
throw new Error('PDFFunctionFactory._cache - expected "parsedFunction" argument.');
[31270] Fix | Delete
}
[31271] Fix | Delete
let fnRef;
[31272] Fix | Delete
if (cacheKey instanceof Ref) {
[31273] Fix | Delete
fnRef = cacheKey;
[31274] Fix | Delete
} else if (cacheKey instanceof Dict) {
[31275] Fix | Delete
fnRef = cacheKey.objId;
[31276] Fix | Delete
} else if (cacheKey instanceof BaseStream) {
[31277] Fix | Delete
fnRef = cacheKey.dict?.objId;
[31278] Fix | Delete
}
[31279] Fix | Delete
if (fnRef) {
[31280] Fix | Delete
this._localFunctionCache.set(null, fnRef, parsedFunction);
[31281] Fix | Delete
}
[31282] Fix | Delete
}
[31283] Fix | Delete
get _localFunctionCache() {
[31284] Fix | Delete
return shadow(this, "_localFunctionCache", new LocalFunctionCache());
[31285] Fix | Delete
}
[31286] Fix | Delete
}
[31287] Fix | Delete
function toNumberArray(arr) {
[31288] Fix | Delete
if (!Array.isArray(arr)) {
[31289] Fix | Delete
return null;
[31290] Fix | Delete
}
[31291] Fix | Delete
if (!isNumberArray(arr, null)) {
[31292] Fix | Delete
return arr.map(x => +x);
[31293] Fix | Delete
}
[31294] Fix | Delete
return arr;
[31295] Fix | Delete
}
[31296] Fix | Delete
class PDFFunction {
[31297] Fix | Delete
static getSampleArray(size, outputSize, bps, stream) {
[31298] Fix | Delete
let i, ii;
[31299] Fix | Delete
let length = 1;
[31300] Fix | Delete
for (i = 0, ii = size.length; i < ii; i++) {
[31301] Fix | Delete
length *= size[i];
[31302] Fix | Delete
}
[31303] Fix | Delete
length *= outputSize;
[31304] Fix | Delete
const array = new Array(length);
[31305] Fix | Delete
let codeSize = 0;
[31306] Fix | Delete
let codeBuf = 0;
[31307] Fix | Delete
const sampleMul = 1.0 / (2.0 ** bps - 1);
[31308] Fix | Delete
const strBytes = stream.getBytes((length * bps + 7) / 8);
[31309] Fix | Delete
let strIdx = 0;
[31310] Fix | Delete
for (i = 0; i < length; i++) {
[31311] Fix | Delete
while (codeSize < bps) {
[31312] Fix | Delete
codeBuf <<= 8;
[31313] Fix | Delete
codeBuf |= strBytes[strIdx++];
[31314] Fix | Delete
codeSize += 8;
[31315] Fix | Delete
}
[31316] Fix | Delete
codeSize -= bps;
[31317] Fix | Delete
array[i] = (codeBuf >> codeSize) * sampleMul;
[31318] Fix | Delete
codeBuf &= (1 << codeSize) - 1;
[31319] Fix | Delete
}
[31320] Fix | Delete
return array;
[31321] Fix | Delete
}
[31322] Fix | Delete
static parse({
[31323] Fix | Delete
xref,
[31324] Fix | Delete
isEvalSupported,
[31325] Fix | Delete
fn
[31326] Fix | Delete
}) {
[31327] Fix | Delete
const dict = fn.dict || fn;
[31328] Fix | Delete
const typeNum = dict.get("FunctionType");
[31329] Fix | Delete
switch (typeNum) {
[31330] Fix | Delete
case 0:
[31331] Fix | Delete
return this.constructSampled({
[31332] Fix | Delete
xref,
[31333] Fix | Delete
isEvalSupported,
[31334] Fix | Delete
fn,
[31335] Fix | Delete
dict
[31336] Fix | Delete
});
[31337] Fix | Delete
case 1:
[31338] Fix | Delete
break;
[31339] Fix | Delete
case 2:
[31340] Fix | Delete
return this.constructInterpolated({
[31341] Fix | Delete
xref,
[31342] Fix | Delete
isEvalSupported,
[31343] Fix | Delete
dict
[31344] Fix | Delete
});
[31345] Fix | Delete
case 3:
[31346] Fix | Delete
return this.constructStiched({
[31347] Fix | Delete
xref,
[31348] Fix | Delete
isEvalSupported,
[31349] Fix | Delete
dict
[31350] Fix | Delete
});
[31351] Fix | Delete
case 4:
[31352] Fix | Delete
return this.constructPostScript({
[31353] Fix | Delete
xref,
[31354] Fix | Delete
isEvalSupported,
[31355] Fix | Delete
fn,
[31356] Fix | Delete
dict
[31357] Fix | Delete
});
[31358] Fix | Delete
}
[31359] Fix | Delete
throw new FormatError("Unknown type of function");
[31360] Fix | Delete
}
[31361] Fix | Delete
static parseArray({
[31362] Fix | Delete
xref,
[31363] Fix | Delete
isEvalSupported,
[31364] Fix | Delete
fnObj
[31365] Fix | Delete
}) {
[31366] Fix | Delete
if (!Array.isArray(fnObj)) {
[31367] Fix | Delete
return this.parse({
[31368] Fix | Delete
xref,
[31369] Fix | Delete
isEvalSupported,
[31370] Fix | Delete
fn: fnObj
[31371] Fix | Delete
});
[31372] Fix | Delete
}
[31373] Fix | Delete
const fnArray = [];
[31374] Fix | Delete
for (const fn of fnObj) {
[31375] Fix | Delete
fnArray.push(this.parse({
[31376] Fix | Delete
xref,
[31377] Fix | Delete
isEvalSupported,
[31378] Fix | Delete
fn: xref.fetchIfRef(fn)
[31379] Fix | Delete
}));
[31380] Fix | Delete
}
[31381] Fix | Delete
return function (src, srcOffset, dest, destOffset) {
[31382] Fix | Delete
for (let i = 0, ii = fnArray.length; i < ii; i++) {
[31383] Fix | Delete
fnArray[i](src, srcOffset, dest, destOffset + i);
[31384] Fix | Delete
}
[31385] Fix | Delete
};
[31386] Fix | Delete
}
[31387] Fix | Delete
static constructSampled({
[31388] Fix | Delete
xref,
[31389] Fix | Delete
isEvalSupported,
[31390] Fix | Delete
fn,
[31391] Fix | Delete
dict
[31392] Fix | Delete
}) {
[31393] Fix | Delete
function toMultiArray(arr) {
[31394] Fix | Delete
const inputLength = arr.length;
[31395] Fix | Delete
const out = [];
[31396] Fix | Delete
let index = 0;
[31397] Fix | Delete
for (let i = 0; i < inputLength; i += 2) {
[31398] Fix | Delete
out[index++] = [arr[i], arr[i + 1]];
[31399] Fix | Delete
}
[31400] Fix | Delete
return out;
[31401] Fix | Delete
}
[31402] Fix | Delete
function interpolate(x, xmin, xmax, ymin, ymax) {
[31403] Fix | Delete
return ymin + (x - xmin) * ((ymax - ymin) / (xmax - xmin));
[31404] Fix | Delete
}
[31405] Fix | Delete
let domain = toNumberArray(dict.getArray("Domain"));
[31406] Fix | Delete
let range = toNumberArray(dict.getArray("Range"));
[31407] Fix | Delete
if (!domain || !range) {
[31408] Fix | Delete
throw new FormatError("No domain or range");
[31409] Fix | Delete
}
[31410] Fix | Delete
const inputSize = domain.length / 2;
[31411] Fix | Delete
const outputSize = range.length / 2;
[31412] Fix | Delete
domain = toMultiArray(domain);
[31413] Fix | Delete
range = toMultiArray(range);
[31414] Fix | Delete
const size = toNumberArray(dict.getArray("Size"));
[31415] Fix | Delete
const bps = dict.get("BitsPerSample");
[31416] Fix | Delete
const order = dict.get("Order") || 1;
[31417] Fix | Delete
if (order !== 1) {
[31418] Fix | Delete
info("No support for cubic spline interpolation: " + order);
[31419] Fix | Delete
}
[31420] Fix | Delete
let encode = toNumberArray(dict.getArray("Encode"));
[31421] Fix | Delete
if (!encode) {
[31422] Fix | Delete
encode = [];
[31423] Fix | Delete
for (let i = 0; i < inputSize; ++i) {
[31424] Fix | Delete
encode.push([0, size[i] - 1]);
[31425] Fix | Delete
}
[31426] Fix | Delete
} else {
[31427] Fix | Delete
encode = toMultiArray(encode);
[31428] Fix | Delete
}
[31429] Fix | Delete
let decode = toNumberArray(dict.getArray("Decode"));
[31430] Fix | Delete
decode = !decode ? range : toMultiArray(decode);
[31431] Fix | Delete
const samples = this.getSampleArray(size, outputSize, bps, fn);
[31432] Fix | Delete
return function constructSampledFn(src, srcOffset, dest, destOffset) {
[31433] Fix | Delete
const cubeVertices = 1 << inputSize;
[31434] Fix | Delete
const cubeN = new Float64Array(cubeVertices);
[31435] Fix | Delete
const cubeVertex = new Uint32Array(cubeVertices);
[31436] Fix | Delete
let i, j;
[31437] Fix | Delete
for (j = 0; j < cubeVertices; j++) {
[31438] Fix | Delete
cubeN[j] = 1;
[31439] Fix | Delete
}
[31440] Fix | Delete
let k = outputSize,
[31441] Fix | Delete
pos = 1;
[31442] Fix | Delete
for (i = 0; i < inputSize; ++i) {
[31443] Fix | Delete
const domain_2i = domain[i][0];
[31444] Fix | Delete
const domain_2i_1 = domain[i][1];
[31445] Fix | Delete
const xi = Math.min(Math.max(src[srcOffset + i], domain_2i), domain_2i_1);
[31446] Fix | Delete
let e = interpolate(xi, domain_2i, domain_2i_1, encode[i][0], encode[i][1]);
[31447] Fix | Delete
const size_i = size[i];
[31448] Fix | Delete
e = Math.min(Math.max(e, 0), size_i - 1);
[31449] Fix | Delete
const e0 = e < size_i - 1 ? Math.floor(e) : e - 1;
[31450] Fix | Delete
const n0 = e0 + 1 - e;
[31451] Fix | Delete
const n1 = e - e0;
[31452] Fix | Delete
const offset0 = e0 * k;
[31453] Fix | Delete
const offset1 = offset0 + k;
[31454] Fix | Delete
for (j = 0; j < cubeVertices; j++) {
[31455] Fix | Delete
if (j & pos) {
[31456] Fix | Delete
cubeN[j] *= n1;
[31457] Fix | Delete
cubeVertex[j] += offset1;
[31458] Fix | Delete
} else {
[31459] Fix | Delete
cubeN[j] *= n0;
[31460] Fix | Delete
cubeVertex[j] += offset0;
[31461] Fix | Delete
}
[31462] Fix | Delete
}
[31463] Fix | Delete
k *= size_i;
[31464] Fix | Delete
pos <<= 1;
[31465] Fix | Delete
}
[31466] Fix | Delete
for (j = 0; j < outputSize; ++j) {
[31467] Fix | Delete
let rj = 0;
[31468] Fix | Delete
for (i = 0; i < cubeVertices; i++) {
[31469] Fix | Delete
rj += samples[cubeVertex[i] + j] * cubeN[i];
[31470] Fix | Delete
}
[31471] Fix | Delete
rj = interpolate(rj, 0, 1, decode[j][0], decode[j][1]);
[31472] Fix | Delete
dest[destOffset + j] = Math.min(Math.max(rj, range[j][0]), range[j][1]);
[31473] Fix | Delete
}
[31474] Fix | Delete
};
[31475] Fix | Delete
}
[31476] Fix | Delete
static constructInterpolated({
[31477] Fix | Delete
xref,
[31478] Fix | Delete
isEvalSupported,
[31479] Fix | Delete
dict
[31480] Fix | Delete
}) {
[31481] Fix | Delete
const c0 = toNumberArray(dict.getArray("C0")) || [0];
[31482] Fix | Delete
const c1 = toNumberArray(dict.getArray("C1")) || [1];
[31483] Fix | Delete
const n = dict.get("N");
[31484] Fix | Delete
const diff = [];
[31485] Fix | Delete
for (let i = 0, ii = c0.length; i < ii; ++i) {
[31486] Fix | Delete
diff.push(c1[i] - c0[i]);
[31487] Fix | Delete
}
[31488] Fix | Delete
const length = diff.length;
[31489] Fix | Delete
return function constructInterpolatedFn(src, srcOffset, dest, destOffset) {
[31490] Fix | Delete
const x = n === 1 ? src[srcOffset] : src[srcOffset] ** n;
[31491] Fix | Delete
for (let j = 0; j < length; ++j) {
[31492] Fix | Delete
dest[destOffset + j] = c0[j] + x * diff[j];
[31493] Fix | Delete
}
[31494] Fix | Delete
};
[31495] Fix | Delete
}
[31496] Fix | Delete
static constructStiched({
[31497] Fix | Delete
xref,
[31498] Fix | Delete
isEvalSupported,
[31499] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function