diff options
author | Stanislaw Halik <sthalik@misaki.pl> | 2022-10-07 22:00:01 +0200 |
---|---|---|
committer | Stanislaw Halik <sthalik@misaki.pl> | 2022-10-07 22:00:01 +0200 |
commit | 766909047b6873b5af3f9aa98c6ed8cd53c6cc54 (patch) | |
tree | 3b32bc3035f14c2072fd687e2c9b18b7860c88e0 /anim-crop-tool | |
parent | d19a44bcb53cebbee0ae51981f66b93b31cb9dcb (diff) |
a
Diffstat (limited to 'anim-crop-tool')
-rw-r--r-- | anim-crop-tool/atlas.cpp | 7 | ||||
-rw-r--r-- | anim-crop-tool/main.cpp | 2 |
2 files changed, 5 insertions, 4 deletions
diff --git a/anim-crop-tool/atlas.cpp b/anim-crop-tool/atlas.cpp index 4b005d60..8ee52054 100644 --- a/anim-crop-tool/atlas.cpp +++ b/anim-crop-tool/atlas.cpp @@ -12,7 +12,7 @@ void anim_atlas_row::add_entry(const anim_atlas_entry& x) auto& frame = *x.frame; const auto& mat = x.mat; frame.offset = {xpos, ypos}; - frame.size = {mat.cols, mat.rows}; + frame.size = {(unsigned)mat.cols, (unsigned)mat.rows}; ASSERT(mat.rows > 0 && mat.cols > 0); data.push_back(x); @@ -54,8 +54,9 @@ bool anim_atlas::dump(const std::filesystem::path& filename) const for (const anim_atlas_row& row : rows) for (const anim_atlas_entry& x : row.data) { - auto offset = x.frame->offset, size = x.frame->size; - cv::Rect roi = {offset[0], offset[1], size[0], size[1]}; + auto offset = x.frame->offset; + auto size = x.frame->size; + cv::Rect roi = {offset[0], offset[1], (int)size[0], (int)size[1]}; x.mat.copyTo(mat(roi)); } diff --git a/anim-crop-tool/main.cpp b/anim-crop-tool/main.cpp index a95d3bae..d1115bdc 100644 --- a/anim-crop-tool/main.cpp +++ b/anim-crop-tool/main.cpp @@ -117,7 +117,7 @@ static bool load_file(anim_group& group, options& opts, anim_atlas& atlas, const (int)std::round((group.ground[1] - start[1]) * opts.scale), }; - group.frames.push_back({ground, atlas.offset(), {dest_size.width, dest_size.height}}); + group.frames.push_back({ground, atlas.offset(), {(unsigned)dest_size.width, (unsigned)dest_size.height}}); atlas.add_entry({&group.frames.back(), std::move(resized)}); return true; } |