FACT++  1.0
float ClusterFinder::FindCluster ( int32_t  x,
int32_t  y 
)
inlineprivate

Definition at line 34 of file FilterLed.cc.

References i.

Referenced by FilterLed::Execute().

35  {
36  // if edge is touched stop finding cluster
37  if (x<fX0 || x>=fX1 || y<fY0 || y>=fY1)
38  return -1;
39 
41  return -2;
42 
43  // get the value
44  float val = fImg[y*fW+x];
45 
46  // if its empty we have found the border of the cluster
47  if (val==0)
48  return 0;
49 
50  // mark the point as processed
51  fImg[y*fW+x] = 0;
52 
53  fSumX += x*val; // sumx
54  fSumY += y*val; // sumy
55  fCount++;
56 
57  float rc[4];
58  rc[0] = FindCluster(x+1, y );
59  rc[1] = FindCluster(x, y+1);
60  rc[2] = FindCluster(x-1, y );
61  rc[3] = FindCluster(x, y-1);
62 
63  for (int i=0; i<4; i++)
64  {
65  if (rc[i]<0) // check if edge is touched
66  return rc[i];
67 
68  val += rc[i];
69  }
70 
71  return val;
72  }
float FindCluster(int32_t x, int32_t y)
Definition: FilterLed.cc:34
int i
Definition: db_dim_client.c:21
uint32_t fLimitingSize
Definition: FilterLed.cc:28
int32_t fY1
Definition: FilterLed.cc:26
uint8_t * fImg
Definition: FilterLed.cc:17
uint32_t fW
Definition: FilterLed.cc:19
int32_t fX1
Definition: FilterLed.cc:23
uint32_t fCount
Definition: FilterLed.cc:30

+ Here is the caller graph for this function: