| 1414 | } |
| 1415 | |
| 1416 | double View::index2pixel(uint64_t index, bool has_hoff) |
| 1417 | { |
| 1418 | const uint64_t rateValue = session().cur_snap_samplerate(); |
| 1419 | const double scaleValue = scale(); |
| 1420 | const int64_t offsetValue = offset(); |
| 1421 | const double hoffValue = trig_hoff(); |
| 1422 | |
| 1423 | double pixels = 0; |
| 1424 | |
| 1425 | const double samples_per_pixel = rateValue * scaleValue; |
| 1426 | |
| 1427 | if (has_hoff){ |
| 1428 | pixels = index / samples_per_pixel - offsetValue + hoffValue / samples_per_pixel; |
| 1429 | } |
| 1430 | else{ |
| 1431 | pixels = index / samples_per_pixel - offsetValue; |
| 1432 | } |
| 1433 | |
| 1434 | /* |
| 1435 | const double samples_per_pixel = session().cur_snap_samplerate() * scale(); |
| 1436 | double pixels; |
| 1437 | if (has_hoff) |
| 1438 | pixels = index/samples_per_pixel - offset() + trig_hoff()/samples_per_pixel; |
| 1439 | else |
| 1440 | pixels = index/samples_per_pixel - offset(); |
| 1441 | */ |
| 1442 | |
| 1443 | return pixels; |
| 1444 | } |
| 1445 | |
| 1446 | uint64_t View::pixel2index(double pixel) |
| 1447 | { |
no test coverage detected