SaigeVision C/C++  1.4.7
SaigeVision API document for C/C++
Classification's class information

Functions

eErrorType SR_GetClsTestNumberOfClasses (ClsTestHandle handle, int *numberOfClasses)
 Get the number of classes. More...
 
eErrorType SR_GetClsTestMaxStrLenOfClassName (ClsTestHandle handle, int *len)
 Get a maximum length of class name. More...
 
eErrorType SR_GetClsTestOneClassNameWithWideChar (ClsTestHandle handle, const int classIdx, wchar_t *className)
 Get a wide char name of certain class by given index. More...
 
eErrorType SR_GetClsTestOneClassNameWithMultiByteChar (ClsTestHandle handle, const int classIdx, char *className)
 Get a multi byte char name of certain class by given index. More...
 
eErrorType SR_GetClsTestOneClassColor (ClsTestHandle handle, const int classIdx, int *classColor)
 Get a color of certain class by given index. More...
 

Detailed Description

Get Classification's Class information.

int numOfClasses = 0;
// Get number of classes
eErrorType error = SR_GetClsTestNumberOfClasses(handle, &numOfClasses);
int lengthOfClassName = 0;
error = SR_GetClsTestMaxStrLenOfClassName(handle, &lengthOfClassName);
for (int i = 0; i < numOfClasses; i++){
// Get class name by wchar_t
wchar_t* w_name = new wchar_t[lengthOfClassName];
error = SR_GetClsTestOneClassNameWithWideChar(handle, i, w_name);
delete[] w_name;
// Get class name by char
char* name = new char[lengthOfClassName];
delete[] name;
// Get class color
int class_color = 0;
error = SR_GetClsTestOneClassColor(handle, i, &class_color);
unsigned char R = (class_color >> 16) & 0xFF;
unsigned char G = (class_color >> 8) & 0xFF;
unsigned char B = (class_color) & 0xFF;
}

Function Documentation

◆ SR_GetClsTestMaxStrLenOfClassName()

eErrorType SR_GetClsTestMaxStrLenOfClassName ( ClsTestHandle  handle,
int *  len 
)

Get a maximum length of class name.

Parameters
handleclassification file handler
[out]lenmaximum length of class name
Examples
ExampleClsRuntime.cpp, ExampleClsRuntimeBatchInspection.cpp, and ExampleSeg+ClsRuntime.cpp.

◆ SR_GetClsTestNumberOfClasses()

eErrorType SR_GetClsTestNumberOfClasses ( ClsTestHandle  handle,
int *  numberOfClasses 
)

Get the number of classes.

Parameters
handleclassification file handler
[out]numberOfClasses
Examples
ExampleClsRuntime.cpp, ExampleClsRuntimeBatchInspection.cpp, ExampleClsRuntimeSimple.cpp, and ExampleSeg+ClsRuntime.cpp.

◆ SR_GetClsTestOneClassColor()

eErrorType SR_GetClsTestOneClassColor ( ClsTestHandle  handle,
const int  classIdx,
int *  classColor 
)

Get a color of certain class by given index.

Parameters
handleclassification file handler
classIdx
[out]classColor
Examples
ExampleClsRuntime.cpp, ExampleClsRuntimeBatchInspection.cpp, and ExampleSeg+ClsRuntime.cpp.

◆ SR_GetClsTestOneClassNameWithMultiByteChar()

eErrorType SR_GetClsTestOneClassNameWithMultiByteChar ( ClsTestHandle  handle,
const int  classIdx,
char *  className 
)

Get a multi byte char name of certain class by given index.

Parameters
handleclassification file handler
classIdx
[out]className
Examples
ExampleClsRuntime.cpp, ExampleClsRuntimeBatchInspection.cpp, and ExampleSeg+ClsRuntime.cpp.

◆ SR_GetClsTestOneClassNameWithWideChar()

eErrorType SR_GetClsTestOneClassNameWithWideChar ( ClsTestHandle  handle,
const int  classIdx,
wchar_t *  className 
)

Get a wide char name of certain class by given index.

Parameters
handleclassification file handler
classIdx
[out]className
Examples
ExampleClsRuntime.cpp, ExampleClsRuntimeBatchInspection.cpp, and ExampleSeg+ClsRuntime.cpp.
SR_GetClsTestOneClassNameWithWideChar
eErrorType SR_GetClsTestOneClassNameWithWideChar(ClsTestHandle handle, const int classIdx, wchar_t *className)
Get a wide char name of certain class by given index.
SR_GetClsTestOneClassColor
eErrorType SR_GetClsTestOneClassColor(ClsTestHandle handle, const int classIdx, int *classColor)
Get a color of certain class by given index.
SR_GetClsTestNumberOfClasses
eErrorType SR_GetClsTestNumberOfClasses(ClsTestHandle handle, int *numberOfClasses)
Get the number of classes.
SR_GetClsTestOneClassNameWithMultiByteChar
eErrorType SR_GetClsTestOneClassNameWithMultiByteChar(ClsTestHandle handle, const int classIdx, char *className)
Get a multi byte char name of certain class by given index.
SR_GetClsTestMaxStrLenOfClassName
eErrorType SR_GetClsTestMaxStrLenOfClassName(ClsTestHandle handle, int *len)
Get a maximum length of class name.
eErrorType
eErrorType
Enumerator indicating error codes.
Definition: CommonHeaderDLL.h:25