-
Notifications
You must be signed in to change notification settings - Fork 9
/
Copy pathResponseLayer.as
57 lines (40 loc) · 1.19 KB
/
ResponseLayer.as
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
package surf
{
import flash.display.Sprite;
/**
* @author Samuel Girardin
*/
public class ResponseLayer
{
public var width:int ;
public var height:int ;
public var step:int ;
public var filter:int ;
public var responses:Vector.<Number> ;
public var laplacian:Vector.<int> ;
public function ResponseLayer(_width:int, _height:int, _step:int , _filter:int)
{
super() ;
width = _width;
height = _height;
step = _step;
filter = _filter;
responses = new Vector.<Number>(width*height) ;
laplacian = new Vector.<int>(width*height) ;
}
public function getLaplacian(row:int, column:int):int {
return laplacian[row * width + column];
}
public function getLaplacianR(row:int, column:int , src:ResponseLayer):int {
var scale:int = width /src.width;;
return laplacian[(scale * row) * width + (scale * column)];
}
public function getResponse(row:int, column:int):Number {
return responses[row * width + column];
}
public function getResponsesR(row:int, column:int , src:ResponseLayer):Number {
var scale:int = width / src.width;
return responses[(scale * row) * width + (scale * column)];
}
}
}