* 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. */
| 1058 | * direction and position to/from accumulators of a small neighbourhood. |
| 1059 | */ |
| 1060 | void 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 | |
| 1073 | ICOORD C_OUTLINE::chain_step(int chaindir) { |
| 1074 | return step_coords[chaindir % 4]; |
nothing calls this directly
no test coverage detected