MCPcopy
hub / github.com/davidshimjs/qrcodejs / QRCodeModel

Function QRCodeModel

qrcode.js:78–85  ·  view source on GitHub ↗
(typeNumber, errorCorrectLevel)

Source from the content-addressed store, hash-verified

76 };
77
78 function QRCodeModel(typeNumber, errorCorrectLevel) {
79 this.typeNumber = typeNumber;
80 this.errorCorrectLevel = errorCorrectLevel;
81 this.modules = null;
82 this.moduleCount = 0;
83 this.dataCache = null;
84 this.dataList = [];
85 }
86
87 QRCodeModel.prototype={addData:function(data){var newData=new QR8bitByte(data);this.dataList.push(newData);this.dataCache=null;},isDark:function(row,col){if(row<0||this.moduleCount<=row||col<0||this.moduleCount<=col){throw new Error(row+","+col);}
88 return this.modules[row][col];},getModuleCount:function(){return this.moduleCount;},make:function(){this.makeImpl(false,this.getBestMaskPattern());},makeImpl:function(test,maskPattern){this.moduleCount=this.typeNumber*4+17;this.modules=new Array(this.moduleCount);for(var row=0;row<this.moduleCount;row++){this.modules[row]=new Array(this.moduleCount);for(var col=0;col<this.moduleCount;col++){this.modules[row][col]=null;}}

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected