#include <pithsync.h>
|
| FPCUTPT ()=default |
|
void | setup (FPCUTPT cutpts[], int16_t array_origin, STATS *projection, int16_t zero_count, int16_t pitch, int16_t x, int16_t offset) |
|
void | assign (FPCUTPT cutpts[], int16_t array_origin, int16_t x, bool faking, bool mid_cut, int16_t offset, STATS *projection, float projection_scale, int16_t zero_count, int16_t pitch, int16_t pitch_error) |
|
void | assign_cheap (FPCUTPT cutpts[], int16_t array_origin, int16_t x, bool faking, bool mid_cut, int16_t offset, STATS *projection, float projection_scale, int16_t zero_count, int16_t pitch, int16_t pitch_error) |
|
int32_t | position () |
|
double | cost_function () |
|
double | squares () |
|
double | sum () |
|
FPCUTPT * | previous () |
|
int16_t | cheap_cuts () const |
|
int16_t | index () const |
|
Definition at line 30 of file pithsync.h.
◆ FPCUTPT()
tesseract::FPCUTPT::FPCUTPT |
( |
| ) |
|
|
default |
◆ assign()
void tesseract::FPCUTPT::assign |
( |
FPCUTPT |
cutpts[], |
|
|
int16_t |
array_origin, |
|
|
int16_t |
x, |
|
|
bool |
faking, |
|
|
bool |
mid_cut, |
|
|
int16_t |
offset, |
|
|
STATS * |
projection, |
|
|
float |
projection_scale, |
|
|
int16_t |
zero_count, |
|
|
int16_t |
pitch, |
|
|
int16_t |
pitch_error |
|
) |
| |
Definition at line 97 of file pithsync.cpp.
112 int16_t balance_count;
121 int16_t half_pitch = pitch / 2 - 1;
124 if (half_pitch > 31) {
126 }
else if (half_pitch < 0) {
129 lead_flag = 1 << half_pitch;
131 back_balance = cutpts[x - 1 - array_origin].back_balance << 1;
132 back_balance &= lead_flag + (lead_flag - 1);
133 if (projection->pile_count(x) > zero_count) {
136 fwd_balance = cutpts[x - 1 - array_origin].fwd_balance >> 1;
137 if (projection->pile_count(x + half_pitch) > zero_count) {
138 fwd_balance |= lead_flag;
148 for (
index = x - pitch - pitch_error;
index <= x - pitch + pitch_error;
index++) {
149 if (
index >= array_origin) {
150 segpt = &cutpts[
index - array_origin];
151 dist = x - segpt->xpos;
152 if (!segpt->terminal && segpt->fake_count < INT16_MAX) {
156 lead_flag = back_balance ^ segpt->fwd_balance;
158 while (lead_flag != 0) {
160 lead_flag &= lead_flag - 1;
163 for (balance_index = 0;
index + balance_index < x - balance_index; balance_index++) {
164 balance_count += (projection->pile_count(
index + balance_index) <= zero_count) ^
165 (projection->pile_count(x - balance_index) <= zero_count);
171 r_index = segpt->region_index + 1;
172 total = segpt->mean_sum + dist;
173 balance_count += offset;
174 sq_dist = dist * dist + segpt->sq_sum + balance_count * balance_count;
175 mean = total / r_index;
176 factor = mean - pitch;
178 factor += sq_dist / (r_index)-mean * mean;
185 mid_cuts = segpt->mid_cuts + mid_cut;
186 region_index = r_index;
double textord_balance_factor
bool textord_fast_pitch_test
◆ assign_cheap()
void tesseract::FPCUTPT::assign_cheap |
( |
FPCUTPT |
cutpts[], |
|
|
int16_t |
array_origin, |
|
|
int16_t |
x, |
|
|
bool |
faking, |
|
|
bool |
mid_cut, |
|
|
int16_t |
offset, |
|
|
STATS * |
projection, |
|
|
float |
projection_scale, |
|
|
int16_t |
zero_count, |
|
|
int16_t |
pitch, |
|
|
int16_t |
pitch_error |
|
) |
| |
Definition at line 199 of file pithsync.cpp.
213 int16_t balance_count;
222 int16_t half_pitch = pitch / 2 - 1;
225 if (half_pitch > 31) {
227 }
else if (half_pitch < 0) {
230 lead_flag = 1 << half_pitch;
232 back_balance = cutpts[x - 1 - array_origin].back_balance << 1;
233 back_balance &= lead_flag + (lead_flag - 1);
234 if (projection->pile_count(x) > zero_count) {
237 fwd_balance = cutpts[x - 1 - array_origin].fwd_balance >> 1;
238 if (projection->pile_count(x + half_pitch) > zero_count) {
239 fwd_balance |= lead_flag;
250 if (
index >= array_origin) {
251 segpt = &cutpts[
index - array_origin];
252 dist = x - segpt->xpos;
253 if (!segpt->terminal && segpt->fake_count < INT16_MAX) {
256 lead_flag = back_balance ^ segpt->fwd_balance;
258 while (lead_flag != 0) {
260 lead_flag &= lead_flag - 1;
265 r_index = segpt->region_index + 1;
266 total = segpt->mean_sum + dist;
267 balance_count += offset;
268 sq_dist = dist * dist + segpt->sq_sum + balance_count * balance_count;
269 mean = total / r_index;
270 factor = mean - pitch;
272 factor += sq_dist / (r_index)-mean * mean;
278 mid_cuts = segpt->mid_cuts + mid_cut;
279 region_index = r_index;
◆ cheap_cuts()
int16_t tesseract::FPCUTPT::cheap_cuts |
( |
| ) |
const |
|
inline |
◆ cost_function()
double tesseract::FPCUTPT::cost_function |
( |
| ) |
|
|
inline |
◆ index()
int16_t tesseract::FPCUTPT::index |
( |
| ) |
const |
|
inline |
◆ position()
int32_t tesseract::FPCUTPT::position |
( |
| ) |
|
|
inline |
◆ previous()
FPCUTPT* tesseract::FPCUTPT::previous |
( |
| ) |
|
|
inline |
◆ setup()
void tesseract::FPCUTPT::setup |
( |
FPCUTPT |
cutpts[], |
|
|
int16_t |
array_origin, |
|
|
STATS * |
projection, |
|
|
int16_t |
zero_count, |
|
|
int16_t |
pitch, |
|
|
int16_t |
x, |
|
|
int16_t |
offset |
|
) |
| |
Definition at line 38 of file pithsync.cpp.
48 int16_t half_pitch = pitch / 2 - 1;
52 if (half_pitch > 31) {
54 }
else if (half_pitch < 0) {
57 lead_flag = 1 << half_pitch;
61 sq_sum = offset * offset;
69 if (x == array_origin) {
72 for (ind = 0; ind <= half_pitch; ind++) {
74 if (projection->pile_count(ind) > zero_count) {
75 fwd_balance |= lead_flag;
79 back_balance = cutpts[x - 1 - array_origin].back_balance << 1;
80 back_balance &= lead_flag + (lead_flag - 1);
81 if (projection->pile_count(x) > zero_count) {
84 fwd_balance = cutpts[x - 1 - array_origin].fwd_balance >> 1;
85 if (projection->pile_count(x + half_pitch) > zero_count) {
86 fwd_balance |= lead_flag;
◆ squares()
double tesseract::FPCUTPT::squares |
( |
| ) |
|
|
inline |
◆ sum()
double tesseract::FPCUTPT::sum |
( |
| ) |
|
|
inline |
◆ fake_count
int16_t tesseract::FPCUTPT::fake_count |
◆ faked
bool tesseract::FPCUTPT::faked |
◆ terminal
bool tesseract::FPCUTPT::terminal |
The documentation for this class was generated from the following files: