(posX, posY, estimatedModuleSize)
| 24 | |
| 25 | |
| 26 | function 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 | |
| 65 | function AlignmentPatternFinder( image, startX, startY, width, height, moduleSize, resultPointCallback) |
| 66 | { |
nothing calls this directly
no outgoing calls
no test coverage detected