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.AbstractFloodFiller Class Referenceabstract

The base class that the flood fill algorithms inherit from. Implements the basic flood filler functionality that is the same across all algorithms. More...

Inheritance diagram for Bio.Graphics.AbstractFloodFiller:
Bio.Graphics.QueueLinearFloodFiller

Public Member Functions

 AbstractFloodFiller (AbstractFloodFiller configSource)
 
void FloodFill (Point pt)
 

Protected Member Functions

void PrepareForFloodFill (Point pt)
 

Protected Attributes

Bitmap bitmap
 
ColorS tolerance = new ColorS(25, 25, 25)
 
ColorS fillColor = ColorS.FromColor(Color.Black)
 
bool fillDiagonally = false
 
bool slow = false
 
int bitmapWidth = 0
 
int bitmapHeight = 0
 
int bitmapStride = 0
 
int bitmapPixelFormatSize = 0
 
byte[] bitmapBits = null
 
PixelFormat pixelFormat
 
bool[] pixelsChecked
 
ColorS byteFillColor
 
ColorS startColor
 

Properties

ColorS FillColor [get, set]
 
bool FillDiagonally [get, set]
 
ColorS Tolerance [get, set]
 
Bitmap Bitmap [get, set]
 

Detailed Description

The base class that the flood fill algorithms inherit from. Implements the basic flood filler functionality that is the same across all algorithms.

Definition at line 13 of file AbstractFloodFiller.cs.

Constructor & Destructor Documentation

◆ AbstractFloodFiller() [1/2]

Bio.Graphics.AbstractFloodFiller.AbstractFloodFiller ( )

Definition at line 40 of file AbstractFloodFiller.cs.

41 {
42
43 }

◆ AbstractFloodFiller() [2/2]

Bio.Graphics.AbstractFloodFiller.AbstractFloodFiller ( AbstractFloodFiller configSource)

Definition at line 47 of file AbstractFloodFiller.cs.

48 {
49 if (configSource != null)
50 {
51 this.Bitmap = configSource.Bitmap;
52 this.FillColor = configSource.FillColor;
53 this.FillDiagonally = configSource.FillDiagonally;;
54 this.Tolerance = configSource.Tolerance;
55 }
56 }

Member Function Documentation

◆ FloodFill()

void Bio.Graphics.AbstractFloodFiller.FloodFill ( Point pt)
abstract

It fills the area of the image that is connected to the point pt with the current color

Parameters
ptThe starting point for the fill.

◆ PrepareForFloodFill()

void Bio.Graphics.AbstractFloodFiller.PrepareForFloodFill ( Point pt)
protected

It takes a point on the bitmap and gets the color of that point. It then creates a new color that is the fill color. It then gets the stride, pixel format size, pixel format, and the bitmap bits. It then creates a new boolean array that is the size of the bitmap bits divided by the pixel format size

Parameters
ptThe point to start the flood fill from.

Definition at line 95 of file AbstractFloodFiller.cs.

96 {
97 startColor = bitmap.GetPixel((int)pt.X, (int)pt.Y);
98 byteFillColor = new ColorS(fillColor.B, fillColor.G, fillColor.R);
99 bitmapStride=bitmap.Stride;
100 bitmapPixelFormatSize=bitmap.PixelFormatSize;
101 pixelFormat = bitmap.PixelFormat;
102 bitmapBits = bitmap.Bytes;
103 bitmapWidth = bitmap.SizeX;
104 bitmapHeight = bitmap.SizeY;
105 pixelsChecked = new bool[bitmapBits.Length / bitmapPixelFormatSize];
106 }

Member Data Documentation

◆ bitmap

Bitmap Bio.Graphics.AbstractFloodFiller.bitmap
protected

Definition at line 16 of file AbstractFloodFiller.cs.

◆ bitmapBits

byte [] Bio.Graphics.AbstractFloodFiller.bitmapBits = null
protected

Definition at line 27 of file AbstractFloodFiller.cs.

◆ bitmapHeight

int Bio.Graphics.AbstractFloodFiller.bitmapHeight = 0
protected

Definition at line 24 of file AbstractFloodFiller.cs.

◆ bitmapPixelFormatSize

int Bio.Graphics.AbstractFloodFiller.bitmapPixelFormatSize = 0
protected

Definition at line 26 of file AbstractFloodFiller.cs.

◆ bitmapStride

int Bio.Graphics.AbstractFloodFiller.bitmapStride = 0
protected

Definition at line 25 of file AbstractFloodFiller.cs.

◆ bitmapWidth

int Bio.Graphics.AbstractFloodFiller.bitmapWidth = 0
protected

Definition at line 23 of file AbstractFloodFiller.cs.

◆ byteFillColor

ColorS Bio.Graphics.AbstractFloodFiller.byteFillColor
protected

Definition at line 36 of file AbstractFloodFiller.cs.

◆ fillColor

ColorS Bio.Graphics.AbstractFloodFiller.fillColor = ColorS.FromColor(Color.Black)
protected

Definition at line 18 of file AbstractFloodFiller.cs.

◆ fillDiagonally

bool Bio.Graphics.AbstractFloodFiller.fillDiagonally = false
protected

Definition at line 19 of file AbstractFloodFiller.cs.

◆ pixelFormat

PixelFormat Bio.Graphics.AbstractFloodFiller.pixelFormat
protected

Definition at line 28 of file AbstractFloodFiller.cs.

◆ pixelsChecked

bool [] Bio.Graphics.AbstractFloodFiller.pixelsChecked
protected

Definition at line 35 of file AbstractFloodFiller.cs.

◆ slow

bool Bio.Graphics.AbstractFloodFiller.slow = false
protected

Definition at line 20 of file AbstractFloodFiller.cs.

◆ startColor

ColorS Bio.Graphics.AbstractFloodFiller.startColor
protected

Definition at line 37 of file AbstractFloodFiller.cs.

◆ tolerance

ColorS Bio.Graphics.AbstractFloodFiller.tolerance = new ColorS(25, 25, 25)
protected

Definition at line 17 of file AbstractFloodFiller.cs.

Property Documentation

◆ Bitmap

Bitmap Bio.Graphics.AbstractFloodFiller.Bitmap
getset

Definition at line 76 of file AbstractFloodFiller.cs.

77 {
78 get { return bitmap; }
79 set
80 {
81 bitmap = value;
82 }
83 }

◆ FillColor

ColorS Bio.Graphics.AbstractFloodFiller.FillColor
getset

Definition at line 58 of file AbstractFloodFiller.cs.

59 {
60 get { return fillColor; }
61 set { fillColor = value; }
62 }

◆ FillDiagonally

bool Bio.Graphics.AbstractFloodFiller.FillDiagonally
getset

Definition at line 64 of file AbstractFloodFiller.cs.

65 {
66 get { return fillDiagonally; }
67 set { fillDiagonally = value; }
68 }

◆ Tolerance

ColorS Bio.Graphics.AbstractFloodFiller.Tolerance
getset

Definition at line 70 of file AbstractFloodFiller.cs.

71 {
72 get { return tolerance; }
73 set { tolerance = value; }
74 }

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