tesseract v5.3.3.20231005
tesseract::StaticShape Class Reference

#include <static_shape.h>

Public Member Functions

 StaticShape ()
 
int batch () const
 
void set_batch (int value)
 
int height () const
 
void set_height (int value)
 
int width () const
 
void set_width (int value)
 
int depth () const
 
void set_depth (int value)
 
LossType loss_type () const
 
void set_loss_type (LossType value)
 
void SetShape (int batch, int height, int width, int depth)
 
void Print () const
 
bool DeSerialize (TFile *fp)
 
bool Serialize (TFile *fp) const
 

Detailed Description

Definition at line 38 of file static_shape.h.

Constructor & Destructor Documentation

◆ StaticShape()

tesseract::StaticShape::StaticShape ( )
inline

Definition at line 40 of file static_shape.h.

40: batch_(0), height_(0), width_(0), depth_(0), loss_type_(LT_NONE) {}

Member Function Documentation

◆ batch()

int tesseract::StaticShape::batch ( ) const
inline

Definition at line 41 of file static_shape.h.

41 {
42 return batch_;
43 }

◆ depth()

int tesseract::StaticShape::depth ( ) const
inline

Definition at line 59 of file static_shape.h.

59 {
60 return depth_;
61 }

◆ DeSerialize()

bool tesseract::StaticShape::DeSerialize ( TFile fp)
inline

Definition at line 83 of file static_shape.h.

83 {
84 int32_t tmp = LT_NONE;
85 bool result = fp->DeSerialize(&batch_) && fp->DeSerialize(&height_) &&
86 fp->DeSerialize(&width_) && fp->DeSerialize(&depth_) && fp->DeSerialize(&tmp);
87 loss_type_ = static_cast<LossType>(tmp);
88 return result;
89 }

◆ height()

int tesseract::StaticShape::height ( ) const
inline

Definition at line 47 of file static_shape.h.

47 {
48 return height_;
49 }

◆ loss_type()

LossType tesseract::StaticShape::loss_type ( ) const
inline

Definition at line 65 of file static_shape.h.

65 {
66 return loss_type_;
67 }

◆ Print()

void tesseract::StaticShape::Print ( ) const
inline

Definition at line 78 of file static_shape.h.

78 {
79 tprintf("Batch=%d, Height=%d, Width=%d, Depth=%d, loss=%d\n", batch_, height_, width_, depth_,
80 loss_type_);
81 }
void tprintf(const char *format,...)
Definition: tprintf.cpp:41

◆ Serialize()

bool tesseract::StaticShape::Serialize ( TFile fp) const
inline

Definition at line 91 of file static_shape.h.

91 {
92 int32_t tmp = loss_type_;
93 return fp->Serialize(&batch_) && fp->Serialize(&height_) && fp->Serialize(&width_) &&
94 fp->Serialize(&depth_) && fp->Serialize(&tmp);
95 }

◆ set_batch()

void tesseract::StaticShape::set_batch ( int  value)
inline

Definition at line 44 of file static_shape.h.

44 {
45 batch_ = value;
46 }
int value

◆ set_depth()

void tesseract::StaticShape::set_depth ( int  value)
inline

Definition at line 62 of file static_shape.h.

62 {
63 depth_ = value;
64 }

◆ set_height()

void tesseract::StaticShape::set_height ( int  value)
inline

Definition at line 50 of file static_shape.h.

50 {
51 height_ = value;
52 }

◆ set_loss_type()

void tesseract::StaticShape::set_loss_type ( LossType  value)
inline

Definition at line 68 of file static_shape.h.

68 {
69 loss_type_ = value;
70 }

◆ set_width()

void tesseract::StaticShape::set_width ( int  value)
inline

Definition at line 56 of file static_shape.h.

56 {
57 width_ = value;
58 }

◆ SetShape()

void tesseract::StaticShape::SetShape ( int  batch,
int  height,
int  width,
int  depth 
)
inline

Definition at line 71 of file static_shape.h.

71 {
72 batch_ = batch;
73 height_ = height;
74 width_ = width;
75 depth_ = depth;
76 }

◆ width()

int tesseract::StaticShape::width ( ) const
inline

Definition at line 53 of file static_shape.h.

53 {
54 return width_;
55 }

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