Skip to content

Commit

Permalink
src/training: Replace proprietary BOOL8 by standard bool data type
Browse files Browse the repository at this point in the history
Signed-off-by: Stefan Weil <sw@weilnetz.de>
  • Loading branch information
stweil committed Jun 3, 2018
1 parent 3aa9b37 commit f2698c2
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 24 deletions.
28 changes: 11 additions & 17 deletions src/training/mergenf.cpp
Expand Up @@ -259,7 +259,7 @@ double EvidenceOf (double Similarity) {
}

/**
* This routine returns TRUE if Feature would be matched
* This routine returns true if Feature would be matched
* by a fast match table built from Proto.
*
* @param Feature feature to be "fast matched" to proto
Expand All @@ -269,13 +269,10 @@ double EvidenceOf (double Similarity) {
* - training_tangent_bbox_pad bounding box pad tangent to proto
* - training_orthogonal_bbox_pad bounding box pad orthogonal to proto
*
* @return TRUE if feature could match Proto.
* @return true if feature could match Proto.
* @note Exceptions: none
* @note History: Wed Nov 14 17:19:58 1990, DSJ, Created.
*/
BOOL8 DummyFastMatch (
FEATURE Feature,
PROTO Proto)
bool DummyFastMatch(FEATURE Feature, PROTO Proto)
{
FRECT BoundingBox;
FLOAT32 MaxAngleError;
Expand All @@ -287,7 +284,7 @@ BOOL8 DummyFastMatch (
AngleError = 1.0 - AngleError;

if (AngleError > MaxAngleError)
return (FALSE);
return false;

ComputePaddedBoundingBox (Proto,
training_tangent_bbox_pad * GetPicoFeatureLength (),
Expand Down Expand Up @@ -336,19 +333,16 @@ void ComputePaddedBoundingBox (PROTO Proto, FLOAT32 TangentPad,
} /* ComputePaddedBoundingBox */

/**
* Return TRUE if point (X,Y) is inside of Rectangle.
* Return true if point (X,Y) is inside of Rectangle.
*
* Globals: none
*
* @return TRUE if point (X,Y) is inside of Rectangle.
* @return true if point (X,Y) is inside of Rectangle.
* @note Exceptions: none
* @note History: Wed Nov 14 17:26:35 1990, DSJ, Created.
*/
BOOL8 PointInside(FRECT *Rectangle, FLOAT32 X, FLOAT32 Y) {
if (X < Rectangle->MinX) return (FALSE);
if (X > Rectangle->MaxX) return (FALSE);
if (Y < Rectangle->MinY) return (FALSE);
if (Y > Rectangle->MaxY) return (FALSE);
return (TRUE);

bool PointInside(FRECT *Rectangle, FLOAT32 X, FLOAT32 Y) {
return (X >= Rectangle->MinX) &&
(X <= Rectangle->MaxX) &&
(Y >= Rectangle->MinY) &&
(Y <= Rectangle->MaxY);
} /* PointInside */
9 changes: 2 additions & 7 deletions src/training/mergenf.h
Expand Up @@ -85,19 +85,14 @@ FLOAT32 SubfeatureEvidence (
double EvidenceOf (
double Similarity);

BOOL8 DummyFastMatch (
FEATURE Feature,
PROTO Proto);
bool DummyFastMatch(FEATURE Feature, PROTO Proto);

void ComputePaddedBoundingBox (
PROTO Proto,
FLOAT32 TangentPad,
FLOAT32 OrthogonalPad,
FRECT *BoundingBox);

BOOL8 PointInside (
FRECT *Rectangle,
FLOAT32 X,
FLOAT32 Y);
bool PointInside(FRECT *Rectangle, FLOAT32 X, FLOAT32 Y);

#endif // TESSERACT_TRAINING_MERGENF_H_

0 comments on commit f2698c2

Please sign in to comment.