Version: 1.0
Enumerations | Functions
conact_code_generator.h File Reference
#include <ostream>
#include <optional>
#include "conact_tree.h"
#include "forest.h"
#include "rule_set.h"

Go to the source code of this file.

Enumerations

enum class  GenerateConditionActionCodeFlags : uint32_t { NONE = 0 , CONDITIONS_WITH_IFS = (1 << 0) , ACTIONS_WITH_CONTINUE = (1 << 1) }
 This is the enum class that defines the available flags for the GeneratePointersConditionsActionsCode function. More...
 
enum class  GenerateActionCodeTypes : uint32_t { LABELING = (1 << 0) , THINNING = (1 << 1) , CHAIN_CODE = (1 << 2) }
 This is the enum class that defines the available algorithms types for the GenerateActionsCode function. More...
 

Functions

constexpr enum GenerateConditionActionCodeFlags operator| (const enum GenerateConditionActionCodeFlags self_value, const enum GenerateConditionActionCodeFlags in_value)
 
constexpr bool operator& (const enum GenerateConditionActionCodeFlags self_value, const enum GenerateConditionActionCodeFlags in_value)
 
constexpr enum GenerateActionCodeTypes operator| (const enum GenerateActionCodeTypes self_value, const enum GenerateActionCodeTypes in_value)
 
constexpr bool operator& (const enum GenerateActionCodeTypes self_value, const enum GenerateActionCodeTypes in_value)
 
bool GeneratePointersConditionsActionsCode (const rule_set &rs, GenerateConditionActionCodeFlags flag=GenerateConditionActionCodeFlags::CONDITIONS_WITH_IFS|GenerateConditionActionCodeFlags::ACTIONS_WITH_CONTINUE, GenerateActionCodeTypes type=GenerateActionCodeTypes::LABELING, std::optional< pixel_set > names=std::nullopt)
 TODO fix documentation names contains the position in the labels image corresponding to the names used in labeling actions. It is necessary to handle blocks names and defaults to mask pixel set if not provided. More...
 

Enumeration Type Documentation

◆ GenerateActionCodeTypes

enum GenerateActionCodeTypes : uint32_t
strong

This is the enum class that defines the available algorithms types for the GenerateActionsCode function.

Enumerator
LABELING 

Connected Components Labeling.

THINNING 

Thinning.

CHAIN_CODE 

Chain Code.

Definition at line 37 of file conact_code_generator.h.

◆ GenerateConditionActionCodeFlags

enum GenerateConditionActionCodeFlags : uint32_t
strong

This is the enum class that defines the available flags for the GeneratePointersConditionsActionsCode function.

Enumerator
NONE 

No flags.

CONDITIONS_WITH_IFS 

Whether to add if statements or not when generating conditions code. They serve to check if the pixel we want to check is inside the image or not. All the algorithms that make use of prediction can avoid these checks because they are inbuilt in the forest.

ACTIONS_WITH_CONTINUE 

Whether to add continues at the end of each action or not.

Definition at line 28 of file conact_code_generator.h.

Function Documentation

◆ GeneratePointersConditionsActionsCode()

TODO fix documentation names contains the position in the labels image corresponding to the names used in labeling actions. It is necessary to handle blocks names and defaults to mask pixel set if not provided.

Definition at line 316 of file conact_code_generator.cpp.

◆ operator&() [1/2]

constexpr bool operator& ( const enum GenerateActionCodeTypes  self_value,
const enum GenerateActionCodeTypes  in_value 
)
constexpr

Definition at line 37 of file conact_code_generator.h.

◆ operator&() [2/2]

constexpr bool operator& ( const enum GenerateConditionActionCodeFlags  self_value,
const enum GenerateConditionActionCodeFlags  in_value 
)
constexpr

Definition at line 28 of file conact_code_generator.h.

◆ operator|() [1/2]

constexpr enum GenerateActionCodeTypes operator| ( const enum GenerateActionCodeTypes  self_value,
const enum GenerateActionCodeTypes  in_value 
)
constexpr

Definition at line 28 of file conact_code_generator.h.

◆ operator|() [2/2]

constexpr enum GenerateConditionActionCodeFlags operator| ( const enum GenerateConditionActionCodeFlags  self_value,
const enum GenerateConditionActionCodeFlags  in_value 
)
constexpr

Definition at line 1 of file conact_code_generator.h.