tesseract v5.3.3.20231005
tesseract::ADAPT_TEMPLATES_STRUCT Class Reference

#include <adaptive.h>

Public Member Functions

 ADAPT_TEMPLATES_STRUCT ()=default
 
 ADAPT_TEMPLATES_STRUCT (UNICHARSET &unicharset)
 
 ~ADAPT_TEMPLATES_STRUCT ()
 

Public Attributes

INT_TEMPLATES_STRUCTTemplates
 
int NumNonEmptyClasses
 
uint8_t NumPermClasses
 
ADAPT_CLASS_STRUCTClass [MAX_NUM_CLASSES]
 

Detailed Description

Definition at line 67 of file adaptive.h.

Constructor & Destructor Documentation

◆ ADAPT_TEMPLATES_STRUCT() [1/2]

tesseract::ADAPT_TEMPLATES_STRUCT::ADAPT_TEMPLATES_STRUCT ( )
default

◆ ADAPT_TEMPLATES_STRUCT() [2/2]

tesseract::ADAPT_TEMPLATES_STRUCT::ADAPT_TEMPLATES_STRUCT ( UNICHARSET unicharset)

Constructor for adapted templates. Add an empty class for each char in unicharset to the newly created templates.

Definition at line 96 of file adaptive.cpp.

96 {
97 Templates = new INT_TEMPLATES_STRUCT;
100
101 /* Insert an empty class for each unichar id in unicharset */
102 for (unsigned i = 0; i < MAX_NUM_CLASSES; i++) {
103 Class[i] = nullptr;
104 if (i < unicharset.size()) {
105 AddAdaptedClass(this, new ADAPT_CLASS_STRUCT, i);
106 }
107 }
108}
#define MAX_NUM_CLASSES
Definition: matchdefs.h:31
void AddAdaptedClass(ADAPT_TEMPLATES_STRUCT *Templates, ADAPT_CLASS_STRUCT *Class, CLASS_ID ClassId)
Definition: adaptive.cpp:41
ADAPT_CLASS_STRUCT * Class[MAX_NUM_CLASSES]
Definition: adaptive.h:75
INT_TEMPLATES_STRUCT * Templates
Definition: adaptive.h:72

◆ ~ADAPT_TEMPLATES_STRUCT()

tesseract::ADAPT_TEMPLATES_STRUCT::~ADAPT_TEMPLATES_STRUCT ( )

Definition at line 110 of file adaptive.cpp.

110 {
111 for (unsigned i = 0; i < (Templates)->NumClasses; i++) {
112 delete Class[i];
113 }
114 delete Templates;
115}

Member Data Documentation

◆ Class

ADAPT_CLASS_STRUCT* tesseract::ADAPT_TEMPLATES_STRUCT::Class[MAX_NUM_CLASSES]

Definition at line 75 of file adaptive.h.

◆ NumNonEmptyClasses

int tesseract::ADAPT_TEMPLATES_STRUCT::NumNonEmptyClasses

Definition at line 73 of file adaptive.h.

◆ NumPermClasses

uint8_t tesseract::ADAPT_TEMPLATES_STRUCT::NumPermClasses

Definition at line 74 of file adaptive.h.

◆ Templates

INT_TEMPLATES_STRUCT* tesseract::ADAPT_TEMPLATES_STRUCT::Templates

Definition at line 72 of file adaptive.h.


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