Files
2024-02-27 15:29:15 +08:00

227 lines
8.3 KiB
C++

/***********************************************************
* File generated by the HALCON-Compiler hcomp version 18.05
* Usage: Interface to C++
*
* Software by: MVTec Software GmbH, www.mvtec.com
***********************************************************/
#ifndef HCPP_HSAMPLEIDENTIFIER
#define HCPP_HSAMPLEIDENTIFIER
namespace HalconCpp
{
// Represents an instance of a sample identifier.
class LIntExport HSampleIdentifier : public HHandle
{
public:
// Create an uninitialized instance
HSampleIdentifier():HHandle() {}
// Copy constructor
HSampleIdentifier(const HSampleIdentifier& source) : HHandle(source) {}
// Copy constructor
HSampleIdentifier(const HHandle& handle);
// Create HSampleIdentifier from handle, taking ownership
explicit HSampleIdentifier(Hlong handle);
bool operator==(const HHandle& obj) const
{
return HHandleBase::operator==(obj);
}
bool operator!=(const HHandle& obj) const
{
return HHandleBase::operator!=(obj);
}
protected:
// Verify matching semantic type ('sample_identifier')!
virtual void AssertType(Hphandle handle) const;
public:
// Deep copy of all data represented by this object instance
HSampleIdentifier Clone() const;
/*****************************************************************************
* Operator-based class constructors
*****************************************************************************/
// read_sample_identifier: Read a sample identifier from a file.
explicit HSampleIdentifier(const HString& FileName);
// read_sample_identifier: Read a sample identifier from a file.
explicit HSampleIdentifier(const char* FileName);
// create_sample_identifier: Create a new sample identifier.
explicit HSampleIdentifier(const HTuple& GenParamName, const HTuple& GenParamValue);
/***************************************************************************
* Operators *
***************************************************************************/
// Free the memory of a sample identifier.
void ClearSampleIdentifier() const;
// Deserialize a serialized sample identifier.
void DeserializeSampleIdentifier(const HSerializedItem& SerializedItemHandle);
// Read a sample identifier from a file.
void ReadSampleIdentifier(const HString& FileName);
// Read a sample identifier from a file.
void ReadSampleIdentifier(const char* FileName);
// Serialize a sample identifier.
HSerializedItem SerializeSampleIdentifier() const;
// Write a sample identifier to a file.
void WriteSampleIdentifier(const HString& FileName) const;
// Write a sample identifier to a file.
void WriteSampleIdentifier(const char* FileName) const;
// Identify objects with a sample identifier.
HTuple ApplySampleIdentifier(const HImage& Image, Hlong NumResults, double RatingThreshold, const HTuple& GenParamName, const HTuple& GenParamValue, HTuple* Rating) const;
// Identify objects with a sample identifier.
Hlong ApplySampleIdentifier(const HImage& Image, Hlong NumResults, double RatingThreshold, const HTuple& GenParamName, const HTuple& GenParamValue, double* Rating) const;
// Get selected parameters of a sample identifier.
HTuple GetSampleIdentifierParam(const HString& GenParamName) const;
// Get selected parameters of a sample identifier.
HTuple GetSampleIdentifierParam(const char* GenParamName) const;
// Set selected parameters of a sample identifier.
void SetSampleIdentifierParam(const HString& GenParamName, const HTuple& GenParamValue) const;
// Set selected parameters of a sample identifier.
void SetSampleIdentifierParam(const HString& GenParamName, double GenParamValue) const;
// Set selected parameters of a sample identifier.
void SetSampleIdentifierParam(const char* GenParamName, double GenParamValue) const;
// Retrieve information about an object of a sample identifier.
HTuple GetSampleIdentifierObjectInfo(const HTuple& ObjectIdx, const HTuple& InfoName) const;
// Retrieve information about an object of a sample identifier.
HTuple GetSampleIdentifierObjectInfo(Hlong ObjectIdx, const HString& InfoName) const;
// Retrieve information about an object of a sample identifier.
HTuple GetSampleIdentifierObjectInfo(Hlong ObjectIdx, const char* InfoName) const;
// Define a name or a description for an object of a sample identifier.
void SetSampleIdentifierObjectInfo(const HTuple& ObjectIdx, const HString& InfoName, const HTuple& InfoValue) const;
// Define a name or a description for an object of a sample identifier.
void SetSampleIdentifierObjectInfo(Hlong ObjectIdx, const HString& InfoName, const HString& InfoValue) const;
// Define a name or a description for an object of a sample identifier.
void SetSampleIdentifierObjectInfo(Hlong ObjectIdx, const char* InfoName, const char* InfoValue) const;
// Remove training data from a sample identifier.
void RemoveSampleIdentifierTrainingData(const HTuple& ObjectIdx, const HTuple& ObjectSampleIdx) const;
// Remove training data from a sample identifier.
void RemoveSampleIdentifierTrainingData(Hlong ObjectIdx, Hlong ObjectSampleIdx) const;
// Remove preparation data from a sample identifier.
void RemoveSampleIdentifierPreparationData(const HTuple& ObjectIdx, const HTuple& ObjectSampleIdx) const;
// Remove preparation data from a sample identifier.
void RemoveSampleIdentifierPreparationData(Hlong ObjectIdx, Hlong ObjectSampleIdx) const;
// Train a sample identifier.
void TrainSampleIdentifier(const HTuple& GenParamName, const HTuple& GenParamValue) const;
// Add training data to an existing sample identifier.
Hlong AddSampleIdentifierTrainingData(const HImage& SampleImage, const HTuple& ObjectIdx, const HTuple& GenParamName, const HTuple& GenParamValue) const;
// Add training data to an existing sample identifier.
Hlong AddSampleIdentifierTrainingData(const HImage& SampleImage, Hlong ObjectIdx, const HTuple& GenParamName, const HTuple& GenParamValue) const;
// Adapt the internal data structure of a sample identifier to the objects to be identified.
void PrepareSampleIdentifier(const HString& RemovePreparationData, const HTuple& GenParamName, const HTuple& GenParamValue) const;
// Adapt the internal data structure of a sample identifier to the objects to be identified.
void PrepareSampleIdentifier(const char* RemovePreparationData, const HTuple& GenParamName, const HTuple& GenParamValue) const;
// Add preparation data to an existing sample identifier.
Hlong AddSampleIdentifierPreparationData(const HImage& SampleImage, const HTuple& ObjectIdx, const HTuple& GenParamName, const HTuple& GenParamValue) const;
// Add preparation data to an existing sample identifier.
Hlong AddSampleIdentifierPreparationData(const HImage& SampleImage, Hlong ObjectIdx, const HTuple& GenParamName, const HTuple& GenParamValue) const;
// Create a new sample identifier.
void CreateSampleIdentifier(const HTuple& GenParamName, const HTuple& GenParamValue);
};
// forward declarations and types for internal array implementation
template<class T> class HSmartPtr;
template<class T> class HHandleBaseArrayRef;
typedef HHandleBaseArrayRef<HSampleIdentifier> HSampleIdentifierArrayRef;
typedef HSmartPtr< HSampleIdentifierArrayRef > HSampleIdentifierArrayPtr;
// Represents multiple tool instances
class LIntExport HSampleIdentifierArray : public HHandleBaseArray
{
public:
// Create empty array
HSampleIdentifierArray();
// Create array from native array of tool instances
HSampleIdentifierArray(HSampleIdentifier* classes, Hlong length);
// Copy constructor
HSampleIdentifierArray(const HSampleIdentifierArray &tool_array);
// Destructor
virtual ~HSampleIdentifierArray();
// Assignment operator
HSampleIdentifierArray &operator=(const HSampleIdentifierArray &tool_array);
// Clears array and all tool instances
virtual void Clear();
// Get array of native tool instances
const HSampleIdentifier* Tools() const;
// Get number of tools
virtual Hlong Length() const;
// Create tool array from tuple of handles
virtual void SetFromTuple(const HTuple& handles);
// Get tuple of handles for tool array
virtual HTuple ConvertToTuple() const;
protected:
// Smart pointer to internal data container
HSampleIdentifierArrayPtr *mArrayPtr;
};
}
#endif