OrbbecSDK 2.0.18
OrbbecSDK: Software-Development-Kit for Orbbec 3D Cameras
Loading...
Searching...
No Matches
ob::Filter Class Reference

The Filter class is the base class for all filters in the SDK. More...

#include <Filter.hpp>

+ Inheritance diagram for ob::Filter:

Public Member Functions

 Filter (ob_filter *impl)
 
virtual ~Filter () noexcept
 
ob_filtergetImpl () const
 Get the Impl object of the filter.
 
virtual const std::string & getName () const
 Get the type of filter.
 
virtual void reset () const
 Reset the filter, freeing the internal cache, stopping the processing thread, and clearing the pending buffer frame when asynchronous processing is used.
 
virtual void enable (bool enable) const
 enable the filter
 
virtual bool isEnabled () const
 Return Enable State.
 
virtual std::shared_ptr< Frameprocess (std::shared_ptr< const Frame > frame) const
 Processes a frame synchronously.
 
virtual void pushFrame (std::shared_ptr< Frame > frame) const
 Pushes the pending frame into the cache for asynchronous processing.
 
virtual void setCallBack (FilterCallback callback)
 Set the callback function for asynchronous processing.
 
virtual std::string getConfigSchema () const
 Get config schema of the filter.
 
virtual std::vector< OBFilterConfigSchemaItemgetConfigSchemaVec () const
 Get the Config Schema Vec object.
 
virtual void setConfigValue (const std::string &configName, double value) const
 Set the filter config value by name.
 
virtual double getConfigValue (const std::string &configName) const
 Get the Config Value object by name.
 
virtual const char * type ()
 
template<typename T >
bool is ()
 Check if the runtime type of the filter object is compatible with a given type.
 
template<typename T >
std::shared_ptr< T > as ()
 

Protected Member Functions

 Filter ()=default
 Default constructor with nullptr impl, used for derived classes only.
 
virtual void init (ob_filter *impl)
 

Protected Attributes

ob_filterimpl_ = nullptr
 
std::string name_
 
FilterCallback callback_
 
std::vector< OBFilterConfigSchemaItemconfigSchemaVec_
 

Detailed Description

The Filter class is the base class for all filters in the SDK.

Definition at line 76 of file Filter.hpp.

Constructor & Destructor Documentation

◆ Filter() [1/2]

ob::Filter::Filter ( )
protecteddefault

Default constructor with nullptr impl, used for derived classes only.

◆ Filter() [2/2]

ob::Filter::Filter ( ob_filter * impl)
inlineexplicit

Definition at line 112 of file Filter.hpp.

◆ ~Filter()

virtual ob::Filter::~Filter ( )
inlinevirtualnoexcept

Definition at line 116 of file Filter.hpp.

Member Function Documentation

◆ init()

◆ getImpl()

ob_filter * ob::Filter::getImpl ( ) const
inline

Get the Impl object of the filter.

Returns
ob_filter* The Impl object of the filter.

Definition at line 129 of file Filter.hpp.

◆ getName()

virtual const std::string & ob::Filter::getName ( ) const
inlinevirtual

Get the type of filter.

Returns
string The type of filte.

Definition at line 138 of file Filter.hpp.

Referenced by type().

◆ reset()

virtual void ob::Filter::reset ( ) const
inlinevirtual

Reset the filter, freeing the internal cache, stopping the processing thread, and clearing the pending buffer frame when asynchronous processing is used.

Definition at line 146 of file Filter.hpp.

◆ enable()

virtual void ob::Filter::enable ( bool enable) const
inlinevirtual

enable the filter

Definition at line 155 of file Filter.hpp.

Referenced by enable(), and isEnabled().

◆ isEnabled()

virtual bool ob::Filter::isEnabled ( ) const
inlinevirtual

Return Enable State.

Definition at line 164 of file Filter.hpp.

◆ process()

virtual std::shared_ptr< Frame > ob::Filter::process ( std::shared_ptr< const Frame > frame) const
inlinevirtual

Processes a frame synchronously.

Parameters
frameThe frame to be processed.
Returns
std::shared_ptr< Frame > The processed frame.

Definition at line 177 of file Filter.hpp.

◆ pushFrame()

virtual void ob::Filter::pushFrame ( std::shared_ptr< Frame > frame) const
inlinevirtual

Pushes the pending frame into the cache for asynchronous processing.

Parameters
frameThe pending frame. The processing result is returned by the callback function.

Definition at line 192 of file Filter.hpp.

◆ setCallBack()

virtual void ob::Filter::setCallBack ( FilterCallback callback)
inlinevirtual

Set the callback function for asynchronous processing.

Parameters
callbackThe processing result callback.

Definition at line 203 of file Filter.hpp.

◆ getConfigSchema()

virtual std::string ob::Filter::getConfigSchema ( ) const
inlinevirtual

Get config schema of the filter.

The returned string is a csv format string representing the configuration schema of the filter. The format of the string is: <parameter_name>, <parameter_type: "int", "float", "bool">, <minimum_value>, <maximum_value>, <value_step>, <default_value>, <parameter_description>

Returns
std::string The config schema of the filter.

Definition at line 217 of file Filter.hpp.

◆ getConfigSchemaVec()

virtual std::vector< OBFilterConfigSchemaItem > ob::Filter::getConfigSchemaVec ( ) const
inlinevirtual

Get the Config Schema Vec object.

The returned vector contains the config schema items. Each item in the vector is an OBFilterConfigSchemaItem object.

Returns
std::vector<OBFilterConfigSchemaItem> The vector of the filter config schema.

Definition at line 230 of file Filter.hpp.

◆ setConfigValue()

virtual void ob::Filter::setConfigValue ( const std::string & configName,
double value ) const
inlinevirtual

Set the filter config value by name.

Attention
The pass into value type is double, witch will be cast to the actual type inside the filter. The actual type can be queried by the filter config schema returned by getConfigSchemaVec.
Parameters
configNameThe name of the config.
valueThe value of the config.

Definition at line 243 of file Filter.hpp.

Referenced by ob::Align::Align(), ob::SequenceIdFilter::selectSequenceId(), ob::PointCloudFilter::setColorDataNormalization(), ob::PointCloudFilter::setCoordinateDataScaled(), ob::PointCloudFilter::setCoordinateSystem(), ob::PointCloudFilter::setCreatePointFormat(), and ob::FormatConvertFilter::setFormatConvertType().

◆ getConfigValue()

virtual double ob::Filter::getConfigValue ( const std::string & configName) const
inlinevirtual

Get the Config Value object by name.

Attention
The returned value type has been casted to double inside the filter. The actual type can be queried by the filter config schema returned by getConfigSchemaVec.
Parameters
configNameThe name of the config.
Returns
double The value of the config.

Definition at line 258 of file Filter.hpp.

Referenced by ob::Align::getAlignToStreamType(), and ob::SequenceIdFilter::getSelectSequenceId().

◆ type()

virtual const char * ob::Filter::type ( )
inlinevirtual

◆ is()

template<typename T >
bool ob::Filter::is ( )

Check if the runtime type of the filter object is compatible with a given type.

Define the is() template function for the Filter class.

Template Parameters
TThe given type.
Returns
bool The result.

Definition at line 1003 of file Filter.hpp.

Referenced by as().

◆ as()

template<typename T >
std::shared_ptr< T > ob::Filter::as ( )
inline

Definition at line 285 of file Filter.hpp.

Member Data Documentation

◆ impl_

ob_filter* ob::Filter::impl_ = nullptr
protected

◆ name_

std::string ob::Filter::name_
protected

Definition at line 79 of file Filter.hpp.

Referenced by getName(), and init().

◆ callback_

FilterCallback ob::Filter::callback_
protected

Definition at line 80 of file Filter.hpp.

Referenced by setCallBack().

◆ configSchemaVec_

std::vector<OBFilterConfigSchemaItem> ob::Filter::configSchemaVec_
protected

Definition at line 81 of file Filter.hpp.

Referenced by getConfigSchemaVec(), and init().


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