Skip to content

Commit

Permalink
remove OSresult::get_rotation_from_orientation() API introduced in co…
Browse files Browse the repository at this point in the history
…mmit 67dd310 as this is a duplicate of the already existing OrientationIdToValue() API.
  • Loading branch information
GerHobbelt committed Aug 5, 2023
1 parent b9a1070 commit c1d030a
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 13 deletions.
3 changes: 0 additions & 3 deletions include/tesseract/osdetect.h
Original file line number Diff line number Diff line change
Expand Up @@ -68,9 +68,6 @@ struct OSResults {
void print_scores(void) const;
void print_scores(int orientation_id) const;

// Produce the clock-wise rotation (in degrees) for the given orientation ID.
static int get_rotation_from_orientation(int orientation_id);

// Array holding scores for each orientation id [0,3].
// Orientation ids [0..3] map to [0, 270, 180, 90] degree orientations of the
// page respectively, where the values refer to the amount of clockwise
Expand Down
11 changes: 1 addition & 10 deletions src/ccmain/osdetect.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -124,19 +124,10 @@ int OSResults::get_best_script(int orientation_id) const {
return max_id;
}

// Produce the clock-wise rotation (in degrees) for the given orientation ID.
int OSResults::get_rotation_from_orientation(int orientation_id) {
static int orientation_degrees_mapping[4] = {0, 270, 180, 90};

if (orientation_id < 0 || orientation_id >= 4)
return 0;
return orientation_degrees_mapping[orientation_id];
}

// Print the script scores for all possible orientations.
void OSResults::print_scores(void) const {
for (int i = 0; i < 4; ++i) {
tprintf("Orientation id #{}: {} degrees", i, get_rotation_from_orientation(i));
tprintf("Orientation id #{}: {} degrees", i, OrientationIdToValue(i));
print_scores(i);
}
}
Expand Down

0 comments on commit c1d030a

Please sign in to comment.