BioLib  4.3.0
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 (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.

Constructor & Destructor Documentation

◆ AbstractFloodFiller() [1/2]

Bio.Graphics.AbstractFloodFiller.AbstractFloodFiller ( )
41 {
42
43 }

◆ AbstractFloodFiller() [2/2]

Bio.Graphics.AbstractFloodFiller.AbstractFloodFiller ( AbstractFloodFiller configSource)
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.
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 }
ColorS byteFillColor
Definition AbstractFloodFiller.cs:36
ColorS startColor
Definition AbstractFloodFiller.cs:37
ColorS fillColor
Definition AbstractFloodFiller.cs:18
int bitmapWidth
Definition AbstractFloodFiller.cs:23
int bitmapPixelFormatSize
Definition AbstractFloodFiller.cs:26
byte[] bitmapBits
Definition AbstractFloodFiller.cs:27
int bitmapStride
Definition AbstractFloodFiller.cs:25
Bitmap bitmap
Definition AbstractFloodFiller.cs:16
int bitmapHeight
Definition AbstractFloodFiller.cs:24
PixelFormat pixelFormat
Definition AbstractFloodFiller.cs:28
bool[] pixelsChecked
Definition AbstractFloodFiller.cs:35

Member Data Documentation

◆ bitmap

Bitmap Bio.Graphics.AbstractFloodFiller.bitmap
protected

◆ bitmapBits

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

◆ bitmapHeight

int Bio.Graphics.AbstractFloodFiller.bitmapHeight = 0
protected

◆ bitmapPixelFormatSize

int Bio.Graphics.AbstractFloodFiller.bitmapPixelFormatSize = 0
protected

◆ bitmapStride

int Bio.Graphics.AbstractFloodFiller.bitmapStride = 0
protected

◆ bitmapWidth

int Bio.Graphics.AbstractFloodFiller.bitmapWidth = 0
protected

◆ byteFillColor

ColorS Bio.Graphics.AbstractFloodFiller.byteFillColor
protected

◆ fillColor

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

◆ fillDiagonally

bool Bio.Graphics.AbstractFloodFiller.fillDiagonally = false
protected

◆ pixelFormat

PixelFormat Bio.Graphics.AbstractFloodFiller.pixelFormat
protected

◆ pixelsChecked

bool [] Bio.Graphics.AbstractFloodFiller.pixelsChecked
protected

◆ slow

bool Bio.Graphics.AbstractFloodFiller.slow = false
protected

◆ startColor

ColorS Bio.Graphics.AbstractFloodFiller.startColor
protected

◆ tolerance

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

Property Documentation

◆ Bitmap

Bitmap Bio.Graphics.AbstractFloodFiller.Bitmap
getset
77 {
78 get { return bitmap; }
79 set
80 {
81 bitmap = value;
82 }
83 }

◆ FillColor

ColorS Bio.Graphics.AbstractFloodFiller.FillColor
getset
59 {
60 get { return fillColor; }
61 set { fillColor = value; }
62 }

◆ FillDiagonally

bool Bio.Graphics.AbstractFloodFiller.FillDiagonally
getset
65 {
66 get { return fillDiagonally; }
67 set { fillDiagonally = value; }
68 }
bool fillDiagonally
Definition AbstractFloodFiller.cs:19

◆ Tolerance

ColorS Bio.Graphics.AbstractFloodFiller.Tolerance
getset
71 {
72 get { return tolerance; }
73 set { tolerance = value; }
74 }
ColorS tolerance
Definition AbstractFloodFiller.cs:17

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