tesseract  3.03
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 78 of file shapetable.h.


Constructor & Destructor Documentation

Definition at line 79 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 82 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 87 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 118 of file shapetable.h.

Definition at line 114 of file shapetable.h.

Definition at line 116 of file shapetable.h.

Definition at line 110 of file shapetable.h.

Definition at line 112 of file shapetable.h.

Definition at line 107 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