tesseract 3.04.01

tesseract::ShapeRating Struct Reference

#include <shapetable.h>

List of all members.

Public Member Functions

 ShapeRating ()
 ShapeRating (int s, float r)

Static Public Member Functions

static int SortDescendingRating (const void *t1, const void *t2)
static int FirstResultWithUnichar (const GenericVector< ShapeRating > &results, const ShapeTable &shape_table, UNICHAR_ID unichar_id)

Public Attributes

int shape_id
float rating
float raw
float font
bool joined
bool broken

Detailed Description

Definition at line 93 of file shapetable.h.


Constructor & Destructor Documentation

tesseract::ShapeRating::ShapeRating ( ) [inline]

Definition at line 94 of file shapetable.h.

    : shape_id(0), rating(0.0f), raw(0.0f), font(0.0f),
      joined(false), broken(false) {}
tesseract::ShapeRating::ShapeRating ( int  s,
float  r 
) [inline]

Definition at line 97 of file shapetable.h.

    : shape_id(s), rating(r), raw(1.0f), font(0.0f),
      joined(false), broken(false) {}

Member Function Documentation

int tesseract::ShapeRating::FirstResultWithUnichar ( const GenericVector< ShapeRating > &  results,
const ShapeTable shape_table,
UNICHAR_ID  unichar_id 
) [static]

Definition at line 38 of file shapetable.cpp.

                           {
  for (int r = 0; r < results.size(); ++r) {
    int shape_id = results[r].shape_id;
    const Shape& shape = shape_table.GetShape(shape_id);
    if (shape.ContainsUnichar(unichar_id)) {
      return r;
    }
  }
  return -1;
}
static int tesseract::ShapeRating::SortDescendingRating ( const void *  t1,
const void *  t2 
) [inline, static]

Definition at line 102 of file shapetable.h.

                                                                  {
    const ShapeRating* a = reinterpret_cast<const ShapeRating *>(t1);
    const ShapeRating* b = reinterpret_cast<const ShapeRating *>(t2);
    if (a->rating > b->rating) {
      return -1;
    } else if (a->rating < b->rating) {
      return 1;
    } else {
      return a->shape_id - b->shape_id;
    }
  }

Member Data Documentation

Definition at line 133 of file shapetable.h.

Definition at line 129 of file shapetable.h.

Definition at line 131 of file shapetable.h.

Definition at line 125 of file shapetable.h.

Definition at line 127 of file shapetable.h.

Definition at line 122 of file shapetable.h.


The documentation for this struct was generated from the following files:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines