BioCore
5.0.0
A Windows .NET microscopy library and application for viewing, editing, and annotating images.
Loading...
Searching...
No Matches
FloodFillRangeQueue.cs
Go to the documentation of this file.
1
namespace
BioCore
2
{
4
public
class
FloodFillRangeQueue
5
{
6
FloodFillRange
[] array;
7
int
size;
8
int
head;
9
13
public
int
Count
14
{
15
get
{
return
size; }
16
}
17
18
public
FloodFillRangeQueue
() : this(10000)
19
{
20
21
}
22
23
public
FloodFillRangeQueue
(
int
initialSize)
24
{
25
array =
new
FloodFillRange
[initialSize];
26
head = 0;
27
size = 0;
28
}
29
31
public
FloodFillRange
First
32
{
33
get
{
return
array[head]; }
34
}
35
37
public
void
Enqueue
(ref
FloodFillRange
r)
38
{
39
if
(size + head == array.Length)
40
{
41
FloodFillRange
[] newArray =
new
FloodFillRange
[2 * array.Length];
42
Array.Copy(array, head, newArray, 0, size);
43
array = newArray;
44
head = 0;
45
}
46
array[head + (size++)] = r;
47
}
48
50
public
FloodFillRange
Dequeue
()
51
{
52
FloodFillRange
range =
new
FloodFillRange
();
53
if
(size > 0)
54
{
55
range = array[head];
56
array[head] =
new
FloodFillRange
();
57
head++;
//advance head position
58
size--;
//update size to exclude dequeued item
59
}
60
return
range;
61
}
62
64
/*public void Clear()
65
{
66
if (size > 0)
67
Array.Clear(array, 0, size);
68
size = 0;
69
}*/
70
71
}
72
}
BioCore.FloodFillRangeQueue
A queue of FloodFillRanges.
Definition
FloodFillRangeQueue.cs:5
BioCore.FloodFillRangeQueue.Dequeue
FloodFillRange Dequeue()
Removes and returns the FloodFillRange at the beginning of the queue.
Definition
FloodFillRangeQueue.cs:50
BioCore.FloodFillRangeQueue.FloodFillRangeQueue
FloodFillRangeQueue()
Definition
FloodFillRangeQueue.cs:18
BioCore.FloodFillRangeQueue.Count
int Count
Returns the number of items currently in the queue.
Definition
FloodFillRangeQueue.cs:14
BioCore.FloodFillRangeQueue.First
FloodFillRange First
Gets the FloodFillRange at the beginning of the queue.
Definition
FloodFillRangeQueue.cs:32
BioCore.FloodFillRangeQueue.Enqueue
void Enqueue(ref FloodFillRange r)
Adds a FloodFillRange to the end of the queue.
Definition
FloodFillRangeQueue.cs:37
BioCore.FloodFillRangeQueue.FloodFillRangeQueue
FloodFillRangeQueue(int initialSize)
Definition
FloodFillRangeQueue.cs:23
BioCore
Definition
About.cs:2
BioCore.FloodFillRange
Represents a linear range to be filled and branched from.
Definition
QueueLinearFloodFiller.cs:279
BioCore
BioCore
Graphics
FloodFillRangeQueue.cs
Generated by
1.12.0