Welis Garagen-Anzeige

This commit is contained in:
2018-02-04 20:14:45 +01:00
parent 9b4b42bdc0
commit 48d7ac9661
855 changed files with 134068 additions and 5 deletions
+534
View File
@@ -0,0 +1,534 @@
<!doctype html>
<html lang="en">
<head>
<title>Code coverage report for lib\bitmapper.js</title>
<meta charset="utf-8">
<link rel="stylesheet" href="../prettify.css">
<link rel="stylesheet" href="../base.css">
<style type='text/css'>
div.coverage-summary .sorter {
background-image: url(../sort-arrow-sprite.png);
}
</style>
</head>
<body>
<div class="header high">
<h1>Code coverage report for <span class="entity">lib\bitmapper.js</span></h1>
<h2>
Statements: <span class="metric">95.6% <small>(87 / 91)</small></span> &nbsp;&nbsp;&nbsp;&nbsp;
Branches: <span class="metric">90.32% <small>(28 / 31)</small></span> &nbsp;&nbsp;&nbsp;&nbsp;
Functions: <span class="metric">100% <small>(7 / 7)</small></span> &nbsp;&nbsp;&nbsp;&nbsp;
Lines: <span class="metric">95.6% <small>(87 / 91)</small></span> &nbsp;&nbsp;&nbsp;&nbsp;
Ignored: <span class="metric"><span class="ignore-none">none</span></span> &nbsp;&nbsp;&nbsp;&nbsp;
</h2>
<div class="path"><a href="../index.html">All files</a> &#187; <a href="index.html">lib/</a> &#187; bitmapper.js</div>
</div>
<div class="body">
<pre><table class="coverage">
<tr><td class="line-count">1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164</td><td class="line-coverage"><span class="cline-any cline-yes">1</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">1</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">217</span>
<span class="cline-any cline-yes">217</span>
<span class="cline-any cline-yes">1</span>
<span class="cline-any cline-yes">202091</span>
<span class="cline-any cline-yes">1</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">202090</span>
<span class="cline-any cline-yes">202090</span>
<span class="cline-any cline-yes">202090</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">149504</span>
<span class="cline-any cline-yes">149504</span>
<span class="cline-any cline-yes">149504</span>
<span class="cline-any cline-yes">149504</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">48460</span>
<span class="cline-any cline-yes">48460</span>
<span class="cline-any cline-yes">48460</span>
<span class="cline-any cline-yes">48460</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">2904</span>
<span class="cline-any cline-yes">2904</span>
<span class="cline-any cline-yes">2904</span>
<span class="cline-any cline-yes">2904</span>
<span class="cline-any cline-yes">2904</span>
<span class="cline-any cline-yes">2904</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">1222</span>
<span class="cline-any cline-yes">1222</span>
<span class="cline-any cline-yes">1222</span>
<span class="cline-any cline-yes">1222</span>
<span class="cline-any cline-yes">1222</span>
<span class="cline-any cline-yes">1222</span>
<span class="cline-any cline-yes">1222</span>
<span class="cline-any cline-yes">1222</span>
<span class="cline-any cline-yes">1222</span>
<span class="cline-any cline-yes">1222</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">217</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">184229</span>
<span class="cline-any cline-yes">202091</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">184228</span>
<span class="cline-any cline-yes">184228</span>
<span class="cline-any cline-yes">184228</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">7018</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">205</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">1</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">336</span>
<span class="cline-any cline-yes">217</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">336</span>
<span class="cline-any cline-yes">336</span>
<span class="cline-any cline-yes">259</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">77</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">325</span>
<span class="cline-any cline-yes">325</span>
<span class="cline-any cline-yes">325</span>
<span class="cline-any cline-yes">325</span>
<span class="cline-any cline-yes">325</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">325</span>
<span class="cline-any cline-yes">70</span>
<span class="cline-any cline-yes">70</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">255</span>
<span class="cline-any cline-yes">255</span>
<span class="cline-any cline-yes">370259</span>
<span class="cline-any cline-yes">370259</span>
<span class="cline-any cline-yes">370259</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">255</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">325</span>
<span class="cline-any cline-yes">717</span>
<span class="cline-any cline-yes">717</span>
<span class="cline-any cline-yes">717</span>
<span class="cline-any cline-yes">717</span>
<span class="cline-any cline-yes">11484</span>
<span class="cline-any cline-yes">429094</span>
<span class="cline-any cline-yes">184229</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">429093</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">429093</span>
<span class="cline-any cline-yes">1716369</span>
<span class="cline-any cline-yes">1716369</span>
<span class="cline-any cline-yes">979457</span>
<span class="cline-any cline-yes">1</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">979456</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">736912</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">429092</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">11482</span>
<span class="cline-any cline-yes">7018</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">323</span>
<span class="cline-any cline-yes">118</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">205</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">323</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">1</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span></td><td class="text"><pre class="prettyprint lang-js">var interlaceUtils = require('./interlace');
&nbsp;
function bitRetriever(data, depth) {
&nbsp;
var leftOver = [];
var i = 0;
function split() {
if (i === data.length) {
throw new Error("Ran out of data");
}
var byte = data[i];
i++;
switch(depth) {
<span class="branch-0 cbranch-no" title="branch not covered" > default:</span>
<span class="cstat-no" title="statement not covered" > throw new Error("unrecognised depth");</span>
<span class="cstat-no" title="statement not covered" > break;</span>
case 16:
var byte2 = data[i];
i++;
leftOver.push(((byte &lt;&lt; 8) + byte2));
break;
case 4:
var byte2 = byte &amp; 0x0f;
var byte1 = byte &gt;&gt; 4;
leftOver.push(byte1, byte2);
break;
case 2:
var byte4 = byte &amp; 3;
var byte3 = byte &gt;&gt; 2 &amp; 3;
var byte2 = byte &gt;&gt; 4 &amp; 3;
var byte1 = byte &gt;&gt; 6 &amp; 3;
leftOver.push(byte1, byte2, byte3, byte4);
break;
case 1:
var byte8 = byte &amp; 1;
var byte7 = byte &gt;&gt; 1 &amp; 1;
var byte6 = byte &gt;&gt; 2 &amp; 1;
var byte5 = byte &gt;&gt; 3 &amp; 1;
var byte4 = byte &gt;&gt; 4 &amp; 1;
var byte3 = byte &gt;&gt; 5 &amp; 1;
var byte2 = byte &gt;&gt; 6 &amp; 1;
var byte1 = byte &gt;&gt; 7 &amp; 1;
leftOver.push(byte1, byte2, byte3, byte4, byte5, byte6, byte7, byte8);
break;
}
}
return {
get: function(count) {
while(leftOver.length &lt; count) {
split();
}
var returner = leftOver.slice(0, count);
leftOver = leftOver.slice(count);
return returner;
},
resetAfterLine: function() {
leftOver.length = 0;
},
end: function() {
<span class="missing-if-branch" title="if path not taken" >I</span>if (i !== data.length) {
<span class="cstat-no" title="statement not covered" > throw new Error("extra data found");</span>
}
}
};
}
&nbsp;
exports.dataToBitMap = function(data, width, height, bpp, depth, interlace) {
&nbsp;
if (depth !== 8) {
var bits = bitRetriever(data, depth);
}
var pxData;
if (depth &lt;= 8) {
pxData = new Buffer(width * height * 4);
} else {
// TODO: could be more effecient and use a buffer but change how we write to use 16 bit write methods with index * 2
pxData = new Array(width * height * 4);
}
var maxBit = Math.pow(2, depth) - 1;
var rawPos = 0;
var pixelData;
var images;
var getPxPos;
&nbsp;
if (interlace) {
images = interlaceUtils.getImagePasses(width, height);
getPxPos = interlaceUtils.getInterlaceIterator(width, height);
} else {
var nonInterlacedPxPos = 0;
getPxPos = function() {
var returner = nonInterlacedPxPos;
nonInterlacedPxPos += 4;
return returner;
};
images = [{width: width, height: height}];
}
&nbsp;
for(var imageIndex = 0; imageIndex &lt; images.length; imageIndex++) {
var imageWidth = images[imageIndex].width;
var imageHeight = images[imageIndex].height;
var imagePass = images[imageIndex].index;
for (var y = 0; y &lt; imageHeight; y++) {
for (var x = 0; x &lt; imageWidth; x++) {
if (depth !== 8) {
pixelData = bits.get(bpp);
}
var pxPos = getPxPos(x, y, imagePass);
//console.log(x,y,imageIndex, pxPos);
for (var i = 0; i &lt; 4; i++) {
var idx = pixelBppMap[bpp][i];
if (depth === 8) {
if (i === data.length) {
throw new Error("Ran out of data");
}
pxData[pxPos + i] = idx !== 0xff ? data[idx + rawPos] : maxBit;
} else {
pxData[pxPos + i] = idx !== 0xff ? pixelData[idx] : maxBit;
}
}
//console.log("R", pxData[pxPos], "G", pxData[pxPos + 1], "B", pxData[pxPos + 2], "A", pxData[pxPos + 3]);
rawPos += bpp;
}
if (depth !== 8) {
bits.resetAfterLine();
}
}
}
if (depth === 8) {
<span class="missing-if-branch" title="if path not taken" >I</span>if (rawPos !== data.length) {
<span class="cstat-no" title="statement not covered" > throw new Error("extra data found");</span>
}
} else {
bits.end();
}
&nbsp;
return pxData;
};
&nbsp;
var pixelBppMap = {
1: { // L
0: 0,
1: 0,
2: 0,
3: 0xff
},
2: { // LA
0: 0,
1: 0,
2: 0,
3: 1
},
3: { // RGB
0: 0,
1: 1,
2: 2,
3: 0xff
},
4: { // RGBA
0: 0,
1: 1,
2: 2,
3: 3
}
};</pre></td></tr>
</table></pre>
</div>
<div class="footer">
<div class="meta">Generated by <a href="http://istanbul-js.org/" target="_blank">istanbul</a> at Mon Aug 03 2015 22:18:47 GMT+0100 (GMT Summer Time)</div>
</div>
<script src="../prettify.js"></script>
<script>
window.onload = function () {
if (typeof prettyPrint === 'function') {
prettyPrint();
}
};
</script>
<script src="../sorter.js"></script>
</body>
</html>
+645
View File
@@ -0,0 +1,645 @@
<!doctype html>
<html lang="en">
<head>
<title>Code coverage report for lib\chunkstream.js</title>
<meta charset="utf-8">
<link rel="stylesheet" href="../prettify.css">
<link rel="stylesheet" href="../base.css">
<style type='text/css'>
div.coverage-summary .sorter {
background-image: url(../sort-arrow-sprite.png);
}
</style>
</head>
<body>
<div class="header high">
<h1>Code coverage report for <span class="entity">lib\chunkstream.js</span></h1>
<h2>
Statements: <span class="metric">85% <small>(68 / 80)</small></span> &nbsp;&nbsp;&nbsp;&nbsp;
Branches: <span class="metric">77.27% <small>(34 / 44)</small></span> &nbsp;&nbsp;&nbsp;&nbsp;
Functions: <span class="metric">100% <small>(8 / 8)</small></span> &nbsp;&nbsp;&nbsp;&nbsp;
Lines: <span class="metric">87.01% <small>(67 / 77)</small></span> &nbsp;&nbsp;&nbsp;&nbsp;
Ignored: <span class="metric"><span class="ignore-none">none</span></span> &nbsp;&nbsp;&nbsp;&nbsp;
</h2>
<div class="path"><a href="../index.html">All files</a> &#187; <a href="index.html">lib/</a> &#187; chunkstream.js</div>
</div>
<div class="body">
<pre><table class="coverage">
<tr><td class="line-count">1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201</td><td class="line-coverage"><span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">1</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">1</span>
<span class="cline-any cline-yes">500</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">500</span>
<span class="cline-any cline-yes">500</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">500</span>
<span class="cline-any cline-yes">500</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">500</span>
<span class="cline-any cline-yes">500</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">1</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">1</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">9460</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">9460</span>
<span class="cline-any cline-yes">9460</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">9460</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">1</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">503</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">503</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">503</span>
<span class="cline-any cline-yes">503</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">503</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">503</span>
<span class="cline-any cline-yes">162</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">503</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">1</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">323</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">323</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">323</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">162</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">162</span>
<span class="cline-any cline-yes">162</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">1</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">1</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">162</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">162</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">1</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">175</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">175</span>
<span class="cline-any cline-yes">175</span>
<span class="cline-any cline-yes">175</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">175</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">1</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">10125</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">9773</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">9773</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">491</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">491</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">491</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">491</span>
<span class="cline-any cline-yes">491</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">491</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">9282</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">8806</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">8806</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">8806</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">8786</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">8786</span>
<span class="cline-any cline-yes">8786</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">8786</span>
<span class="cline-any cline-yes">8296</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">8806</span>
<span class="cline-any cline-yes">393</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">8806</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">8806</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">476</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">10125</span>
<span class="cline-any cline-yes">162</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span></td><td class="text"><pre class="prettyprint lang-js">// Copyright (c) 2012 Kuba Niegowski
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in
// all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.
&nbsp;
'use strict';
&nbsp;
&nbsp;
var util = require('util'),
Stream = require('stream');
&nbsp;
&nbsp;
var ChunkStream = module.exports = function() {
Stream.call(this);
&nbsp;
this._buffers = [];
this._buffered = 0;
&nbsp;
this._reads = [];
this._paused = false;
&nbsp;
this._encoding = 'utf8';
this.writable = true;
};
util.inherits(ChunkStream, Stream);
&nbsp;
&nbsp;
ChunkStream.prototype.read = function(length, callback) {
&nbsp;
this._reads.push({
length: Math.abs(length), // if length &lt; 0 then at most this length
allowLess: length &lt; 0,
func: callback
});
&nbsp;
process.nextTick(function() {
this._process();
&nbsp;
// its paused and there is not enought data then ask for more
<span class="missing-if-branch" title="if path not taken" >I</span>if (this._paused &amp;&amp; this._reads.length &gt; 0) {
<span class="cstat-no" title="statement not covered" > this._paused = false;</span>
&nbsp;
<span class="cstat-no" title="statement not covered" > this.emit('drain');</span>
}
}.bind(this));
};
&nbsp;
ChunkStream.prototype.write = function(data, encoding) {
&nbsp;
<span class="missing-if-branch" title="if path not taken" >I</span>if (!this.writable) {
<span class="cstat-no" title="statement not covered" > this.emit('error', new Error('Stream not writable'));</span>
<span class="cstat-no" title="statement not covered" > return false;</span>
}
&nbsp;
<span class="missing-if-branch" title="if path not taken" >I</span>if (!Buffer.isBuffer(data))
<span class="cstat-no" title="statement not covered" > data = new Buffer(data, encoding || this._encoding);</span>
&nbsp;
this._buffers.push(data);
this._buffered += data.length;
&nbsp;
this._process();
&nbsp;
// ok if there are no more read requests
if (this._reads &amp;&amp; this._reads.length == 0)
this._paused = true;
&nbsp;
return this.writable &amp;&amp; !this._paused;
};
&nbsp;
ChunkStream.prototype.end = function(data, encoding) {
&nbsp;
<span class="missing-if-branch" title="if path not taken" >I</span>if (data) <span class="cstat-no" title="statement not covered" >this.write(data, encoding);</span>
&nbsp;
this.writable = false;
&nbsp;
// already destroyed
if (!this._buffers) return;
&nbsp;
// enqueue or handle end
<span class="missing-if-branch" title="if path not taken" >I</span>if (this._buffers.length == 0) {
<span class="cstat-no" title="statement not covered" > this._end();</span>
} else {
this._buffers.push(null);
this._process();
}
};
&nbsp;
ChunkStream.prototype.destroySoon = ChunkStream.prototype.end;
&nbsp;
ChunkStream.prototype._end = function() {
&nbsp;
<span class="missing-if-branch" title="if path not taken" >I</span>if (this._reads.length &gt; 0) {
<span class="cstat-no" title="statement not covered" > this.emit('error',</span>
new Error('There are some read requests waitng on finished stream')
);
}
&nbsp;
this.destroy();
};
&nbsp;
ChunkStream.prototype.destroy = function() {
&nbsp;
<span class="missing-if-branch" title="if path not taken" >I</span>if (!this._buffers) <span class="cstat-no" title="statement not covered" >return;</span>
&nbsp;
this.writable = false;
this._reads = null;
this._buffers = null;
&nbsp;
this.emit('close');
};
&nbsp;
ChunkStream.prototype._process = function() {
&nbsp;
// as long as there is any data and read requests
while (this._buffered &gt; 0 &amp;&amp; this._reads &amp;&amp; this._reads.length &gt; 0) {
&nbsp;
var read = this._reads[0];
&nbsp;
// read any data (but no more than length)
if (read.allowLess) {
&nbsp;
// ok there is any data so that we can satisfy this request
this._reads.shift(); // == read
&nbsp;
// first we need to peek into first buffer
var buf = this._buffers[0];
&nbsp;
// ok there is more data than we need
<span class="missing-if-branch" title="else path not taken" >E</span>if (buf.length &gt; read.length) {
&nbsp;
this._buffered -= read.length;
this._buffers[0] = buf.slice(read.length);
&nbsp;
read.func.call(this, buf.slice(0, read.length));
&nbsp;
} else {
// ok this is less than maximum length so use it all
<span class="cstat-no" title="statement not covered" > this._buffered -= buf.length;</span>
<span class="cstat-no" title="statement not covered" > this._buffers.shift(); </span>// == buf
&nbsp;
<span class="cstat-no" title="statement not covered" > read.func.call(this, buf);</span>
}
&nbsp;
} else if (this._buffered &gt;= read.length) {
// ok we can meet some expectations
&nbsp;
this._reads.shift(); // == read
&nbsp;
var pos = 0,
count = 0,
data = new Buffer(read.length);
&nbsp;
// create buffer for all data
while (pos &lt; read.length) {
&nbsp;
var buf = this._buffers[count++],
len = Math.min(buf.length, read.length - pos);
&nbsp;
buf.copy(data, pos, 0, len);
pos += len;
&nbsp;
// last buffer wasn't used all so just slice it and leave
if (len != buf.length)
this._buffers[--count] = buf.slice(len);
}
&nbsp;
// remove all used buffers
if (count &gt; 0)
this._buffers.splice(0, count);
&nbsp;
this._buffered -= read.length;
&nbsp;
read.func.call(this, data);
&nbsp;
} else {
// not enought data to satisfy first request in queue
// so we need to wait for more
break;
}
}
&nbsp;
if (this._buffers &amp;&amp; this._buffers.length &gt; 0 &amp;&amp; this._buffers[0] == null) {
this._end();
}
};
&nbsp;</pre></td></tr>
</table></pre>
</div>
<div class="footer">
<div class="meta">Generated by <a href="http://istanbul-js.org/" target="_blank">istanbul</a> at Mon Aug 03 2015 22:18:47 GMT+0100 (GMT Summer Time)</div>
</div>
<script src="../prettify.js"></script>
<script>
window.onload = function () {
if (typeof prettyPrint === 'function') {
prettyPrint();
}
};
</script>
<script src="../sorter.js"></script>
</body>
</html>
+159
View File
@@ -0,0 +1,159 @@
<!doctype html>
<html lang="en">
<head>
<title>Code coverage report for lib\constants.js</title>
<meta charset="utf-8">
<link rel="stylesheet" href="../prettify.css">
<link rel="stylesheet" href="../base.css">
<style type='text/css'>
div.coverage-summary .sorter {
background-image: url(../sort-arrow-sprite.png);
}
</style>
</head>
<body>
<div class="header high">
<h1>Code coverage report for <span class="entity">lib\constants.js</span></h1>
<h2>
Statements: <span class="metric">100% <small>(1 / 1)</small></span> &nbsp;&nbsp;&nbsp;&nbsp;
Branches: <span class="metric">100% <small>(0 / 0)</small></span> &nbsp;&nbsp;&nbsp;&nbsp;
Functions: <span class="metric">100% <small>(0 / 0)</small></span> &nbsp;&nbsp;&nbsp;&nbsp;
Lines: <span class="metric">100% <small>(1 / 1)</small></span> &nbsp;&nbsp;&nbsp;&nbsp;
Ignored: <span class="metric"><span class="ignore-none">none</span></span> &nbsp;&nbsp;&nbsp;&nbsp;
</h2>
<div class="path"><a href="../index.html">All files</a> &#187; <a href="index.html">lib/</a> &#187; constants.js</div>
</div>
<div class="body">
<pre><table class="coverage">
<tr><td class="line-count">1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39</td><td class="line-coverage"><span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">1</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span></td><td class="text"><pre class="prettyprint lang-js">// Copyright (c) 2012 Kuba Niegowski
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in
// all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.
&nbsp;
'use strict';
&nbsp;
&nbsp;
module.exports = {
&nbsp;
PNG_SIGNATURE: [0x89, 0x50, 0x4e, 0x47, 0x0d, 0x0a, 0x1a, 0x0a],
&nbsp;
TYPE_IHDR: 0x49484452,
TYPE_IEND: 0x49454e44,
TYPE_IDAT: 0x49444154,
TYPE_PLTE: 0x504c5445,
TYPE_tRNS: 0x74524e53,
TYPE_gAMA: 0x67414d41,
&nbsp;
COLOR_PALETTE: 1,
COLOR_COLOR: 2,
COLOR_ALPHA: 4
};
&nbsp;</pre></td></tr>
</table></pre>
</div>
<div class="footer">
<div class="meta">Generated by <a href="http://istanbul-js.org/" target="_blank">istanbul</a> at Mon Aug 03 2015 22:18:47 GMT+0100 (GMT Summer Time)</div>
</div>
<script src="../prettify.js"></script>
<script>
window.onload = function () {
if (typeof prettyPrint === 'function') {
prettyPrint();
}
};
</script>
<script src="../sorter.js"></script>
</body>
</html>
+234
View File
@@ -0,0 +1,234 @@
<!doctype html>
<html lang="en">
<head>
<title>Code coverage report for lib\crc.js</title>
<meta charset="utf-8">
<link rel="stylesheet" href="../prettify.css">
<link rel="stylesheet" href="../base.css">
<style type='text/css'>
div.coverage-summary .sorter {
background-image: url(../sort-arrow-sprite.png);
}
</style>
</head>
<body>
<div class="header high">
<h1>Code coverage report for <span class="entity">lib\crc.js</span></h1>
<h2>
Statements: <span class="metric">100% <small>(21 / 21)</small></span> &nbsp;&nbsp;&nbsp;&nbsp;
Branches: <span class="metric">100% <small>(2 / 2)</small></span> &nbsp;&nbsp;&nbsp;&nbsp;
Functions: <span class="metric">100% <small>(4 / 4)</small></span> &nbsp;&nbsp;&nbsp;&nbsp;
Lines: <span class="metric">100% <small>(21 / 21)</small></span> &nbsp;&nbsp;&nbsp;&nbsp;
Ignored: <span class="metric"><span class="ignore-none">none</span></span> &nbsp;&nbsp;&nbsp;&nbsp;
</h2>
<div class="path"><a href="../index.html">All files</a> &#187; <a href="index.html">lib/</a> &#187; crc.js</div>
</div>
<div class="body">
<pre><table class="coverage">
<tr><td class="line-count">1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64</td><td class="line-coverage"><span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">1</span>
<span class="cline-any cline-yes">2326</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">1</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">4414</span>
<span class="cline-any cline-yes">181010</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">4414</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">1</span>
<span class="cline-any cline-yes">2078</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">1</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">1288</span>
<span class="cline-any cline-yes">1288</span>
<span class="cline-any cline-yes">205540</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">1288</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">1</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">1</span>
<span class="cline-any cline-yes">256</span>
<span class="cline-any cline-yes">256</span>
<span class="cline-any cline-yes">2048</span>
<span class="cline-any cline-yes">1024</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">1024</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">256</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span></td><td class="text"><pre class="prettyprint lang-js">// Copyright (c) 2012 Kuba Niegowski
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in
// all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.
&nbsp;
'use strict';
&nbsp;
var CrcCalculator = module.exports = function() {
this._crc = -1;
};
&nbsp;
CrcCalculator.prototype.write = function(data) {
&nbsp;
for (var i = 0; i &lt; data.length; i++) {
this._crc = crcTable[(this._crc ^ data[i]) &amp; 0xff] ^ (this._crc &gt;&gt;&gt; 8);
}
return true;
};
&nbsp;
CrcCalculator.prototype.crc32 = function() {
return this._crc ^ -1;
};
&nbsp;
&nbsp;
CrcCalculator.crc32 = function(buf) {
&nbsp;
var crc = -1;
for (var i = 0; i &lt; buf.length; i++) {
crc = crcTable[(crc ^ buf[i]) &amp; 0xff] ^ (crc &gt;&gt;&gt; 8);
}
return crc ^ -1;
};
&nbsp;
&nbsp;
&nbsp;
var crcTable = [];
&nbsp;
for (var i = 0; i &lt; 256; i++) {
var c = i;
for (var j = 0; j &lt; 8; j++) {
if (c &amp; 1) {
c = 0xedb88320 ^ (c &gt;&gt;&gt; 1);
} else {
c = c &gt;&gt;&gt; 1;
}
}
crcTable[i] = c;
}
&nbsp;</pre></td></tr>
</table></pre>
</div>
<div class="footer">
<div class="meta">Generated by <a href="http://istanbul-js.org/" target="_blank">istanbul</a> at Mon Aug 03 2015 22:18:47 GMT+0100 (GMT Summer Time)</div>
</div>
<script src="../prettify.js"></script>
<script>
window.onload = function () {
if (typeof prettyPrint === 'function') {
prettyPrint();
}
};
</script>
<script src="../sorter.js"></script>
</body>
</html>
+180
View File
@@ -0,0 +1,180 @@
<!doctype html>
<html lang="en">
<head>
<title>Code coverage report for lib\filter-async.js</title>
<meta charset="utf-8">
<link rel="stylesheet" href="../prettify.css">
<link rel="stylesheet" href="../base.css">
<style type='text/css'>
div.coverage-summary .sorter {
background-image: url(../sort-arrow-sprite.png);
}
</style>
</head>
<body>
<div class="header high">
<h1>Code coverage report for <span class="entity">lib\filter-async.js</span></h1>
<h2>
Statements: <span class="metric">100% <small>(10 / 10)</small></span> &nbsp;&nbsp;&nbsp;&nbsp;
Branches: <span class="metric">100% <small>(0 / 0)</small></span> &nbsp;&nbsp;&nbsp;&nbsp;
Functions: <span class="metric">100% <small>(3 / 3)</small></span> &nbsp;&nbsp;&nbsp;&nbsp;
Lines: <span class="metric">100% <small>(10 / 10)</small></span> &nbsp;&nbsp;&nbsp;&nbsp;
Ignored: <span class="metric"><span class="ignore-none">none</span></span> &nbsp;&nbsp;&nbsp;&nbsp;
</h2>
<div class="path"><a href="../index.html">All files</a> &#187; <a href="index.html">lib/</a> &#187; filter-async.js</div>
</div>
<div class="body">
<pre><table class="coverage">
<tr><td class="line-count">1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46</td><td class="line-coverage"><span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">1</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">1</span>
<span class="cline-any cline-yes">164</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">164</span>
<span class="cline-any cline-yes">164</span>
<span class="cline-any cline-yes">164</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">162</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">5757</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">164</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">1</span>
<span class="cline-any cline-neutral">&nbsp;</span></td><td class="text"><pre class="prettyprint lang-js">// Copyright (c) 2012 Kuba Niegowski
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in
// all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.
&nbsp;
'use strict';
&nbsp;
var util = require('util'),
ChunkStream = require('./chunkstream'),
Filter = require('./filter');
&nbsp;
&nbsp;
var FilterAsync = module.exports = function(width, height, Bpp, depth, interlace, options) {
ChunkStream.call(this);
&nbsp;
var buffers = [];
var that = this;
this._filter = new Filter(width, height, Bpp, depth, interlace, options, {
read: this.read.bind(this),
complete: function(width, height) {
that.emit('complete', Buffer.concat(buffers), width, height)
},
write: function(buffer) {
buffers.push(buffer);
}
});
&nbsp;
this._filter.start();
};
util.inherits(FilterAsync, ChunkStream);
&nbsp;</pre></td></tr>
</table></pre>
</div>
<div class="footer">
<div class="meta">Generated by <a href="http://istanbul-js.org/" target="_blank">istanbul</a> at Mon Aug 03 2015 22:18:47 GMT+0100 (GMT Summer Time)</div>
</div>
<script src="../prettify.js"></script>
<script>
window.onload = function () {
if (typeof prettyPrint === 'function') {
prettyPrint();
}
};
</script>
<script src="../sorter.js"></script>
</body>
</html>
+171
View File
@@ -0,0 +1,171 @@
<!doctype html>
<html lang="en">
<head>
<title>Code coverage report for lib\filter-sync.js</title>
<meta charset="utf-8">
<link rel="stylesheet" href="../prettify.css">
<link rel="stylesheet" href="../base.css">
<style type='text/css'>
div.coverage-summary .sorter {
background-image: url(../sort-arrow-sprite.png);
}
</style>
</head>
<body>
<div class="header high">
<h1>Code coverage report for <span class="entity">lib\filter-sync.js</span></h1>
<h2>
Statements: <span class="metric">100% <small>(9 / 9)</small></span> &nbsp;&nbsp;&nbsp;&nbsp;
Branches: <span class="metric">100% <small>(0 / 0)</small></span> &nbsp;&nbsp;&nbsp;&nbsp;
Functions: <span class="metric">100% <small>(3 / 3)</small></span> &nbsp;&nbsp;&nbsp;&nbsp;
Lines: <span class="metric">100% <small>(9 / 9)</small></span> &nbsp;&nbsp;&nbsp;&nbsp;
Ignored: <span class="metric"><span class="ignore-none">none</span></span> &nbsp;&nbsp;&nbsp;&nbsp;
</h2>
<div class="path"><a href="../index.html">All files</a> &#187; <a href="index.html">lib/</a> &#187; filter-sync.js</div>
</div>
<div class="body">
<pre><table class="coverage">
<tr><td class="line-count">1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43</td><td class="line-coverage"><span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">1</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">1</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">175</span>
<span class="cline-any cline-yes">175</span>
<span class="cline-any cline-yes">175</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">5757</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">175</span>
<span class="cline-any cline-yes">175</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">175</span>
<span class="cline-any cline-neutral">&nbsp;</span></td><td class="text"><pre class="prettyprint lang-js">// Copyright (c) 2012 Kuba Niegowski
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in
// all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.
&nbsp;
'use strict';
&nbsp;
var SyncReader = require('./sync-reader'),
Filter = require('./filter');
&nbsp;
&nbsp;
exports.process = function(buffer, width, height, Bpp, depth, interlace, options) {
&nbsp;
var buffers = [];
var reader = new SyncReader(buffer);
var filter = new Filter(width, height, Bpp, depth, interlace, options, {
read: reader.read.bind(reader),
write: function(buffer) {
buffers.push(buffer);
},
complete: function(){}
});
&nbsp;
filter.start();
reader.process();
&nbsp;
return Buffer.concat(buffers);
};</pre></td></tr>
</table></pre>
</div>
<div class="footer">
<div class="meta">Generated by <a href="http://istanbul-js.org/" target="_blank">istanbul</a> at Mon Aug 03 2015 22:18:47 GMT+0100 (GMT Summer Time)</div>
</div>
<script src="../prettify.js"></script>
<script>
window.onload = function () {
if (typeof prettyPrint === 'function') {
prettyPrint();
}
};
</script>
<script src="../sorter.js"></script>
</body>
</html>
+897
View File
@@ -0,0 +1,897 @@
<!doctype html>
<html lang="en">
<head>
<title>Code coverage report for lib\filter.js</title>
<meta charset="utf-8">
<link rel="stylesheet" href="../prettify.css">
<link rel="stylesheet" href="../base.css">
<style type='text/css'>
div.coverage-summary .sorter {
background-image: url(../sort-arrow-sprite.png);
}
</style>
</head>
<body>
<div class="header high">
<h1>Code coverage report for <span class="entity">lib\filter.js</span></h1>
<h2>
Statements: <span class="metric">99.25% <small>(132 / 133)</small></span> &nbsp;&nbsp;&nbsp;&nbsp;
Branches: <span class="metric">98.77% <small>(80 / 81)</small></span> &nbsp;&nbsp;&nbsp;&nbsp;
Functions: <span class="metric">100% <small>(11 / 11)</small></span> &nbsp;&nbsp;&nbsp;&nbsp;
Lines: <span class="metric">99.21% <small>(126 / 127)</small></span> &nbsp;&nbsp;&nbsp;&nbsp;
Ignored: <span class="metric"><span class="ignore-none">none</span></span> &nbsp;&nbsp;&nbsp;&nbsp;
</h2>
<div class="path"><a href="../index.html">All files</a> &#187; <a href="index.html">lib/</a> &#187; filter.js</div>
</div>
<div class="body">
<pre><table class="coverage">
<tr><td class="line-count">1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285</td><td class="line-coverage"><span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">1</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">1</span>
<span class="cline-any cline-yes">1053</span>
<span class="cline-any cline-yes">1053</span>
<span class="cline-any cline-yes">539</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">1053</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">1</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">661</span>
<span class="cline-any cline-yes">661</span>
<span class="cline-any cline-yes">661</span>
<span class="cline-any cline-yes">661</span>
<span class="cline-any cline-yes">661</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">661</span>
<span class="cline-any cline-yes">500</span>
<span class="cline-any cline-yes">161</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">661</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">661</span>
<span class="cline-any cline-yes">661</span>
<span class="cline-any cline-yes">661</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">661</span>
<span class="cline-any cline-yes">661</span>
<span class="cline-any cline-yes">661</span>
<span class="cline-any cline-yes">70</span>
<span class="cline-any cline-yes">70</span>
<span class="cline-any cline-yes">462</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">591</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">1</span>
<span class="cline-any cline-yes">339</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">1</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">11514</span>
<span class="cline-any cline-yes">11514</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">11514</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">11514</span>
<span class="cline-any cline-yes">11514</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">11514</span>
<span class="cline-any cline-yes">994154</span>
<span class="cline-any cline-yes">994154</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">132202</span>
<span class="cline-any cline-yes">132202</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">51184</span>
<span class="cline-any cline-yes">51184</span>
<span class="cline-any cline-yes">51184</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">39440</span>
<span class="cline-any cline-yes">39440</span>
<span class="cline-any cline-yes">39440</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">9952</span>
<span class="cline-any cline-yes">9952</span>
<span class="cline-any cline-yes">9952</span>
<span class="cline-any cline-yes">9952</span>
<span class="cline-any cline-yes">9952</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">761376</span>
<span class="cline-any cline-yes">761376</span>
<span class="cline-any cline-yes">761376</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">761376</span>
<span class="cline-any cline-yes">761376</span>
<span class="cline-any cline-yes">761376</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">11514</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">11514</span>
<span class="cline-any cline-yes">11514</span>
<span class="cline-any cline-yes">716</span>
<span class="cline-any cline-yes">716</span>
<span class="cline-any cline-yes">716</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">10798</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">11514</span>
<span class="cline-any cline-yes">11190</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">324</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">1</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">322</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">322</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">9828</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">9828</span>
<span class="cline-any cline-yes">49140</span>
<span class="cline-any cline-yes">49140</span>
<span class="cline-any cline-yes">32968</span>
<span class="cline-any cline-yes">32968</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">9828</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">322</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">1</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">9872</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">9872</span>
<span class="cline-any cline-yes">9828</span>
<span class="cline-any cline-yes">1712272</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">44</span>
<span class="cline-any cline-yes">44</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">9872</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">1</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">10448</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">10448</span>
<span class="cline-any cline-yes">620</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">10448</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">1793152</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">1793152</span>
<span class="cline-any cline-yes">80880</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">10448</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">1</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">12330</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">12330</span>
<span class="cline-any cline-yes">2502</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">12330</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">2032176</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">2032176</span>
<span class="cline-any cline-yes">319904</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">12330</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">1</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">9918</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">9918</span>
<span class="cline-any cline-yes">90</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">9918</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">1723792</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">1723792</span>
<span class="cline-any cline-yes">11520</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">9918</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">1</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">16400</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">16400</span>
<span class="cline-any cline-yes">6572</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">16400</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">3007104</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">3007104</span>
<span class="cline-any cline-yes">1294832</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">16400</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">1</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">3768480</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">3768480</span>
<span class="cline-any cline-yes">540962</span>
<span class="cline-any cline-yes">97510</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span></td><td class="text"><pre class="prettyprint lang-js">// Copyright (c) 2012 Kuba Niegowski
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in
// all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.
&nbsp;
'use strict';
&nbsp;
var interlaceUtils = require('./interlace');
&nbsp;
function getByteWidth(width, bpp, depth) {
var byteWidth = width * bpp;
if (depth !== 8) {
byteWidth = Math.ceil(byteWidth / (8 / depth));
}
return byteWidth;
}
&nbsp;
var Filter = module.exports = function(width, height, Bpp, depth, interlace, options, dependencies) {
&nbsp;
this._width = width;
this._height = height;
this._Bpp = Bpp;
this._depth = depth;
this._options = options;
&nbsp;
if (!('filterType' in options) || options.filterType == -1) {
options.filterType = [0, 1, 2, 3, 4];
} else <span class="missing-if-branch" title="if path not taken" >I</span>if (typeof options.filterType == 'number') {
<span class="cstat-no" title="statement not covered" > options.filterType = [options.filterType];</span>
}
&nbsp;
this._filters = {
0: this._filterNone.bind(this),
1: this._filterSub.bind(this),
2: this._filterUp.bind(this),
3: this._filterAvg.bind(this),
4: this._filterPaeth.bind(this)
};
&nbsp;
this.read = dependencies.read;
this.write = dependencies.write;
this.complete = dependencies.complete;
&nbsp;
this._imageIndex = 0;
this._images = [];
if (interlace) {
var passes = interlaceUtils.getImagePasses(width, height);
for(var i = 0; i &lt; passes.length; i++) {
this._images.push({
byteWidth: getByteWidth(passes[i].width, Bpp, depth),
height: passes[i].height,
lineIndex: 0
});
}
} else {
this._images.push({
byteWidth: getByteWidth(width, Bpp, depth),
height: height,
lineIndex: 0
});
}
};
&nbsp;
Filter.prototype.start = function() {
this.read(this._images[this._imageIndex].byteWidth + 1, this._reverseFilterLine.bind(this));
};
&nbsp;
Filter.prototype._reverseFilterLine = function(rawData) {
&nbsp;
var currentImage = this._images[this._imageIndex];
var line = new Buffer(currentImage.byteWidth);
&nbsp;
var filter = rawData[0];
&nbsp;
var xComparison = this._depth &gt;= 8 ? ((this._depth === 16) ? this._Bpp * 2 : this._Bpp) : 1;
var xBiggerThan = xComparison - 1;
&nbsp;
for (var x = 0; x &lt; currentImage.byteWidth; x++) {
var rawByte = rawData[1 + x];
switch(filter) {
case 0:
line[x] = rawByte;
break;
case 1:
var left = x &gt; xBiggerThan ? line[x - xComparison] : 0;
line[x] = rawByte + left;
break;
case 2:
var up = this._lastLine ? this._lastLine[x] : 0;
line[x] = rawByte + up;
break;
case 3:
var up = this._lastLine ? this._lastLine[x] : 0;
var left = x &gt; xBiggerThan ? line[x - xComparison] : 0;
var add = Math.floor((left + up) / 2);
line[x] = rawByte + add;
break;
case 4:
var up = this._lastLine ? this._lastLine[x] : 0;
var left = x &gt; xBiggerThan ? line[x - xComparison] : 0;
var upLeft = x &gt; xBiggerThan &amp;&amp; this._lastLine
? this._lastLine[x - xComparison] : 0;
var add = PaethPredictor(left, up, upLeft);
line[x] = rawByte + add;
break;
}
&nbsp;
//if (x === 5) {
// console.log("R", line[3], "G", line[4], "B", line[5]);
//}
}
&nbsp;
this.write(line);
&nbsp;
currentImage.lineIndex++;
if (currentImage.lineIndex &gt;= currentImage.height) {
this._lastLine = null;
this._imageIndex++;
currentImage = this._images[this._imageIndex];
} else {
this._lastLine = line;
}
&nbsp;
if (currentImage) {
this.read(currentImage.byteWidth + 1, this._reverseFilterLine.bind(this));
} else {
this.complete(this._width, this._height);
}
};
&nbsp;
&nbsp;
Filter.prototype.filter = function(pxData) {
&nbsp;
var rawData = new Buffer(((this._width &lt;&lt; 2) + 1) * this._height);
&nbsp;
for (var y = 0; y &lt; this._height; y++) {
&nbsp;
// find best filter for this line (with lowest sum of values)
var filterTypes = this._options.filterType,
min = Infinity,
sel = 0;
&nbsp;
for (var i = 0; i &lt; filterTypes.length; i++) {
var sum = this._filters[filterTypes[i]](pxData, y, null);
if (sum &lt; min) {
sel = filterTypes[i];
min = sum;
}
}
&nbsp;
this._filters[sel](pxData, y, rawData);
}
return rawData;
};
&nbsp;
Filter.prototype._filterNone = function(pxData, y, rawData) {
&nbsp;
var pxRowLength = this._width &lt;&lt; 2,
rawRowLength = pxRowLength + 1,
sum = 0;
&nbsp;
if (!rawData) {
for (var x = 0; x &lt; pxRowLength; x++)
sum += Math.abs(pxData[y * pxRowLength + x]);
&nbsp;
} else {
rawData[y * rawRowLength] = 0;
pxData.copy(rawData, rawRowLength * y + 1, pxRowLength * y, pxRowLength * (y + 1));
}
&nbsp;
return sum;
};
&nbsp;
Filter.prototype._filterSub = function(pxData, y, rawData) {
&nbsp;
var pxRowLength = this._width &lt;&lt; 2,
rawRowLength = pxRowLength + 1,
sum = 0;
&nbsp;
if (rawData)
rawData[y * rawRowLength] = 1;
&nbsp;
for (var x = 0; x &lt; pxRowLength; x++) {
&nbsp;
var left = x &gt;= 4 ? pxData[y * pxRowLength + x - 4] : 0,
val = pxData[y * pxRowLength + x] - left;
&nbsp;
if (!rawData) sum += Math.abs(val);
else rawData[y * rawRowLength + 1 + x] = val;
}
return sum;
};
&nbsp;
Filter.prototype._filterUp = function(pxData, y, rawData) {
&nbsp;
var pxRowLength = this._width &lt;&lt; 2,
rawRowLength = pxRowLength + 1,
sum = 0;
&nbsp;
if (rawData)
rawData[y * rawRowLength] = 2;
&nbsp;
for (var x = 0; x &lt; pxRowLength; x++) {
&nbsp;
var up = y &gt; 0 ? pxData[(y - 1) * pxRowLength + x] : 0,
val = pxData[y * pxRowLength + x] - up;
&nbsp;
if (!rawData) sum += Math.abs(val);
else rawData[y * rawRowLength + 1 + x] = val;
}
return sum;
};
&nbsp;
Filter.prototype._filterAvg = function(pxData, y, rawData) {
&nbsp;
var pxRowLength = this._width &lt;&lt; 2,
rawRowLength = pxRowLength + 1,
sum = 0;
&nbsp;
if (rawData)
rawData[y * rawRowLength] = 3;
&nbsp;
for (var x = 0; x &lt; pxRowLength; x++) {
&nbsp;
var left = x &gt;= 4 ? pxData[y * pxRowLength + x - 4] : 0,
up = y &gt; 0 ? pxData[(y - 1) * pxRowLength + x] : 0,
val = pxData[y * pxRowLength + x] - ((left + up) &gt;&gt; 1);
&nbsp;
if (!rawData) sum += Math.abs(val);
else rawData[y * rawRowLength + 1 + x] = val;
}
return sum;
};
&nbsp;
Filter.prototype._filterPaeth = function(pxData, y, rawData) {
&nbsp;
var pxRowLength = this._width &lt;&lt; 2,
rawRowLength = pxRowLength + 1,
sum = 0;
&nbsp;
if (rawData)
rawData[y * rawRowLength] = 4;
&nbsp;
for (var x = 0; x &lt; pxRowLength; x++) {
&nbsp;
var left = x &gt;= 4 ? pxData[y * pxRowLength + x - 4] : 0,
up = y &gt; 0 ? pxData[(y - 1) * pxRowLength + x] : 0,
upLeft = x &gt;= 4 &amp;&amp; y &gt; 0 ? pxData[(y - 1) * pxRowLength + x - 4] : 0,
val = pxData[y * pxRowLength + x] - PaethPredictor(left, up, upLeft);
&nbsp;
if (!rawData) sum += Math.abs(val);
else rawData[y * rawRowLength + 1 + x] = val;
}
return sum;
};
&nbsp;
&nbsp;
&nbsp;
var PaethPredictor = function(left, above, upLeft) {
&nbsp;
var p = left + above - upLeft,
pLeft = Math.abs(p - left),
pAbove = Math.abs(p - above),
pUpLeft = Math.abs(p - upLeft);
&nbsp;
if (pLeft &lt;= pAbove &amp;&amp; pLeft &lt;= pUpLeft) return left;
else if (pAbove &lt;= pUpLeft) return above;
else return upLeft;
};
&nbsp;</pre></td></tr>
</table></pre>
</div>
<div class="footer">
<div class="meta">Generated by <a href="http://istanbul-js.org/" target="_blank">istanbul</a> at Mon Aug 03 2015 22:18:47 GMT+0100 (GMT Summer Time)</div>
</div>
<script src="../prettify.js"></script>
<script>
window.onload = function () {
if (typeof prettyPrint === 'function') {
prettyPrint();
}
};
</script>
<script src="../sorter.js"></script>
</body>
</html>
+255
View File
@@ -0,0 +1,255 @@
<!doctype html>
<html lang="en">
<head>
<title>Code coverage report for lib\</title>
<meta charset="utf-8">
<link rel="stylesheet" href="../prettify.css">
<link rel="stylesheet" href="../base.css">
<style type='text/css'>
div.coverage-summary .sorter {
background-image: url(../sort-arrow-sprite.png);
}
</style>
</head>
<body>
<div class="header high">
<h1>Code coverage report for <span class="entity">lib\</span></h1>
<h2>
Statements: <span class="metric">90.9% <small>(699 / 769)</small></span> &nbsp;&nbsp;&nbsp;&nbsp;
Branches: <span class="metric">83.39% <small>(261 / 313)</small></span> &nbsp;&nbsp;&nbsp;&nbsp;
Functions: <span class="metric">93% <small>(93 / 100)</small></span> &nbsp;&nbsp;&nbsp;&nbsp;
Lines: <span class="metric">91.28% <small>(691 / 757)</small></span> &nbsp;&nbsp;&nbsp;&nbsp;
Ignored: <span class="metric"><span class="ignore-none">none</span></span> &nbsp;&nbsp;&nbsp;&nbsp;
</h2>
<div class="path"><a href="../index.html">All files</a> &#187; lib/</div>
</div>
<div class="body">
<div class="coverage-summary">
<table>
<thead>
<tr>
<th data-col="file" data-fmt="html" data-html="true" class="file">File</th>
<th data-col="pic" data-type="number" data-fmt="html" data-html="true" class="pic"></th>
<th data-col="statements" data-type="number" data-fmt="pct" class="pct">Statements</th>
<th data-col="statements_raw" data-type="number" data-fmt="html" class="abs"></th>
<th data-col="branches" data-type="number" data-fmt="pct" class="pct">Branches</th>
<th data-col="branches_raw" data-type="number" data-fmt="html" class="abs"></th>
<th data-col="functions" data-type="number" data-fmt="pct" class="pct">Functions</th>
<th data-col="functions_raw" data-type="number" data-fmt="html" class="abs"></th>
<th data-col="lines" data-type="number" data-fmt="pct" class="pct">Lines</th>
<th data-col="lines_raw" data-type="number" data-fmt="html" class="abs"></th>
</tr>
</thead>
<tbody><tr>
<td class="file high" data-value="bitmapper.js"><a href="bitmapper.js.html">bitmapper.js</a></td>
<td data-value="95.6" class="pic high"><span class="cover-fill" style="width: 95px;"></span><span class="cover-empty" style="width:5px;"></span></td>
<td data-value="95.6" class="pct high">95.6%</td>
<td data-value="91" class="abs high">(87&nbsp;/&nbsp;91)</td>
<td data-value="90.32" class="pct high">90.32%</td>
<td data-value="31" class="abs high">(28&nbsp;/&nbsp;31)</td>
<td data-value="100" class="pct high">100%</td>
<td data-value="7" class="abs high">(7&nbsp;/&nbsp;7)</td>
<td data-value="95.6" class="pct high">95.6%</td>
<td data-value="91" class="abs high">(87&nbsp;/&nbsp;91)</td>
</tr>
<tr>
<td class="file high" data-value="chunkstream.js"><a href="chunkstream.js.html">chunkstream.js</a></td>
<td data-value="85" class="pic high"><span class="cover-fill" style="width: 85px;"></span><span class="cover-empty" style="width:15px;"></span></td>
<td data-value="85" class="pct high">85%</td>
<td data-value="80" class="abs high">(68&nbsp;/&nbsp;80)</td>
<td data-value="77.27" class="pct medium">77.27%</td>
<td data-value="44" class="abs medium">(34&nbsp;/&nbsp;44)</td>
<td data-value="100" class="pct high">100%</td>
<td data-value="8" class="abs high">(8&nbsp;/&nbsp;8)</td>
<td data-value="87.01" class="pct high">87.01%</td>
<td data-value="77" class="abs high">(67&nbsp;/&nbsp;77)</td>
</tr>
<tr>
<td class="file high" data-value="constants.js"><a href="constants.js.html">constants.js</a></td>
<td data-value="100" class="pic high"><span class="cover-fill cover-full" style="width: 100px;"></span><span class="cover-empty" style="width:0px;"></span></td>
<td data-value="100" class="pct high">100%</td>
<td data-value="1" class="abs high">(1&nbsp;/&nbsp;1)</td>
<td data-value="100" class="pct high">100%</td>
<td data-value="0" class="abs high">(0&nbsp;/&nbsp;0)</td>
<td data-value="100" class="pct high">100%</td>
<td data-value="0" class="abs high">(0&nbsp;/&nbsp;0)</td>
<td data-value="100" class="pct high">100%</td>
<td data-value="1" class="abs high">(1&nbsp;/&nbsp;1)</td>
</tr>
<tr>
<td class="file high" data-value="crc.js"><a href="crc.js.html">crc.js</a></td>
<td data-value="100" class="pic high"><span class="cover-fill cover-full" style="width: 100px;"></span><span class="cover-empty" style="width:0px;"></span></td>
<td data-value="100" class="pct high">100%</td>
<td data-value="21" class="abs high">(21&nbsp;/&nbsp;21)</td>
<td data-value="100" class="pct high">100%</td>
<td data-value="2" class="abs high">(2&nbsp;/&nbsp;2)</td>
<td data-value="100" class="pct high">100%</td>
<td data-value="4" class="abs high">(4&nbsp;/&nbsp;4)</td>
<td data-value="100" class="pct high">100%</td>
<td data-value="21" class="abs high">(21&nbsp;/&nbsp;21)</td>
</tr>
<tr>
<td class="file high" data-value="filter-async.js"><a href="filter-async.js.html">filter-async.js</a></td>
<td data-value="100" class="pic high"><span class="cover-fill cover-full" style="width: 100px;"></span><span class="cover-empty" style="width:0px;"></span></td>
<td data-value="100" class="pct high">100%</td>
<td data-value="10" class="abs high">(10&nbsp;/&nbsp;10)</td>
<td data-value="100" class="pct high">100%</td>
<td data-value="0" class="abs high">(0&nbsp;/&nbsp;0)</td>
<td data-value="100" class="pct high">100%</td>
<td data-value="3" class="abs high">(3&nbsp;/&nbsp;3)</td>
<td data-value="100" class="pct high">100%</td>
<td data-value="10" class="abs high">(10&nbsp;/&nbsp;10)</td>
</tr>
<tr>
<td class="file high" data-value="filter-sync.js"><a href="filter-sync.js.html">filter-sync.js</a></td>
<td data-value="100" class="pic high"><span class="cover-fill cover-full" style="width: 100px;"></span><span class="cover-empty" style="width:0px;"></span></td>
<td data-value="100" class="pct high">100%</td>
<td data-value="9" class="abs high">(9&nbsp;/&nbsp;9)</td>
<td data-value="100" class="pct high">100%</td>
<td data-value="0" class="abs high">(0&nbsp;/&nbsp;0)</td>
<td data-value="100" class="pct high">100%</td>
<td data-value="3" class="abs high">(3&nbsp;/&nbsp;3)</td>
<td data-value="100" class="pct high">100%</td>
<td data-value="9" class="abs high">(9&nbsp;/&nbsp;9)</td>
</tr>
<tr>
<td class="file high" data-value="filter.js"><a href="filter.js.html">filter.js</a></td>
<td data-value="99.25" class="pic high"><span class="cover-fill" style="width: 99px;"></span><span class="cover-empty" style="width:1px;"></span></td>
<td data-value="99.25" class="pct high">99.25%</td>
<td data-value="133" class="abs high">(132&nbsp;/&nbsp;133)</td>
<td data-value="98.77" class="pct high">98.77%</td>
<td data-value="81" class="abs high">(80&nbsp;/&nbsp;81)</td>
<td data-value="100" class="pct high">100%</td>
<td data-value="11" class="abs high">(11&nbsp;/&nbsp;11)</td>
<td data-value="99.21" class="pct high">99.21%</td>
<td data-value="127" class="abs high">(126&nbsp;/&nbsp;127)</td>
</tr>
<tr>
<td class="file high" data-value="interlace.js"><a href="interlace.js.html">interlace.js</a></td>
<td data-value="100" class="pic high"><span class="cover-fill cover-full" style="width: 100px;"></span><span class="cover-empty" style="width:0px;"></span></td>
<td data-value="100" class="pct high">100%</td>
<td data-value="29" class="abs high">(29&nbsp;/&nbsp;29)</td>
<td data-value="100" class="pct high">100%</td>
<td data-value="8" class="abs high">(8&nbsp;/&nbsp;8)</td>
<td data-value="100" class="pct high">100%</td>
<td data-value="3" class="abs high">(3&nbsp;/&nbsp;3)</td>
<td data-value="100" class="pct high">100%</td>
<td data-value="29" class="abs high">(29&nbsp;/&nbsp;29)</td>
</tr>
<tr>
<td class="file high" data-value="packer.js"><a href="packer.js.html">packer.js</a></td>
<td data-value="100" class="pic high"><span class="cover-fill cover-full" style="width: 100px;"></span><span class="cover-empty" style="width:0px;"></span></td>
<td data-value="100" class="pct high">100%</td>
<td data-value="44" class="abs high">(44&nbsp;/&nbsp;44)</td>
<td data-value="80" class="pct high">80%</td>
<td data-value="10" class="abs high">(8&nbsp;/&nbsp;10)</td>
<td data-value="100" class="pct high">100%</td>
<td data-value="8" class="abs high">(8&nbsp;/&nbsp;8)</td>
<td data-value="100" class="pct high">100%</td>
<td data-value="43" class="abs high">(43&nbsp;/&nbsp;43)</td>
</tr>
<tr>
<td class="file high" data-value="parser-async.js"><a href="parser-async.js.html">parser-async.js</a></td>
<td data-value="90.7" class="pic high"><span class="cover-fill" style="width: 90px;"></span><span class="cover-empty" style="width:10px;"></span></td>
<td data-value="90.7" class="pct high">90.7%</td>
<td data-value="43" class="abs high">(39&nbsp;/&nbsp;43)</td>
<td data-value="83.33" class="pct high">83.33%</td>
<td data-value="12" class="abs high">(10&nbsp;/&nbsp;12)</td>
<td data-value="100" class="pct high">100%</td>
<td data-value="6" class="abs high">(6&nbsp;/&nbsp;6)</td>
<td data-value="90.7" class="pct high">90.7%</td>
<td data-value="43" class="abs high">(39&nbsp;/&nbsp;43)</td>
</tr>
<tr>
<td class="file high" data-value="parser-sync.js"><a href="parser-sync.js.html">parser-sync.js</a></td>
<td data-value="100" class="pic high"><span class="cover-fill cover-full" style="width: 100px;"></span><span class="cover-empty" style="width:0px;"></span></td>
<td data-value="100" class="pct high">100%</td>
<td data-value="29" class="abs high">(29&nbsp;/&nbsp;29)</td>
<td data-value="100" class="pct high">100%</td>
<td data-value="0" class="abs high">(0&nbsp;/&nbsp;0)</td>
<td data-value="100" class="pct high">100%</td>
<td data-value="7" class="abs high">(7&nbsp;/&nbsp;7)</td>
<td data-value="100" class="pct high">100%</td>
<td data-value="29" class="abs high">(29&nbsp;/&nbsp;29)</td>
</tr>
<tr>
<td class="file high" data-value="parser.js"><a href="parser.js.html">parser.js</a></td>
<td data-value="90.34" class="pic high"><span class="cover-fill" style="width: 90px;"></span><span class="cover-empty" style="width:10px;"></span></td>
<td data-value="90.34" class="pct high">90.34%</td>
<td data-value="176" class="abs high">(159&nbsp;/&nbsp;176)</td>
<td data-value="86.11" class="pct high">86.11%</td>
<td data-value="72" class="abs high">(62&nbsp;/&nbsp;72)</td>
<td data-value="100" class="pct high">100%</td>
<td data-value="20" class="abs high">(20&nbsp;/&nbsp;20)</td>
<td data-value="90.34" class="pct high">90.34%</td>
<td data-value="176" class="abs high">(159&nbsp;/&nbsp;176)</td>
</tr>
<tr>
<td class="file high" data-value="png-sync.js"><a href="png-sync.js.html">png-sync.js</a></td>
<td data-value="100" class="pic high"><span class="cover-fill cover-full" style="width: 100px;"></span><span class="cover-empty" style="width:0px;"></span></td>
<td data-value="100" class="pct high">100%</td>
<td data-value="7" class="abs high">(7&nbsp;/&nbsp;7)</td>
<td data-value="100" class="pct high">100%</td>
<td data-value="6" class="abs high">(6&nbsp;/&nbsp;6)</td>
<td data-value="100" class="pct high">100%</td>
<td data-value="1" class="abs high">(1&nbsp;/&nbsp;1)</td>
<td data-value="100" class="pct high">100%</td>
<td data-value="7" class="abs high">(7&nbsp;/&nbsp;7)</td>
</tr>
<tr>
<td class="file medium" data-value="png.js"><a href="png.js.html">png.js</a></td>
<td data-value="60.26" class="pic medium"><span class="cover-fill" style="width: 60px;"></span><span class="cover-empty" style="width:40px;"></span></td>
<td data-value="60.26" class="pct medium">60.26%</td>
<td data-value="78" class="abs medium">(47&nbsp;/&nbsp;78)</td>
<td data-value="38.89" class="pct low">38.89%</td>
<td data-value="36" class="abs low">(14&nbsp;/&nbsp;36)</td>
<td data-value="56.25" class="pct medium">56.25%</td>
<td data-value="16" class="abs medium">(9&nbsp;/&nbsp;16)</td>
<td data-value="61.84" class="pct medium">61.84%</td>
<td data-value="76" class="abs medium">(47&nbsp;/&nbsp;76)</td>
</tr>
<tr>
<td class="file high" data-value="sync-reader.js"><a href="sync-reader.js.html">sync-reader.js</a></td>
<td data-value="94.44" class="pic high"><span class="cover-fill" style="width: 94px;"></span><span class="cover-empty" style="width:6px;"></span></td>
<td data-value="94.44" class="pct high">94.44%</td>
<td data-value="18" class="abs high">(17&nbsp;/&nbsp;18)</td>
<td data-value="81.82" class="pct high">81.82%</td>
<td data-value="11" class="abs high">(9&nbsp;/&nbsp;11)</td>
<td data-value="100" class="pct high">100%</td>
<td data-value="3" class="abs high">(3&nbsp;/&nbsp;3)</td>
<td data-value="94.44" class="pct high">94.44%</td>
<td data-value="18" class="abs high">(17&nbsp;/&nbsp;18)</td>
</tr>
</tbody>
</table>
</div>
</div>
<div class="footer">
<div class="meta">Generated by <a href="http://istanbul-js.org/" target="_blank">istanbul</a> at Mon Aug 03 2015 22:18:47 GMT+0100 (GMT Summer Time)</div>
</div>
<script src="../prettify.js"></script>
<script>
window.onload = function () {
if (typeof prettyPrint === 'function') {
prettyPrint();
}
};
</script>
<script src="../sorter.js"></script>
</body>
</html>
+297
View File
@@ -0,0 +1,297 @@
<!doctype html>
<html lang="en">
<head>
<title>Code coverage report for lib\interlace.js</title>
<meta charset="utf-8">
<link rel="stylesheet" href="../prettify.css">
<link rel="stylesheet" href="../base.css">
<style type='text/css'>
div.coverage-summary .sorter {
background-image: url(../sort-arrow-sprite.png);
}
</style>
</head>
<body>
<div class="header high">
<h1>Code coverage report for <span class="entity">lib\interlace.js</span></h1>
<h2>
Statements: <span class="metric">100% <small>(29 / 29)</small></span> &nbsp;&nbsp;&nbsp;&nbsp;
Branches: <span class="metric">100% <small>(8 / 8)</small></span> &nbsp;&nbsp;&nbsp;&nbsp;
Functions: <span class="metric">100% <small>(3 / 3)</small></span> &nbsp;&nbsp;&nbsp;&nbsp;
Lines: <span class="metric">100% <small>(29 / 29)</small></span> &nbsp;&nbsp;&nbsp;&nbsp;
Ignored: <span class="metric"><span class="ignore-none">none</span></span> &nbsp;&nbsp;&nbsp;&nbsp;
</h2>
<div class="path"><a href="../index.html">All files</a> &#187; <a href="index.html">lib/</a> &#187; interlace.js</div>
</div>
<div class="body">
<pre><table class="coverage">
<tr><td class="line-count">1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85</td><td class="line-coverage"><span class="cline-any cline-yes">1</span>
<span class="cline-any cline-yes">140</span>
<span class="cline-any cline-yes">140</span>
<span class="cline-any cline-yes">140</span>
<span class="cline-any cline-yes">140</span>
<span class="cline-any cline-yes">140</span>
<span class="cline-any cline-yes">140</span>
<span class="cline-any cline-yes">980</span>
<span class="cline-any cline-yes">980</span>
<span class="cline-any cline-yes">980</span>
<span class="cline-any cline-yes">980</span>
<span class="cline-any cline-yes">1528</span>
<span class="cline-any cline-yes">672</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">856</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">980</span>
<span class="cline-any cline-yes">1300</span>
<span class="cline-any cline-yes">504</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">796</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">980</span>
<span class="cline-any cline-yes">924</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">140</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">1</span>
<span class="cline-any cline-yes">70</span>
<span class="cline-any cline-yes">58834</span>
<span class="cline-any cline-yes">58834</span>
<span class="cline-any cline-yes">58834</span>
<span class="cline-any cline-yes">58834</span>
<span class="cline-any cline-yes">58834</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">1</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span></td><td class="text"><pre class="prettyprint lang-js">exports.getImagePasses = function(width, height) {
var images = [];
var xLeftOver = width % 8;
var yLeftOver = height % 8;
var xRepeats = (width - xLeftOver) / 8;
var yRepeats = (width - yLeftOver) / 8;
for(var i = 0; i &lt; imagePasses.length; i++) {
var pass = imagePasses[i];
var passWidth = xRepeats * pass.x.length;
var passHeight = yRepeats * pass.y.length;
for(var j = 0; j &lt; pass.x.length; j++) {
if (pass.x[j] &lt; xLeftOver) {
passWidth++;
}
else {
break;
}
}
for(j = 0; j &lt; pass.y.length; j++) {
if (pass.y[j] &lt; yLeftOver) {
passHeight++;
}
else {
break;
}
}
if (passWidth &gt; 0 &amp;&amp; passHeight &gt; 0) {
images.push({ width: passWidth, height: passHeight, index: i});
}
}
return images;
};
&nbsp;
exports.getInterlaceIterator = function(width, height) {
return function(x, y, pass) {
var outerXLeftOver = x % imagePasses[pass].x.length;
var outerX = (((x - outerXLeftOver)/ imagePasses[pass].x.length) * 8) + imagePasses[pass].x[outerXLeftOver];
var outerYLeftOver = y % imagePasses[pass].y.length;
var outerY = (((y - outerYLeftOver) / imagePasses[pass].y.length) * 8) + imagePasses[pass].y[outerYLeftOver];
return (outerX * 4) + (outerY * width * 4);
};
};
&nbsp;
// Adam 7
// 0 1 2 3 4 5 6 7
// 0 x 6 4 6 x 6 4 6
// 1 7 7 7 7 7 7 7 7
// 2 5 6 5 6 5 6 5 6
// 3 7 7 7 7 7 7 7 7
// 4 3 6 4 6 3 6 4 6
// 5 7 7 7 7 7 7 7 7
// 6 5 6 5 6 5 6 5 6
// 7 7 7 7 7 7 7 7 7
&nbsp;
&nbsp;
var imagePasses = [
{ // pass 1 - 1px
x: [0],
y: [0]
},
{ // pass 2 - 1px
x: [4],
y: [0]
},
{ // pass 3 - 2px
x: [0, 4],
y: [4]
},
{ // pass 4 - 4px
x: [2, 6],
y: [0, 4]
},
{ // pass 5 - 8px
x: [0, 2, 4, 6],
y: [2, 6]
},
{ // pass 6 - 16px
x: [1, 3, 5, 7],
y: [0, 2, 4, 6]
},
{ // pass 7 - 32px
x: [0, 1, 2, 3, 4, 5, 6, 7],
y: [1, 3, 5, 7]
}
];</pre></td></tr>
</table></pre>
</div>
<div class="footer">
<div class="meta">Generated by <a href="http://istanbul-js.org/" target="_blank">istanbul</a> at Mon Aug 03 2015 22:18:47 GMT+0100 (GMT Summer Time)</div>
</div>
<script src="../prettify.js"></script>
<script>
window.onload = function () {
if (typeof prettyPrint === 'function') {
prettyPrint();
}
};
</script>
<script src="../sorter.js"></script>
</body>
</html>
+378
View File
@@ -0,0 +1,378 @@
<!doctype html>
<html lang="en">
<head>
<title>Code coverage report for lib\packer.js</title>
<meta charset="utf-8">
<link rel="stylesheet" href="../prettify.css">
<link rel="stylesheet" href="../base.css">
<style type='text/css'>
div.coverage-summary .sorter {
background-image: url(../sort-arrow-sprite.png);
}
</style>
</head>
<body>
<div class="header high">
<h1>Code coverage report for <span class="entity">lib\packer.js</span></h1>
<h2>
Statements: <span class="metric">100% <small>(44 / 44)</small></span> &nbsp;&nbsp;&nbsp;&nbsp;
Branches: <span class="metric">80% <small>(8 / 10)</small></span> &nbsp;&nbsp;&nbsp;&nbsp;
Functions: <span class="metric">100% <small>(8 / 8)</small></span> &nbsp;&nbsp;&nbsp;&nbsp;
Lines: <span class="metric">100% <small>(43 / 43)</small></span> &nbsp;&nbsp;&nbsp;&nbsp;
Ignored: <span class="metric"><span class="ignore-none">none</span></span> &nbsp;&nbsp;&nbsp;&nbsp;
</h2>
<div class="path"><a href="../index.html">All files</a> &#187; <a href="index.html">lib/</a> &#187; packer.js</div>
</div>
<div class="body">
<pre><table class="coverage">
<tr><td class="line-count">1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112</td><td class="line-coverage"><span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">1</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">1</span>
<span class="cline-any cline-yes">336</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">336</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">336</span>
<span class="cline-any cline-yes">336</span>
<span class="cline-any cline-yes">336</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">336</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">1</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">1</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">322</span>
<span class="cline-any cline-yes">322</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">322</span>
<span class="cline-any cline-yes">322</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">322</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">322</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">322</span>
<span class="cline-any cline-yes">644</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">322</span>
<span class="cline-any cline-yes">322</span>
<span class="cline-any cline-yes">322</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">322</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">1</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">1288</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">1288</span>
<span class="cline-any cline-yes">1288</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">1288</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">1288</span>
<span class="cline-any cline-yes">1288</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">1</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">322</span>
<span class="cline-any cline-yes">322</span>
<span class="cline-any cline-yes">322</span>
<span class="cline-any cline-yes">322</span>
<span class="cline-any cline-yes">322</span>
<span class="cline-any cline-yes">322</span>
<span class="cline-any cline-yes">322</span>
<span class="cline-any cline-yes">322</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">322</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">1</span>
<span class="cline-any cline-yes">644</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">1</span>
<span class="cline-any cline-yes">322</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span></td><td class="text"><pre class="prettyprint lang-js">// Copyright (c) 2012 Kuba Niegowski
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in
// all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.
&nbsp;
'use strict';
&nbsp;
&nbsp;
var util = require('util'),
Stream = require('stream'),
zlib = require('zlib'),
Filter = require('./filter'),
CrcStream = require('./crc'),
constants = require('./constants');
&nbsp;
&nbsp;
var Packer = module.exports = function(options) {
Stream.call(this);
&nbsp;
this._options = options;
&nbsp;
options.deflateChunkSize = options.deflateChunkSize || 32 * 1024;
options.deflateLevel = options.deflateLevel != null ? <span class="branch-0 cbranch-no" title="branch not covered" >options.deflateLevel </span>: 9;
options.deflateStrategy = options.deflateStrategy != null ? <span class="branch-0 cbranch-no" title="branch not covered" >options.deflateStrategy </span>: 3;
&nbsp;
this.readable = true;
};
util.inherits(Packer, Stream);
&nbsp;
&nbsp;
Packer.prototype.pack = function(data, width, height) {
&nbsp;
// Signature
this.emit('data', new Buffer(constants.PNG_SIGNATURE));
this.emit('data', this._packIHDR(width, height));
&nbsp;
// filter pixel data
//TODO {}
var filter = new Filter(width, height, 4, 8, false, this._options, {});
var data = filter.filter(data);
&nbsp;
// compress it
var deflate = zlib.createDeflate({
chunkSize: this._options.deflateChunkSize,
level: this._options.deflateLevel,
strategy: this._options.deflateStrategy
});
deflate.on('error', this.emit.bind(this, 'error'));
&nbsp;
deflate.on('data', function(data) {
this.emit('data', this._packIDAT(data));
}.bind(this));
&nbsp;
deflate.on('end', function() {
this.emit('data', this._packIEND());
this.emit('end');
}.bind(this));
&nbsp;
deflate.end(data);
};
&nbsp;
Packer.prototype._packChunk = function(type, data) {
&nbsp;
var len = (data ? data.length : 0),
buf = new Buffer(len + 12);
&nbsp;
buf.writeUInt32BE(len, 0);
buf.writeUInt32BE(type, 4);
&nbsp;
if (data) data.copy(buf, 8);
&nbsp;
buf.writeInt32BE(CrcStream.crc32(buf.slice(4, buf.length - 4)), buf.length - 4);
return buf;
};
&nbsp;
Packer.prototype._packIHDR = function(width, height) {
&nbsp;
var buf = new Buffer(13);
buf.writeUInt32BE(width, 0);
buf.writeUInt32BE(height, 4);
buf[8] = 8;
buf[9] = 6; // colorType
buf[10] = 0; // compression
buf[11] = 0; // filter
buf[12] = 0; // interlace
&nbsp;
return this._packChunk(constants.TYPE_IHDR, buf);
};
&nbsp;
Packer.prototype._packIDAT = function(data) {
return this._packChunk(constants.TYPE_IDAT, data);
};
&nbsp;
Packer.prototype._packIEND = function() {
return this._packChunk(constants.TYPE_IEND, null);
};
&nbsp;</pre></td></tr>
</table></pre>
</div>
<div class="footer">
<div class="meta">Generated by <a href="http://istanbul-js.org/" target="_blank">istanbul</a> at Mon Aug 03 2015 22:18:47 GMT+0100 (GMT Summer Time)</div>
</div>
<script src="../prettify.js"></script>
<script>
window.onload = function () {
if (typeof prettyPrint === 'function') {
prettyPrint();
}
};
</script>
<script src="../sorter.js"></script>
</body>
</html>
+429
View File
@@ -0,0 +1,429 @@
<!doctype html>
<html lang="en">
<head>
<title>Code coverage report for lib\parser-async.js</title>
<meta charset="utf-8">
<link rel="stylesheet" href="../prettify.css">
<link rel="stylesheet" href="../base.css">
<style type='text/css'>
div.coverage-summary .sorter {
background-image: url(../sort-arrow-sprite.png);
}
</style>
</head>
<body>
<div class="header high">
<h1>Code coverage report for <span class="entity">lib\parser-async.js</span></h1>
<h2>
Statements: <span class="metric">90.7% <small>(39 / 43)</small></span> &nbsp;&nbsp;&nbsp;&nbsp;
Branches: <span class="metric">83.33% <small>(10 / 12)</small></span> &nbsp;&nbsp;&nbsp;&nbsp;
Functions: <span class="metric">100% <small>(6 / 6)</small></span> &nbsp;&nbsp;&nbsp;&nbsp;
Lines: <span class="metric">90.7% <small>(39 / 43)</small></span> &nbsp;&nbsp;&nbsp;&nbsp;
Ignored: <span class="metric"><span class="ignore-none">none</span></span> &nbsp;&nbsp;&nbsp;&nbsp;
</h2>
<div class="path"><a href="../index.html">All files</a> &#187; <a href="index.html">lib/</a> &#187; parser-async.js</div>
</div>
<div class="body">
<pre><table class="coverage">
<tr><td class="line-count">1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129</td><td class="line-coverage"><span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">1</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">1</span>
<span class="cline-any cline-yes">336</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">336</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">336</span>
<span class="cline-any cline-yes">336</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">336</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">1</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">1</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">13</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">13</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">13</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">13</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">13</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">1</span>
<span class="cline-any cline-yes">491</span>
<span class="cline-any cline-yes">162</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">162</span>
<span class="cline-any cline-yes">162</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">162</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">491</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">1</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">164</span>
<span class="cline-any cline-yes">164</span>
<span class="cline-any cline-yes">164</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">164</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">1</span>
<span class="cline-any cline-yes">162</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">162</span>
<span class="cline-any cline-yes">1</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">161</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">162</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">1</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">162</span>
<span class="cline-any cline-yes">1</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">161</span>
<span class="cline-any cline-yes">161</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">161</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">161</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span></td><td class="text"><pre class="prettyprint lang-js">// Copyright (c) 2012 Kuba Niegowski
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in
// all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.
&nbsp;
'use strict';
&nbsp;
&nbsp;
var util = require('util'),
zlib = require('zlib'),
ChunkStream = require('./chunkstream'),
FilterAsync = require('./filter-async'),
Parser = require('./parser'),
bitmapper = require('./bitmapper');
&nbsp;
&nbsp;
var ParserAsync = module.exports = function(options) {
ChunkStream.call(this);
&nbsp;
this._parser = new Parser(options, {
read: this.read.bind(this),
error: this._handleError.bind(this),
metadata: this.emit.bind(this, "metadata"),
gamma: this.emit.bind(this, "gamma"),
finished: this._finished.bind(this),
inflateData: this._inflateData.bind(this),
createData: this._createData.bind(this)
});
this._options = options;
this.writable = true;
&nbsp;
this._parser.start();
};
util.inherits(ParserAsync, ChunkStream);
&nbsp;
&nbsp;
ParserAsync.prototype._handleError = function(err) {
&nbsp;
this.emit('error', err);
&nbsp;
this.writable = false;
&nbsp;
this.destroy();
&nbsp;
<span class="missing-if-branch" title="if path not taken" >I</span>if (this._inflate &amp;&amp; this._inflate.destroy) {
<span class="cstat-no" title="statement not covered" > this._inflate.destroy();</span>
}
&nbsp;
this.errord = true;
};
&nbsp;
ParserAsync.prototype._inflateData = function(data) {
if (!this._inflate) {
this._inflate = zlib.createInflate();
&nbsp;
this._inflate.on('error', this.emit.bind(this, 'error'));
this._filter.on('complete', this._complete.bind(this));
&nbsp;
this._inflate.pipe(this._filter);
}
this._inflate.write(data);
};
&nbsp;
ParserAsync.prototype._createData = function(width, height, bpp, depth, interlace) {
&nbsp;
this._bpp = bpp;
this._depth = depth;
this._interlace = interlace;
&nbsp;
this._filter = new FilterAsync(
width, height,
bpp,
depth,
interlace,
this._options
);
};
&nbsp;
ParserAsync.prototype._finished = function(data) {
<span class="missing-if-branch" title="if path not taken" >I</span>if (this.errord) {
<span class="cstat-no" title="statement not covered" > return;</span>
}
&nbsp;
if (!this._inflate) {
this.emit('error', 'No Inflate block');
} else {
// no more data to inflate
this._inflate.end();
}
this.destroySoon();
};
&nbsp;
ParserAsync.prototype._complete = function(data, width, height) {
&nbsp;
if (this.errord) {
return;
}
&nbsp;
try {
data = bitmapper.dataToBitMap(data, width, height,
this._bpp,
this._depth,
this._interlace);
&nbsp;
data = this._parser.reverseFiltered(data, this._depth, width, height);
}
catch(e) {
<span class="cstat-no" title="statement not covered" > this._handleError();</span>
<span class="cstat-no" title="statement not covered" > return;</span>
}
&nbsp;
this.emit('parsed', data);
};
&nbsp;</pre></td></tr>
</table></pre>
</div>
<div class="footer">
<div class="meta">Generated by <a href="http://istanbul-js.org/" target="_blank">istanbul</a> at Mon Aug 03 2015 22:18:47 GMT+0100 (GMT Summer Time)</div>
</div>
<script src="../prettify.js"></script>
<script>
window.onload = function () {
if (typeof prettyPrint === 'function') {
prettyPrint();
}
};
</script>
<script src="../sorter.js"></script>
</body>
</html>
+333
View File
@@ -0,0 +1,333 @@
<!doctype html>
<html lang="en">
<head>
<title>Code coverage report for lib\parser-sync.js</title>
<meta charset="utf-8">
<link rel="stylesheet" href="../prettify.css">
<link rel="stylesheet" href="../base.css">
<style type='text/css'>
div.coverage-summary .sorter {
background-image: url(../sort-arrow-sprite.png);
}
</style>
</head>
<body>
<div class="header high">
<h1>Code coverage report for <span class="entity">lib\parser-sync.js</span></h1>
<h2>
Statements: <span class="metric">100% <small>(29 / 29)</small></span> &nbsp;&nbsp;&nbsp;&nbsp;
Branches: <span class="metric">100% <small>(0 / 0)</small></span> &nbsp;&nbsp;&nbsp;&nbsp;
Functions: <span class="metric">100% <small>(7 / 7)</small></span> &nbsp;&nbsp;&nbsp;&nbsp;
Lines: <span class="metric">100% <small>(29 / 29)</small></span> &nbsp;&nbsp;&nbsp;&nbsp;
Ignored: <span class="metric"><span class="ignore-none">none</span></span> &nbsp;&nbsp;&nbsp;&nbsp;
</h2>
<div class="path"><a href="../index.html">All files</a> &#187; <a href="index.html">lib/</a> &#187; parser-sync.js</div>
</div>
<div class="body">
<pre><table class="coverage">
<tr><td class="line-count">1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97</td><td class="line-coverage"><span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">1</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">1</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">175</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">175</span>
<span class="cline-any cline-yes">175</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">175</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">175</span>
<span class="cline-any cline-yes">175</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">175</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">175</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">175</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">175</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">162</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">1</span>
<span class="cline-any cline-yes">13</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">1</span>
<span class="cline-any cline-yes">164</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">1</span>
<span class="cline-any cline-yes">146</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">1</span>
<span class="cline-any cline-yes">491</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">1</span>
<span class="cline-any cline-yes">164</span>
<span class="cline-any cline-yes">164</span>
<span class="cline-any cline-yes">164</span>
<span class="cline-any cline-yes">164</span>
<span class="cline-any cline-yes">164</span>
<span class="cline-any cline-yes">164</span>
<span class="cline-any cline-yes">164</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span></td><td class="text"><pre class="prettyprint lang-js">// Copyright (c) 2012 Kuba Niegowski
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in
// all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.
&nbsp;
'use strict';
&nbsp;
&nbsp;
var zlib = require('zlib'),
SyncReader = require('./sync-reader'),
FilterSync = require('./filter-sync'),
Parser = require('./parser'),
bitmapper = require('./bitmapper');
&nbsp;
&nbsp;
var ParserSync = module.exports = function(buffer, options) {
&nbsp;
var reader = new SyncReader(buffer);
&nbsp;
this._inflateDataList = [];
this._parser = new Parser(options, {
read: reader.read.bind(reader),
error: this._handleError.bind(this),
metadata: this._metaData.bind(this),
gamma: this._gamma.bind(this),
finished: function() {},
inflateData: this._inflateData.bind(this),
createData: this._createData.bind(this)
});
this._options = options;
&nbsp;
this._parser.start();
reader.process();
&nbsp;
//join together the inflate datas
var inflateData = Buffer.concat(this._inflateDataList);
&nbsp;
var data = zlib.inflateSync(inflateData);
&nbsp;
data = FilterSync.process(
data,
this._width, this._height,
this._bpp,
this._depth,
this._interlace,
this._options
);
&nbsp;
this._data = bitmapper.dataToBitMap(data, this._width, this._height,
this._bpp,
this._depth,
this._interlace);
// todo yuck
this.data = this._parser.reverseFiltered(this._data, this._depth, this._width, this._height);
};
&nbsp;
ParserSync.prototype._handleError = function(err) {
this.err = err;
};
&nbsp;
ParserSync.prototype._metaData = function(metaData) {
this.metaData = metaData;
};
&nbsp;
ParserSync.prototype._gamma = function(gamma) {
this.gamma = gamma;
};
&nbsp;
ParserSync.prototype._inflateData = function(data) {
this._inflateDataList.push(data);
};
&nbsp;
ParserSync.prototype._createData = function(width, height, bpp, depth, interlace) {
this._data = new Buffer(width * height * 4);
this._bpp = bpp;
this._width = width;
this._height = height;
this._depth = depth;
this._interlace = interlace;
return this._data;
};
&nbsp;</pre></td></tr>
</table></pre>
</div>
<div class="footer">
<div class="meta">Generated by <a href="http://istanbul-js.org/" target="_blank">istanbul</a> at Mon Aug 03 2015 22:18:47 GMT+0100 (GMT Summer Time)</div>
</div>
<script src="../prettify.js"></script>
<script>
window.onload = function () {
if (typeof prettyPrint === 'function') {
prettyPrint();
}
};
</script>
<script src="../sorter.js"></script>
</body>
</html>
+1188
View File
File diff suppressed because it is too large Load Diff
+171
View File
@@ -0,0 +1,171 @@
<!doctype html>
<html lang="en">
<head>
<title>Code coverage report for lib\png-sync.js</title>
<meta charset="utf-8">
<link rel="stylesheet" href="../prettify.css">
<link rel="stylesheet" href="../base.css">
<style type='text/css'>
div.coverage-summary .sorter {
background-image: url(../sort-arrow-sprite.png);
}
</style>
</head>
<body>
<div class="header high">
<h1>Code coverage report for <span class="entity">lib\png-sync.js</span></h1>
<h2>
Statements: <span class="metric">100% <small>(7 / 7)</small></span> &nbsp;&nbsp;&nbsp;&nbsp;
Branches: <span class="metric">100% <small>(6 / 6)</small></span> &nbsp;&nbsp;&nbsp;&nbsp;
Functions: <span class="metric">100% <small>(1 / 1)</small></span> &nbsp;&nbsp;&nbsp;&nbsp;
Lines: <span class="metric">100% <small>(7 / 7)</small></span> &nbsp;&nbsp;&nbsp;&nbsp;
Ignored: <span class="metric"><span class="ignore-none">none</span></span> &nbsp;&nbsp;&nbsp;&nbsp;
</h2>
<div class="path"><a href="../index.html">All files</a> &#187; <a href="index.html">lib/</a> &#187; png-sync.js</div>
</div>
<div class="body">
<pre><table class="coverage">
<tr><td class="line-count">1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43</td><td class="line-coverage"><span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">1</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">1</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">175</span>
<span class="cline-any cline-yes">175</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">162</span>
<span class="cline-any cline-yes">1</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">161</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span></td><td class="text"><pre class="prettyprint lang-js">// Copyright (c) 2012 Kuba Niegowski
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in
// all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.
&nbsp;
'use strict';
&nbsp;
&nbsp;
var Parser = require('./parser-sync');
&nbsp;
&nbsp;
exports.read = function(buffer, options) {
&nbsp;
options = options || {};
var parser = new Parser(buffer, options);
&nbsp;
if (parser.err) {
throw parser.err;
}
&nbsp;
return {
data: parser.data,
width: parser._width,
height: parser._height,
gamma: parser.gamma || 0
};
};
&nbsp;</pre></td></tr>
</table></pre>
</div>
<div class="footer">
<div class="meta">Generated by <a href="http://istanbul-js.org/" target="_blank">istanbul</a> at Mon Aug 03 2015 22:18:47 GMT+0100 (GMT Summer Time)</div>
</div>
<script src="../prettify.js"></script>
<script>
window.onload = function () {
if (typeof prettyPrint === 'function') {
prettyPrint();
}
};
</script>
<script src="../sorter.js"></script>
</body>
</html>
+552
View File
@@ -0,0 +1,552 @@
<!doctype html>
<html lang="en">
<head>
<title>Code coverage report for lib\png.js</title>
<meta charset="utf-8">
<link rel="stylesheet" href="../prettify.css">
<link rel="stylesheet" href="../base.css">
<style type='text/css'>
div.coverage-summary .sorter {
background-image: url(../sort-arrow-sprite.png);
}
</style>
</head>
<body>
<div class="header medium">
<h1>Code coverage report for <span class="entity">lib\png.js</span></h1>
<h2>
Statements: <span class="metric">60.26% <small>(47 / 78)</small></span> &nbsp;&nbsp;&nbsp;&nbsp;
Branches: <span class="metric">38.89% <small>(14 / 36)</small></span> &nbsp;&nbsp;&nbsp;&nbsp;
Functions: <span class="metric">56.25% <small>(9 / 16)</small></span> &nbsp;&nbsp;&nbsp;&nbsp;
Lines: <span class="metric">61.84% <small>(47 / 76)</small></span> &nbsp;&nbsp;&nbsp;&nbsp;
Ignored: <span class="metric"><span class="ignore-none">none</span></span> &nbsp;&nbsp;&nbsp;&nbsp;
</h2>
<div class="path"><a href="../index.html">All files</a> &#187; <a href="index.html">lib/</a> &#187; png.js</div>
</div>
<div class="body">
<pre><table class="coverage">
<tr><td class="line-count">1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170</td><td class="line-coverage"><span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">1</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">1</span>
<span class="cline-any cline-yes">336</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">336</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">336</span>
<span class="cline-any cline-yes">336</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">336</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">336</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">336</span>
<span class="cline-any cline-yes">336</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">336</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">336</span>
<span class="cline-any cline-yes">336</span>
<span class="cline-any cline-yes">336</span>
<span class="cline-any cline-yes">336</span>
<span class="cline-any cline-yes">336</span>
<span class="cline-any cline-yes">161</span>
<span class="cline-any cline-yes">161</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">336</span>
<span class="cline-any cline-yes">336</span>
<span class="cline-any cline-yes">336</span>
<span class="cline-any cline-yes">336</span>
<span class="cline-any cline-yes">336</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">1</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">1</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">1</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">322</span>
<span class="cline-any cline-yes">322</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">322</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">1</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">1</span>
<span class="cline-any cline-yes">175</span>
<span class="cline-any cline-yes">175</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">1</span>
<span class="cline-any cline-yes">161</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">1</span>
<span class="cline-any cline-yes">164</span>
<span class="cline-any cline-yes">164</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">164</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">1</span>
<span class="cline-any cline-yes">146</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">1</span>
<span class="cline-any cline-yes">350</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">1</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">1</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">1</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">1</span></td><td class="text"><pre class="prettyprint lang-js">// Copyright (c) 2012 Kuba Niegowski
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in
// all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.
&nbsp;
'use strict';
&nbsp;
&nbsp;
var util = require('util'),
Stream = require('stream'),
Parser = require('./parser-async'),
Packer = require('./packer'),
PNGSync = require('./png-sync');
&nbsp;
&nbsp;
var PNG = exports.PNG = function(options) {
Stream.call(this);
&nbsp;
options = options || {};
&nbsp;
this.width = options.width || 0;
this.height = options.height || 0;
&nbsp;
this.data = this.width &gt; 0 &amp;&amp; <span class="branch-1 cbranch-no" title="branch not covered" >this.height &gt; 0</span>
? <span class="branch-0 cbranch-no" title="branch not covered" >new Buffer(4 * this.width * this.height) </span>: null;
&nbsp;
<span class="missing-if-branch" title="if path not taken" >I</span>if(options.fill &amp;&amp; <span class="branch-1 cbranch-no" title="branch not covered" >this.data)</span>{<span class="cstat-no" title="statement not covered" >this.data.fill(0)}</span>;
&nbsp;
this.gamma = 0;
this.readable = this.writable = true;
&nbsp;
this._parser = new Parser(options || <span class="branch-1 cbranch-no" title="branch not covered" >{})</span>;
&nbsp;
this._parser.on('error', this.emit.bind(this, 'error'));
this._parser.on('close', this._handleClose.bind(this));
this._parser.on('metadata', this._metadata.bind(this));
this._parser.on('gamma', this._gamma.bind(this));
this._parser.on('parsed', function(data) {
this.data = data;
this.emit('parsed', data);
}.bind(this));
&nbsp;
this._packer = new Packer(options);
this._packer.on('data', this.emit.bind(this, 'data'));
this._packer.on('end', this.emit.bind(this, 'end'));
this._parser.on('close', this._handleClose.bind(this));
this._packer.on('error', this.emit.bind(this, 'error'));
&nbsp;
};
util.inherits(PNG, Stream);
&nbsp;
PNG.sync = PNGSync;
&nbsp;
PNG.prototype.pack = function() {
&nbsp;
process.nextTick(function() {
this._packer.pack(this.data, this.width, this.height);
}.bind(this));
&nbsp;
return this;
};
&nbsp;
&nbsp;
PNG.prototype.parse = <span class="fstat-no" title="function not covered" >function(data, callback) {</span>
&nbsp;
<span class="cstat-no" title="statement not covered" > if (callback) {</span>
<span class="cstat-no" title="statement not covered" > var onParsed = null, onError = null;</span>
&nbsp;
<span class="cstat-no" title="statement not covered" > this.once('parsed', onParsed = <span class="fstat-no" title="function not covered" >function(data) {</span></span>
<span class="cstat-no" title="statement not covered" > this.removeListener('error', onError);</span>
&nbsp;
<span class="cstat-no" title="statement not covered" > this.data = data;</span>
<span class="cstat-no" title="statement not covered" > callback(null, this);</span>
&nbsp;
}.bind(this));
&nbsp;
<span class="cstat-no" title="statement not covered" > this.once('error', onError = <span class="fstat-no" title="function not covered" >function(err) {</span></span>
<span class="cstat-no" title="statement not covered" > this.removeListener('parsed', onParsed);</span>
&nbsp;
<span class="cstat-no" title="statement not covered" > callback(err, null);</span>
}.bind(this));
}
&nbsp;
<span class="cstat-no" title="statement not covered" > this.end(data);</span>
<span class="cstat-no" title="statement not covered" > return this;</span>
};
&nbsp;
PNG.prototype.write = function(data) {
this._parser.write(data);
return true;
};
&nbsp;
PNG.prototype.end = function(data) {
this._parser.end(data);
};
&nbsp;
PNG.prototype._metadata = function(metadata) {
this.width = metadata.width;
this.height = metadata.height;
&nbsp;
this.emit('metadata', metadata);
};
&nbsp;
PNG.prototype._gamma = function(gamma) {
this.gamma = gamma;
};
&nbsp;
PNG.prototype._handleClose = function() {
<span class="missing-if-branch" title="if path not taken" >I</span>if (!this._parser.writable &amp;&amp; !this._packer.readable)
<span class="cstat-no" title="statement not covered" > this.emit('close');</span>
};
&nbsp;
PNG.bitblt = <span class="fstat-no" title="function not covered" >function(src, dst, sx, sy, w, h, dx, dy) {</span>
&nbsp;
<span class="cstat-no" title="statement not covered" > if (sx &gt; src.width || sy &gt; src.height</span>
|| sx + w &gt; src.width || sy + h &gt; src.height)
<span class="cstat-no" title="statement not covered" > throw new Error('bitblt reading outside image');</span>
<span class="cstat-no" title="statement not covered" > if (dx &gt; dst.width || dy &gt; dst.height</span>
|| dx + w &gt; dst.width || dy + h &gt; dst.height)
<span class="cstat-no" title="statement not covered" > throw new Error('bitblt writing outside image');</span>
&nbsp;
<span class="cstat-no" title="statement not covered" > for (var y = 0; y &lt; h; y++) {</span>
<span class="cstat-no" title="statement not covered" > src.data.copy(dst.data,</span>
((dy + y) * dst.width + dx) &lt;&lt; 2,
((sy + y) * src.width + sx) &lt;&lt; 2,
((sy + y) * src.width + sx + w) &lt;&lt; 2
);
}
};
&nbsp;
&nbsp;
PNG.prototype.bitblt = <span class="fstat-no" title="function not covered" >function(dst, sx, sy, w, h, dx, dy) {</span>
&nbsp;
<span class="cstat-no" title="statement not covered" > PNG.bitblt(this, dst, sx, sy, w, h, dx, dy);</span>
<span class="cstat-no" title="statement not covered" > return this;</span>
};
&nbsp;
PNG.adjustGamma = <span class="fstat-no" title="function not covered" >function(src) {</span>
<span class="cstat-no" title="statement not covered" > if (src.gamma) {</span>
<span class="cstat-no" title="statement not covered" > for (var y = 0; y &lt; src.height; y++) {</span>
<span class="cstat-no" title="statement not covered" > for (var x = 0; x &lt; src.width; x++) {</span>
<span class="cstat-no" title="statement not covered" > var idx = (src.width * y + x) &lt;&lt; 2;</span>
&nbsp;
<span class="cstat-no" title="statement not covered" > for (var i = 0; i &lt; 3; i++) {</span>
<span class="cstat-no" title="statement not covered" > var sample = src.data[idx + i] / 255;</span>
<span class="cstat-no" title="statement not covered" > sample = Math.pow(sample, 1 / 2.2 / src.gamma);</span>
<span class="cstat-no" title="statement not covered" > src.data[idx + i] = Math.round(sample * 255);</span>
}
}
}
<span class="cstat-no" title="statement not covered" > src.gamma = 0;</span>
}
};
&nbsp;
PNG.prototype.adjustGamma = <span class="fstat-no" title="function not covered" >function() {</span> <span class="cstat-no" title="statement not covered" >PNG.adjustGamma(this); </span>};</pre></td></tr>
</table></pre>
</div>
<div class="footer">
<div class="meta">Generated by <a href="http://istanbul-js.org/" target="_blank">istanbul</a> at Mon Aug 03 2015 22:18:47 GMT+0100 (GMT Summer Time)</div>
</div>
<script src="../prettify.js"></script>
<script>
window.onload = function () {
if (typeof prettyPrint === 'function') {
prettyPrint();
}
};
</script>
<script src="../sorter.js"></script>
</body>
</html>
+255
View File
@@ -0,0 +1,255 @@
<!doctype html>
<html lang="en">
<head>
<title>Code coverage report for lib\sync-reader.js</title>
<meta charset="utf-8">
<link rel="stylesheet" href="../prettify.css">
<link rel="stylesheet" href="../base.css">
<style type='text/css'>
div.coverage-summary .sorter {
background-image: url(../sort-arrow-sprite.png);
}
</style>
</head>
<body>
<div class="header high">
<h1>Code coverage report for <span class="entity">lib\sync-reader.js</span></h1>
<h2>
Statements: <span class="metric">94.44% <small>(17 / 18)</small></span> &nbsp;&nbsp;&nbsp;&nbsp;
Branches: <span class="metric">81.82% <small>(9 / 11)</small></span> &nbsp;&nbsp;&nbsp;&nbsp;
Functions: <span class="metric">100% <small>(3 / 3)</small></span> &nbsp;&nbsp;&nbsp;&nbsp;
Lines: <span class="metric">94.44% <small>(17 / 18)</small></span> &nbsp;&nbsp;&nbsp;&nbsp;
Ignored: <span class="metric"><span class="ignore-none">none</span></span> &nbsp;&nbsp;&nbsp;&nbsp;
</h2>
<div class="path"><a href="../index.html">All files</a> &#187; <a href="index.html">lib/</a> &#187; sync-reader.js</div>
</div>
<div class="body">
<pre><table class="coverage">
<tr><td class="line-count">1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71</td><td class="line-coverage"><span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">1</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">350</span>
<span class="cline-any cline-yes">350</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">1</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">9310</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">1</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">350</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">9297</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">9297</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">9297</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">9297</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">9297</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">9297</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">350</span>
<span class="cline-any cline-yes">13</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">337</span>
<span class="cline-any cline-yes">13</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span></td><td class="text"><pre class="prettyprint lang-js">// Copyright (c) 2012 Kuba Niegowski
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in
// all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.
&nbsp;
'use strict';
&nbsp;
var SyncReader = module.exports = function (buffer) {
&nbsp;
this._buffer = buffer;
this._reads = [];
};
&nbsp;
SyncReader.prototype.read = function (length, callback) {
&nbsp;
this._reads.push({
length: Math.abs(length), // if length &lt; 0 then at most this length
allowLess: length &lt; 0,
func: callback
});
};
&nbsp;
SyncReader.prototype.process = function () {
&nbsp;
// as long as there is any data and read requests
while (this._reads.length &gt; 0 &amp;&amp; this._buffer.length) {
&nbsp;
var read = this._reads[0];
&nbsp;
<span class="missing-if-branch" title="else path not taken" >E</span>if (this._buffer.length &amp;&amp; (this._buffer.length &gt;= read.length || <span class="branch-2 cbranch-no" title="branch not covered" >read.allowLess)</span>) {
&nbsp;
// ok there is any data so that we can satisfy this request
this._reads.shift(); // == read
&nbsp;
var buf = this._buffer;
&nbsp;
this._buffer = buf.slice(read.length);
&nbsp;
read.func.call(this, buf.slice(0, read.length));
&nbsp;
} else {
<span class="cstat-no" title="statement not covered" > break;</span>
}
&nbsp;
}
&nbsp;
if (this._reads.length &gt; 0) {
return new Error('There are some read requests waitng on finished stream');
}
&nbsp;
if (this._buffer.length &gt; 0) {
return new Error('unrecognised content at end of stream');
}
&nbsp;
};
&nbsp;</pre></td></tr>
</table></pre>
</div>
<div class="footer">
<div class="meta">Generated by <a href="http://istanbul-js.org/" target="_blank">istanbul</a> at Mon Aug 03 2015 22:18:47 GMT+0100 (GMT Summer Time)</div>
</div>
<script src="../prettify.js"></script>
<script>
window.onload = function () {
if (typeof prettyPrint === 'function') {
prettyPrint();
}
};
</script>
<script src="../sorter.js"></script>
</body>
</html>