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

paulmthompson / WhiskerToolbox / 14759446314

30 Apr 2025 04:26PM UTC coverage: 18.699% (+1.7%) from 16.999%
14759446314

push

github

paulmthompson
fix test errors

319 of 1706 relevant lines covered (18.7%)

1.87 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 "Masks/Mask_Data.hpp"
5
#include "Points/Point_Data.hpp"
6

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

10

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

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

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

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

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

30

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

41
    point_data->setImageSize(ImageSize());
×
42
}
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