Skip to content

Commit

Permalink
fixed issue #1
Browse files Browse the repository at this point in the history
  • Loading branch information
jian-dong committed Aug 30, 2023
1 parent 344d376 commit 45b471d
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/pyorbbecsdk/frame.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -243,15 +243,15 @@ void define_frame_set(const py::object& m) {
return py::list();
}
auto points_size =
static_cast<ssize_t>(frame->dataSize() / sizeof(OBPoint));
static_cast<size_t>(frame->dataSize() / sizeof(OBPoint));
auto scale = depth_frame->getValueScale();
auto points = reinterpret_cast<OBPoint*>(frame->data());
if (!points) {
std::cerr << "cast points failed" << std::endl;
return py::list();
}
py::list result;
for (ssize_t i = 0; i < points_size; ++i) {
for (size_t i = 0; i < points_size; ++i) {
auto point = points[i];
point.x *= scale;
point.y *= scale;
Expand Down Expand Up @@ -283,7 +283,7 @@ void define_frame_set(const py::object& m) {
if (!frame) {
return py::list();
}
auto points_size = static_cast<ssize_t>(frame->dataSize() /
auto points_size = static_cast<size_t>(frame->dataSize() /
sizeof(OBColorPoint));
auto scale = depth_frame->getValueScale();
auto points = reinterpret_cast<OBColorPoint*>(frame->data());
Expand All @@ -292,7 +292,7 @@ void define_frame_set(const py::object& m) {
return py::list();
}
py::list result;
for (ssize_t i = 0; i < points_size; ++i) {
for (size_t i = 0; i < points_size; ++i) {
auto point = points[i];
point.x *= scale;
point.y *= scale;
Expand Down

0 comments on commit 45b471d

Please sign in to comment.