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

Method increment_step

deps/tesseract/ccstruct/coutln.cpp:1060–1071  ·  view source on GitHub ↗

* Helper for ComputeBinaryOffsets. Increments pos, dir_counts, pos_totals * by the step, increment, and vertical step ? x : y position * increment * at step s Mod stepcount respectively. Used to add or subtract the * direction and position to/from accumulators of a small neighbourhood. */

Source from the content-addressed store, hash-verified

1058 * direction and position to/from accumulators of a small neighbourhood.
1059 */
1060void C_OUTLINE::increment_step(int s, int increment, ICOORD* pos,
1061 int* dir_counts, int* pos_totals) const {
1062 int step_index = Modulo(s, stepcount);
1063 int dir_index = chain_code(step_index);
1064 dir_counts[dir_index] += increment;
1065 ICOORD step_vec = step(step_index);
1066 if (step_vec.x() == 0)
1067 pos_totals[dir_index] += pos->x() * increment;
1068 else
1069 pos_totals[dir_index] += pos->y() * increment;
1070 *pos += step_vec;
1071}
1072
1073ICOORD C_OUTLINE::chain_step(int chaindir) {
1074 return step_coords[chaindir % 4];

Callers

nothing calls this directly

Calls 5

ModuloFunction · 0.85
chain_codeFunction · 0.85
stepFunction · 0.85
xMethod · 0.45
yMethod · 0.45

Tested by

no test coverage detected