MCPcopy Index your code
hub / github.com/cifertech/DisplayKit / getCachedOledImage

Function getCachedOledImage

app.js:3452–3464  ·  view source on GitHub ↗
(src)

Source from the content-addressed store, hash-verified

3450const _oledTextCtx = _oledTextCanvas.getContext("2d", { willReadFrequently: true });
3451
3452function getCachedOledImage(src) {
3453 const key = String(src || "");
3454 if (!key) return null;
3455 if (_oledImageCache.has(key)) return _oledImageCache.get(key);
3456 const img = new Image();
3457 img.crossOrigin = "anonymous";
3458 img.onload = () => {
3459 try { renderElements(); } catch (_) {}
3460 };
3461 img.src = key;
3462 _oledImageCache.set(key, img);
3463 return img;
3464}
3465
3466function drawOledIconAlphaMask(ctx, src, x, y, w, h, color) {
3467 const img = getCachedOledImage(src);

Callers 2

drawOledIconAlphaMaskFunction · 0.85
drawOledThresholdedImageFunction · 0.85

Calls 1

renderElementsFunction · 0.85

Tested by

no test coverage detected