MCPcopy Create free account
hub / github.com/creatale/node-dv / setup_render

Method setup_render

deps/tesseract/ccstruct/points.cpp:86–107  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

84// subtract major and step a minor step.
85
86void ICOORD::setup_render(ICOORD* major_step, ICOORD* minor_step,
87 int* major, int* minor) const {
88 int abs_x = abs(xcoord);
89 int abs_y = abs(ycoord);
90 if (abs_x >= abs_y) {
91 // X-direction is major.
92 major_step->xcoord = sign(xcoord);
93 major_step->ycoord = 0;
94 minor_step->xcoord = 0;
95 minor_step->ycoord = sign(ycoord);
96 *major = abs_x;
97 *minor = abs_y;
98 } else {
99 // Y-direction is major.
100 major_step->xcoord = 0;
101 major_step->ycoord = sign(ycoord);
102 minor_step->xcoord = sign(xcoord);
103 minor_step->ycoord = 0;
104 *major = abs_y;
105 *minor = abs_x;
106 }
107}
108
109// Returns the standard feature direction corresponding to this.
110// See binary_angle_plus_pi below for a description of the direction.

Callers 1

TraceBlockOnReducedPixFunction · 0.80

Calls 2

signFunction · 0.85
absFunction · 0.50

Tested by

no test coverage detected