MCPcopy Create free account
hub / github.com/LazarSoft/jsqrcode / AlignmentPattern

Function AlignmentPattern

src/alignpat.js:26–63  ·  view source on GitHub ↗
(posX, posY,  estimatedModuleSize)

Source from the content-addressed store, hash-verified

24
25
26function AlignmentPattern(posX, posY, estimatedModuleSize)
27{
28 this.x=posX;
29 this.y=posY;
30 this.count = 1;
31 this.estimatedModuleSize = estimatedModuleSize;
32
33 this.__defineGetter__("EstimatedModuleSize", function()
34 {
35 return this.estimatedModuleSize;
36 });
37 this.__defineGetter__("Count", function()
38 {
39 return this.count;
40 });
41 this.__defineGetter__("X", function()
42 {
43 return Math.floor(this.x);
44 });
45 this.__defineGetter__("Y", function()
46 {
47 return Math.floor(this.y);
48 });
49 this.incrementCount = function()
50 {
51 this.count++;
52 }
53 this.aboutEquals=function( moduleSize, i, j)
54 {
55 if (Math.abs(i - this.y) <= moduleSize && Math.abs(j - this.x) <= moduleSize)
56 {
57 var moduleSizeDiff = Math.abs(moduleSize - this.estimatedModuleSize);
58 return moduleSizeDiff <= 1.0 || moduleSizeDiff / this.estimatedModuleSize <= 1.0;
59 }
60 return false;
61 }
62
63}
64
65function AlignmentPatternFinder( image, startX, startY, width, height, moduleSize, resultPointCallback)
66{

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected