CVB++ 15.0
ReaderConfig Class Reference

Contains a map of configurations for all active barcode types. More...

#include <cvb/barcode/reader_config.hpp>

Public Member Functions

void * Handle () const noexcept
 Returns C-API style handle to the reader config. More...
 
void Save (Cvb::String fileName)
 Writes the data of the configuration to file. More...
 
void Flush ()
 Write all parameters to the handle. More...
 
template<typename TConfig >
std::shared_ptr< TConfig > Configuration ()
 Returns an existing configuration in the object. More...
 
template<typename TConfig >
std::shared_ptr< TConfig > CreateConfiguration ()
 Creates a new configuration for the object. More...
 
template<typename TConfig >
void RemoveConfiguration ()
 Removes a configuration from map. More...
 
void SetReadoutMode (Readout readoutMode)
 Set the the readout mode. More...
 
Readout ReadoutMode () const noexcept
 Access the readout mode. More...
 
void SetReadoutStripeDistance (int range)
 Set the distance between lines in pixel. More...
 
int ReadoutStripeDistance () const noexcept
 Get the distance between lines in pixel. More...
 
void SetOmniDirectionalReadoutAngleCount (int numAngle)
 Set the absolute number of profile rotations. More...
 
int OmniDirectionalReadoutAngleCount () const noexcept
 Set the absolute number of profile rotations. More...
 
void SetOmniDirectionalReadoutStripeCount (int numStripe)
 Set the absolute number of profile lines. More...
 
int OmniDirectionalReadoutStripeCount () const noexcept
 Get the absolute number of profile lines. More...
 
void SetCheckCodePosition (bool checkPosition)
 This function sets the parameter for the Code Position Check. More...
 
bool CheckCodePosition () const noexcept
 This function returns the parameter for the Code Position Check. More...
 
void SetTimeLimit (int timeLimit)
 This function sets the maximum evaluation time for the decoding of a barcode. More...
 
int TimeLimit () const noexcept
 This function returns the maximum evaluation time for the decoding of a barcode. More...
 
bool ContainsSymbology (Symbology symbology) const
 Check if the object contains the given symbology. More...
 

Static Public Member Functions

static std::unique_ptr< ReaderConfigFromHandle (HandleGuard< ReaderConfig > &&guard)
 Creates reader config from a classic API handle. More...
 
static std::unique_ptr< ReaderConfigLoad (const Cvb::String &fileName)
 Reads the configuration data from file. More...
 

Detailed Description

Contains a map of configurations for all active barcode types.

Use this object to initialize configurations.

Member Function Documentation

◆ CheckCodePosition()

bool CheckCodePosition ( ) const
inlinenoexcept

This function returns the parameter for the Code Position Check.

An edge can have its coordinates outside the image borders in case the barcode is incomplete

Returns
Evaluate / don't evaluate evaluate code position check. The parameter checkPosition enables and disables the code position check configuration config. Specifying TRUE enables and FALSE disables the code position check.
Exceptions
Anyexception derived from std::exception including CvbException.
See also
SetCheckCodePosition

◆ Configuration()

std::shared_ptr< TConfig > Configuration ( )
inline

Returns an existing configuration in the object.

The template needs to be a barcode configuration inherited from Barcode::Config::ConfigBase.

Returns
Returns the pointer to an existing configuration object. Otherwise returns nullptr.
Exceptions
Anyexception derived from std::exception including CvbException.

◆ ContainsSymbology()

bool ContainsSymbology ( Symbology  symbology) const
inline

Check if the object contains the given symbology.

Parameters
[in]symbologySymbology to check if it is available.
Returns
Returns true in case the symbology is available in the map. Otherwise false.
Exceptions
Anyexception derived from std::exception including CvbException.

◆ CreateConfiguration()

std::shared_ptr< TConfig > CreateConfiguration ( )
inline

Creates a new configuration for the object.

The template needs to be a barcode configuration inherited from Barcode::Config::ConfigBase. In case the requested configuration already exists, this configuration is returned. Otherwise creates a new configuration, adds it to the map and returns it.

Returns
Returns the pointer to a (new) configuration object.
Exceptions
Anyexception derived from std::exception including CvbException.
See also
RemoveConfiguration InsertConfiguration

◆ Flush()

void Flush ( )
inline

Write all parameters to the handle.

Exceptions
Anyexception derived from std::exception including CvbException.

◆ FromHandle()

static std::unique_ptr< ReaderConfig > FromHandle ( HandleGuard< ReaderConfig > &&  guard)
inlinestatic

Creates reader config from a classic API handle.

The ReaderConfig takes ownership of the handle, so you must share it before using this function.

Parameters
[in]guardLife time guard for C-API handle.
Returns
The ReaderConfig created from the classic API handle.
Exceptions
Anyexception derived from std::exception including CvbException.
See also
Handle

◆ Handle()

void * Handle ( ) const
inlinenoexcept

Returns C-API style handle to the reader config.

Returns
C-API handle
See also
FromHandle

◆ Load()

static std::unique_ptr< ReaderConfig > Load ( const Cvb::String fileName)
inlinestatic

Reads the configuration data from file.

Parameters
[in]fileNameName of the file, possibly with path specification.
Exceptions
Anyexception derived from std::exception including CvbException.
See also
Save

◆ OmniDirectionalReadoutAngleCount()

int OmniDirectionalReadoutAngleCount ( ) const
inlinenoexcept

Set the absolute number of profile rotations.

Number of readout angles (only used in omni directional readout mode).

Returns
Absolute number of profile rotations.
Exceptions
Anyexception derived from std::exception including CvbException.
See also
SetOmniDirectionalReadoutAngleCount

◆ OmniDirectionalReadoutStripeCount()

int OmniDirectionalReadoutStripeCount ( ) const
inlinenoexcept

Get the absolute number of profile lines.

Number of readout stripes (only used in omni directional readout mode).

Returns
Absolute number of profile lines.
Exceptions
Anyexception derived from std::exception including CvbException.
See also
SetOmniDirectionalReadoutStripeCount

◆ ReadoutMode()

Readout ReadoutMode ( ) const
inlinenoexcept

Access the readout mode.

Returns
Returns the readout mode.
Exceptions
Anyexception derived from std::exception including CvbException.
See also
SetReadoutMode

◆ ReadoutStripeDistance()

int ReadoutStripeDistance ( ) const
inlinenoexcept

Get the distance between lines in pixel.

The Readout definition for the readout modes Ladder, Fence and FenceOrLadder.

Returns
Distance between lines in pixel.
Exceptions
Anyexception derived from std::exception including CvbException.
See also
SetReadoutStripeDistance

◆ RemoveConfiguration()

void RemoveConfiguration ( )
inline

Removes a configuration from map.

The template needs to be a barcode configuration inherited from Barcode::Config::ConfigBase.

Exceptions
Anyexception derived from std::exception including CvbException.
See also
CreateConfiguration InsertConfiguration

◆ Save()

void Save ( Cvb::String  fileName)
inline

Writes the data of the configuration to file.

The data is stored in an ASCII format which is based on the format of the Windows INI files. If necessary, it can be edited using a simple ASCII editor.

Parameters
[in]fileNameName of the file, possibly with path specification.
Exceptions
Anyexception derived from std::exception including CvbException.
See also
Load

◆ SetCheckCodePosition()

void SetCheckCodePosition ( bool  checkPosition)
inline

This function sets the parameter for the Code Position Check.

An edge can have its coordinates outside the image borders in case the barcode is incomplete

Parameters
[in]checkPositionEvaluate / don't evaluate evaluate code position check. The parameter checkPosition enables and disables the code position check configuration config. Specifying TRUE enables and FALSE disables the code position check.
Exceptions
Anyexception derived from std::exception including CvbException.
See also
CheckCodePosition

◆ SetOmniDirectionalReadoutAngleCount()

void SetOmniDirectionalReadoutAngleCount ( int  numAngle)
inline

Set the absolute number of profile rotations.

Number of readout angles (only used in omni directional readout mode).

Parameters
[in]numAngleAbsolute number of profile rotations.
Exceptions
Anyexception derived from std::exception including CvbException.
See also
OmniDirectionalReadoutAngleCount

◆ SetOmniDirectionalReadoutStripeCount()

void SetOmniDirectionalReadoutStripeCount ( int  numStripe)
inline

Set the absolute number of profile lines.

Number of readout stripes (only used in omni directional readout mode).

Parameters
[in]numStripeAbsolute number of profile lines.
Exceptions
Anyexception derived from std::exception including CvbException.
See also
OmniDirectionalReadoutStripeCount

◆ SetReadoutMode()

void SetReadoutMode ( Readout  readoutMode)
inline

Set the the readout mode.

Parameters
[in]readoutModeModifies the readout mode
Exceptions
Anyexception derived from std::exception including CvbException.
See also
ReadoutMode

◆ SetReadoutStripeDistance()

void SetReadoutStripeDistance ( int  range)
inline

Set the distance between lines in pixel.

The Readout definition for the readout modes Ladder, Fence and FenceOrLadder.

Parameters
[in]rangeDistance between lines in pixel.
Exceptions
Anyexception derived from std::exception including CvbException.
See also
ReadoutStripeDistance

◆ SetTimeLimit()

void SetTimeLimit ( int  timeLimit)
inline

This function sets the maximum evaluation time for the decoding of a barcode.

It sets the maximum time which may be required for evaluation when using the configuration config. When the configuration cannot be concluded in this time, the function Reader::Decode throws an exception even if the code is present in the image. For time measurement, Barcode uses the function clock() from the standard C library. On PC systems this generally has temporary resolution of approximately 55 ms. There is therefore no point specifying values less than 55 ms. On high performance PC systems, the evaluation time is generally below 50 ms. Thus this function is only of use in connection with slow systems. The actual decoding time may deviate from the specified time by plus/minus 55 ms. When configuration is generated, the value of 1000 milliseconds is entered as the default decoding time. This value should always be achieved on modern PC systems.

Parameters
[in]timeLimitMaximum decoding time in milliseconds.
Exceptions
Anyexception derived from std::exception including CvbException.
See also
TimeLimit

◆ TimeLimit()

int TimeLimit ( ) const
inlinenoexcept

This function returns the maximum evaluation time for the decoding of a barcode.

It returns the maximum time which may be required for evaluation when using the configuration config. When the configuration cannot be concluded in this time, the function Reader::Decode throws an exception even if the code is present in the image. For time measurement, Barcode uses the function clock() from the standard C library. On PC systems this generally has temporary resolution of approximately 55 ms. There is therefore no point specifying values less than 55 ms. On high performance PC systems, the evaluation time is generally below 50 ms. Thus this function is only of use in connection with slow systems. The actual decoding time may deviate from the specified time by plus/minus 55 ms. When configuration is generated, the value of 1000 milliseconds is entered as the default decoding time. This value should always be achieved on modern PC systems.

Exceptions
Anyexception derived from std::exception including CvbException.
See also
SetTimeLimit