KSquare Utilities
MorphOpStruct.h
Go to the documentation of this file.
1 /* MorphOpStruct.cpp -- Morphological operators use to perform erosion.
2  * Copyright (C) 1994-2014 Kurt Kramer
3  * For conditions of distribution and use, see copyright notice in KKB.h
4  */
5 #if !defined(_MORPHOPSTRUCT_)
6 #define _MORPHOPSTRUCT_
7 
8 #include "KKBaseTypes.h"
9 #include "MorphOp.h"
10 
11 
12 #if !defined(_RASTER_)
13 namespace KKB
14 {
15  class Raster;
16  typedef Raster* RasterPtr;
17 }
18 #endif
19 
20 
21 
22 namespace KKB
23 {
24  class MorphOpStruct : public MorphOp
25  {
26  public:
27  MorphOpStruct (StructureType _structure,
28  kkuint16 _structureSize
29  );
30 
31  virtual ~MorphOpStruct ();
32 
33  virtual OperationType Operation () const {return OperationType::Erosion;}
34 
35  virtual RasterPtr PerformOperation (RasterConstPtr _image) = 0;
36 
38 
39  void BackgroundCountTH (kkint32 _backgroundCountTH) {backgroundCountTH = _backgroundCountTH;}
40  void ForegroundCountTH (kkint32 _foregroundCountTH) {foregroundCountTH = _foregroundCountTH;}
41 
42 
43  protected:
44  bool Fit (kkint32 row,
45  kkint32 col
46  ) const;
47 
48  bool FitBackgroundCount (kkint32 row,
49  kkint32 col
50  ) const;
51 
53  kkint32 col
54  ) const;
55 
57  kkint32 backgroundCountTH; /**< If greater than zero; then pixel must have at least that many neighbors to be considered a fit. */
60  }; /* MorphOpStruct */
61 
63 }; /* KKB */
64 
65 
66 
67 #endif
__int32 kkint32
Definition: KKBaseTypes.h:88
void ForegroundCountTH(kkint32 _foregroundCountTH)
Definition: MorphOpStruct.h:40
void BackgroundCountTH(kkint32 _backgroundCountTH)
Definition: MorphOpStruct.h:39
kkuint16 structureSize
Definition: MorphOpStruct.h:59
MorphOpStruct * MorphOpStructPtr
Definition: MorphOpStruct.h:62
unsigned __int16 kkuint16
16 bit unsigned integer.
Definition: KKBaseTypes.h:86
A class that is used by to represent a single image in memory.
Definition: Raster.h:108
kkint32 backgroundCountTH
Definition: MorphOpStruct.h:57
virtual OperationType Operation() const
Definition: MorphOpStruct.h:33
kkint32 MemoryConsumedEstimated()
KKTHread * KKTHreadPtr
MorphOpStruct(StructureType _structure, kkuint16 _structureSize)
virtual ~MorphOpStruct()
virtual RasterPtr PerformOperation(RasterConstPtr _image)=0
unsigned char uchar
Unsigned character.
Definition: KKBaseTypes.h:77
StructureType structure
Definition: MorphOpStruct.h:56
bool Fit(kkint32 row, kkint32 col) const
bool FitBackgroundCount(kkint32 row, kkint32 col) const
kkint32 foregroundCountTH
Definition: MorphOpStruct.h:58
Base class for all Morphological operations.
Definition: MorphOp.h:44
uchar HitForegroundCount(kkint32 row, kkint32 col) const