Skip to content

DaYeSquad/lerc2-js

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

38 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Lerc2-js - Read Lerc2 v3 in javascript

What is LERC?

LERC is an open-source image or raster format which supports rapid encoding and decoding for any pixel type (not just RGB or Byte) designed by esri.

Why this project?

The original project just provides Lerc2 encoder and Lerc1 decoder(js), so I migrate its C++ implementation(part of) to TypeScript.

How to use

Run 'npm install' to install dependencies and 'gulp' to build them all. On back end, the script is below: On front end, the demo in demo folder shows an example which uses Canvas to display the result.

    var Lerc2Decoder = require('../lib/src/lercdecoder2').Lerc2Decoder;
    var fs = require("fs");

    var lercData = fs.readFileSync("data/test_const_image.lerc");
    var arrayBuffer = new Uint8Array(lercData).buffer;
    var lerc2Decoder = new Lerc2Decoder(arrayBuffer);
    var result = lerc2Decoder.parse();
    // do something with result.pixelData

Test

Run mocha to test.

Runtime

Node v6.4.0

About

Esri lerc2 format javascript reader.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages