OpenCV naming convention


Hungarian nomenclature for program naming

Basic naming principles

Variable name = attribute + type + object description

Naming convention

description Instance
Use mixed case for class names ClassName
Types (including enumerations) mixed case TypeName
Local variables, camel case naming localName
Parameter mixed case RountinePara
Member variables m_ClassVariable
Global variable g_GlobalPara
constant CONSTANT
Macro SCREEN_WIDTH

The suffixes of lowercase letters commonly used in Hungarian nomenclature

Prefix Types of description Instance
ch char 8-bit character charGrade
b BOOL Boolean value bEnable
n int Integer nLength
n UINT Unsigned value nHeight
w WORD 16-bit unsigned value wPos
l LONG 32-bit signed value loOffset
dw DWORD 32-bit unsigned integer dwRange
p * pointer pDoc
h handleWindows Object handle hWnd

Keyword letter combination

Describe the content Use key letter combinations
Max Max
Minimum Min
initialization Init
Temporary variables T (or Temp)
Source object Src (abbreviation of source)
Target object Dst (short for destination))

Guess you like

Origin blog.csdn.net/m0_51233386/article/details/113881815