• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

paulmthompson / WhiskerToolbox / 14843312717

05 May 2025 06:19PM UTC coverage: 22.285% (+4.0%) from 18.243%
14843312717

push

github

paulmthompson
add point tests

470 of 2109 relevant lines covered (22.29%)

2.09 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

0.0
/src/WhiskerToolbox/DataManager/transforms/data_transforms.cpp
1

2
#include "data_transforms.hpp"
3

4
#include "Points/Point_Data.hpp"
5

6
#include <map>
7
#include <numeric>
8

9

10
void scale(std::shared_ptr<PointData> & point_data, ImageSize const & image_size_media) {
×
11
    auto image_size_point = point_data->getImageSize();
×
12

13
    auto const media_height = image_size_media.height;
×
14
    auto const media_width = image_size_media.width;
×
15
    auto const point_height = image_size_point.height;
×
16
    auto const point_width = image_size_point.width;
×
17

18
    if (media_width == point_width && media_height == media_width) {
×
19
        return;
×
20
    }
21

22
    if (point_width == -1 || point_height == -1) {
×
23
        return;
×
24
    }
25

26
    float const height_ratio = static_cast<float>(media_height) / static_cast<float>(point_height);
×
27
    float const width_ratio = static_cast<float>(media_width) / static_cast<float>(point_width);
×
28

29

30
    for (auto const & point_and_time: point_data->GetAllPointsAsRange()) {
×
31
        auto scaled_points = std::vector<Point2D<float>>();
×
32
        for (auto & point: point_and_time.points) {
×
33
            scaled_points.push_back(
×
34
                    {point.x * height_ratio,
×
35
                     point.y * width_ratio});
×
36
        }
37
        point_data->overwritePointsAtTime(point_and_time.time, scaled_points);
×
38
    }
×
39

40
    point_data->setImageSize(ImageSize());
×
41
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc