BioLib  3.6.2
A GUI-less version of Bio .NET library for editing & annotating various microscopy image formats.
Loading...
Searching...
No Matches
Bio.Graphics.FloodFillRangeQueue Class Reference

A queue of FloodFillRanges. More...

Public Member Functions

 FloodFillRangeQueue (int initialSize)
 
void Enqueue (ref FloodFillRange r)
 
FloodFillRange Dequeue ()
 

Properties

int Count [get]
 
FloodFillRange First [get]
 

Detailed Description

A queue of FloodFillRanges.

Definition at line 7 of file FloodFillRangeQueue.cs.

Constructor & Destructor Documentation

◆ FloodFillRangeQueue() [1/2]

Bio.Graphics.FloodFillRangeQueue.FloodFillRangeQueue ( )

Definition at line 21 of file FloodFillRangeQueue.cs.

21 :this(10000)
22 {
23
24 }

◆ FloodFillRangeQueue() [2/2]

Bio.Graphics.FloodFillRangeQueue.FloodFillRangeQueue ( int initialSize)

Definition at line 27 of file FloodFillRangeQueue.cs.

28 {
29 array = new FloodFillRange[initialSize];
30 head = 0;
31 size = 0;
32 }

Member Function Documentation

◆ Dequeue()

FloodFillRange Bio.Graphics.FloodFillRangeQueue.Dequeue ( )

The function dequeues the first item in the queue and returns it

Returns
FloodFillRange

Definition at line 58 of file FloodFillRangeQueue.cs.

59 {
60 FloodFillRange range = new FloodFillRange();
61 if (size>0)
62 {
63 range = array[head];
64 array[head] = new FloodFillRange();
65 head++;//advance head position
66 size--;//update size to exclude dequeued item
67 }
68 return range;
69 }

◆ Enqueue()

void Bio.Graphics.FloodFillRangeQueue.Enqueue ( ref FloodFillRange r)

The queue is full if the head is at the end of the array

Parameters
FloodFillRangeA struct that contains the start and end of a range.

Definition at line 43 of file FloodFillRangeQueue.cs.

44 {
45 if (size+head == array.Length)
46 {
47 FloodFillRange[] newArray = new FloodFillRange[2 * array.Length];
48 Array.Copy(array, head, newArray, 0, size);
49 array = newArray;
50 head = 0;
51 }
52 array[head+(size++)] = r;
53 }

Property Documentation

◆ Count

int Bio.Graphics.FloodFillRangeQueue.Count
get

Definition at line 15 of file FloodFillRangeQueue.cs.

16 {
17 get { return size; }
18 }

◆ First

FloodFillRange Bio.Graphics.FloodFillRangeQueue.First
get

Definition at line 35 of file FloodFillRangeQueue.cs.

36 {
37 get { return array[head]; }
38 }

The documentation for this class was generated from the following file: