/********************************************************************** * grade_sharpness * * Return a grade for the sharpness of this split. * 0 = "perfect" * 100 = "no way jay" **********************************************************************/ PRIORITY Wordrec::grade_sharpness(register SPLIT *split) { register PRIORITY grade; grade = point_priority (split->point1) + point_priority (split->point2); if (grade < -360.0) grade = 0; else grade += 360.0; grade *= chop_sharpness_knob; /* Values 0 to -360 */ return (grade); }
/** * @name add_point_to_list * * Add an edge point to a POINT_GROUP containing a list of other points. */ void Wordrec::add_point_to_list(PointHeap* point_heap, EDGEPT *point) { if (point_heap->size() < MAX_NUM_POINTS - 2) { PointPair pair(point_priority(point), point); point_heap->Push(&pair); } #ifndef GRAPHICS_DISABLED if (chop_debug > 2) mark_outline(point); #endif }
/** * @name new_max_point * * Found a new minimum point try to decide whether to save it or not. * Return the new value for the local minimum. If a point is saved then * the local minimum is reset to nullptr. */ void Wordrec::new_max_point(EDGEPT *local_max, PointHeap* points) { int16_t dir; dir = direction (local_max); if (dir > 0) { add_point_to_list(points, local_max); return; } if (dir == 0 && point_priority (local_max) < 0) { add_point_to_list(points, local_max); return; } }