MCPcopy Create free account
hub / github.com/Moddable-OpenSource/moddable / decompress

Function decompress

modules/commodetto/commodettoLoadJPEG.js:25–39  ·  view source on GitHub ↗
(data, dictionary)

Source from the content-addressed store, hash-verified

23import BufferOut from "commodetto/BufferOut";
24
25export default function decompress(data, dictionary) {
26 let jpeg = new JPEG(data, dictionary);
27
28 let offscreen = new BufferOut({width: jpeg.width, height: jpeg.height, pixelFormat: jpeg.bitmap.pixelFormat});
29 let render = new Poco(offscreen);
30
31 while (jpeg.ready) {
32 let block = jpeg.read();
33 render.begin(block.x, block.y, block.width, block.height);
34 render.drawBitmap(block, block.x, block.y);
35 render.end();
36 }
37
38 return offscreen.bitmap;
39}

Callers

nothing calls this directly

Calls 4

readMethod · 0.95
beginMethod · 0.95
endMethod · 0.95
drawBitmapMethod · 0.80

Tested by

no test coverage detected