tesseract 5.2.0
Loading...
Searching...
No Matches
tesseract::INT_CLASS_STRUCT Struct Reference

#include <intproto.h>

Public Member Functions

 INT_CLASS_STRUCT ()=default
 
 INT_CLASS_STRUCT (int MaxNumProtos, int MaxNumConfigs)
 
 ~INT_CLASS_STRUCT ()
 

Public Attributes

uint16_t NumProtos = 0
 
uint8_t NumProtoSets = 0
 
uint8_t NumConfigs = 0
 
PROTO_SET_STRUCTProtoSets [MAX_NUM_PROTO_SETS]
 
std::vector< uint8_t > ProtoLengths
 
uint16_t ConfigLengths [MAX_NUM_CONFIGS]
 
int font_set_id = 0
 

Detailed Description

Definition at line 93 of file intproto.h.

Constructor & Destructor Documentation

◆ INT_CLASS_STRUCT() [1/2]

tesseract::INT_CLASS_STRUCT::INT_CLASS_STRUCT ( )
default

◆ INT_CLASS_STRUCT() [2/2]

tesseract::INT_CLASS_STRUCT::INT_CLASS_STRUCT ( int  MaxNumProtos,
int  MaxNumConfigs 
)

This constructor creates a new integer class data structure and returns it. Sufficient space is allocated to handle the specified number of protos and configs.

Parameters
MaxNumProtosnumber of protos to allocate space for
MaxNumConfigsnumber of configs to allocate space for

Definition at line 573 of file intproto.cpp.

573 :
574 NumProtos(0),
576 NumConfigs(0),
578{
579 assert(MaxNumConfigs <= MAX_NUM_CONFIGS);
581
582 for (int i = 0; i < NumProtoSets; i++) {
583 /* allocate space for a proto set, install in class, and initialize */
584 auto ProtoSet = new PROTO_SET_STRUCT;
585 memset(ProtoSet, 0, sizeof(*ProtoSet));
586 ProtoSets[i] = ProtoSet;
587
588 /* allocate space for the proto lengths and install in class */
589 }
590 memset(ConfigLengths, 0, sizeof(ConfigLengths));
591}
#define MaxNumIntProtosIn(C)
Definition: intproto.h:145
#define MAX_NUM_PROTO_SETS
Definition: intproto.h:50
#define MAX_NUM_CONFIGS
Definition: intproto.h:47
#define PROTOS_PER_PROTO_SET
Definition: intproto.h:49
PROTO_SET_STRUCT * ProtoSets[MAX_NUM_PROTO_SETS]
Definition: intproto.h:100
uint16_t ConfigLengths[MAX_NUM_CONFIGS]
Definition: intproto.h:102
std::vector< uint8_t > ProtoLengths
Definition: intproto.h:101

◆ ~INT_CLASS_STRUCT()

tesseract::INT_CLASS_STRUCT::~INT_CLASS_STRUCT ( )

Definition at line 593 of file intproto.cpp.

593 {
594 for (int i = 0; i < NumProtoSets; i++) {
595 delete ProtoSets[i];
596 }
597}

Member Data Documentation

◆ ConfigLengths

uint16_t tesseract::INT_CLASS_STRUCT::ConfigLengths[MAX_NUM_CONFIGS]

Definition at line 102 of file intproto.h.

◆ font_set_id

int tesseract::INT_CLASS_STRUCT::font_set_id = 0

Definition at line 103 of file intproto.h.

◆ NumConfigs

uint8_t tesseract::INT_CLASS_STRUCT::NumConfigs = 0

Definition at line 99 of file intproto.h.

◆ NumProtos

uint16_t tesseract::INT_CLASS_STRUCT::NumProtos = 0

Definition at line 97 of file intproto.h.

◆ NumProtoSets

uint8_t tesseract::INT_CLASS_STRUCT::NumProtoSets = 0

Definition at line 98 of file intproto.h.

◆ ProtoLengths

std::vector<uint8_t> tesseract::INT_CLASS_STRUCT::ProtoLengths

Definition at line 101 of file intproto.h.

◆ ProtoSets

PROTO_SET_STRUCT* tesseract::INT_CLASS_STRUCT::ProtoSets[MAX_NUM_PROTO_SETS]

Definition at line 100 of file intproto.h.


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